@@ -550,6 +550,16 @@ class Instruction extends Construction::TInstruction {
550550 */
551551 MemoryAccessKind getResultMemoryAccess ( ) { none ( ) }
552552
553+ /**
554+ * Holds if the memory access performed by this instruction's result will not always write to
555+ * every bit in the memory location. This is most commonly used for memory accesses that may or
556+ * may not actually occur depending on runtime state (for example, the write side effect of an
557+ * output parameter that is not written to on all paths), or for accesses where the memory
558+ * location is a conservative estimate of the memory that might actually be accessed at runtime
559+ * (for example, the global side effects of a function call).
560+ */
561+ predicate hasResultMayMemoryAccess ( ) { none ( ) }
562+
553563 /**
554564 * Gets the operand that holds the memory address to which this instruction stores its
555565 * result, if any. For example, in `m3 = Store r1, r2`, the result of `getResultAddressOperand()`
@@ -1206,9 +1216,9 @@ class SideEffectInstruction extends Instruction {
12061216class CallSideEffectInstruction extends SideEffectInstruction {
12071217 CallSideEffectInstruction ( ) { getOpcode ( ) instanceof Opcode:: CallSideEffect }
12081218
1209- final override MemoryAccessKind getResultMemoryAccess ( ) {
1210- result instanceof EscapedMayMemoryAccess
1211- }
1219+ final override MemoryAccessKind getResultMemoryAccess ( ) { result instanceof EscapedMemoryAccess }
1220+
1221+ final override predicate hasResultMayMemoryAccess ( ) { any ( ) }
12121222}
12131223
12141224/**
@@ -1306,9 +1316,9 @@ class IndirectMayWriteSideEffectInstruction extends WriteSideEffectInstruction {
13061316 getOpcode ( ) instanceof Opcode:: IndirectMayWriteSideEffect
13071317 }
13081318
1309- final override MemoryAccessKind getResultMemoryAccess ( ) {
1310- result instanceof IndirectMayMemoryAccess
1311- }
1319+ final override MemoryAccessKind getResultMemoryAccess ( ) { result instanceof IndirectMemoryAccess }
1320+
1321+ final override predicate hasResultMayMemoryAccess ( ) { any ( ) }
13121322}
13131323
13141324/**
@@ -1318,9 +1328,9 @@ class IndirectMayWriteSideEffectInstruction extends WriteSideEffectInstruction {
13181328class BufferMayWriteSideEffectInstruction extends WriteSideEffectInstruction {
13191329 BufferMayWriteSideEffectInstruction ( ) { getOpcode ( ) instanceof Opcode:: BufferMayWriteSideEffect }
13201330
1321- final override MemoryAccessKind getResultMemoryAccess ( ) {
1322- result instanceof BufferMayMemoryAccess
1323- }
1331+ final override MemoryAccessKind getResultMemoryAccess ( ) { result instanceof BufferMemoryAccess }
1332+
1333+ final override predicate hasResultMayMemoryAccess ( ) { any ( ) }
13241334}
13251335
13261336/**
@@ -1332,9 +1342,9 @@ class SizedBufferMayWriteSideEffectInstruction extends WriteSideEffectInstructio
13321342 getOpcode ( ) instanceof Opcode:: SizedBufferMayWriteSideEffect
13331343 }
13341344
1335- final override MemoryAccessKind getResultMemoryAccess ( ) {
1336- result instanceof BufferMayMemoryAccess
1337- }
1345+ final override MemoryAccessKind getResultMemoryAccess ( ) { result instanceof BufferMemoryAccess }
1346+
1347+ final override predicate hasResultMayMemoryAccess ( ) { any ( ) }
13381348
13391349 Instruction getSizeDef ( ) { result = getAnOperand ( ) .( BufferSizeOperand ) .getDef ( ) }
13401350}
@@ -1345,9 +1355,9 @@ class SizedBufferMayWriteSideEffectInstruction extends WriteSideEffectInstructio
13451355class InlineAsmInstruction extends Instruction {
13461356 InlineAsmInstruction ( ) { getOpcode ( ) instanceof Opcode:: InlineAsm }
13471357
1348- final override MemoryAccessKind getResultMemoryAccess ( ) {
1349- result instanceof EscapedMayMemoryAccess
1350- }
1358+ final override MemoryAccessKind getResultMemoryAccess ( ) { result instanceof EscapedMemoryAccess }
1359+
1360+ final override predicate hasResultMayMemoryAccess ( ) { any ( ) }
13511361}
13521362
13531363/**
0 commit comments