@@ -83,6 +83,10 @@ class ValueNumber extends TValueNumber {
8383 instr order by instr .getBlock ( ) .getDisplayIndex ( ) , instr .getDisplayIndexInBlock ( )
8484 )
8585 }
86+
87+ final Operand getAUse ( ) {
88+ this = valueNumber ( result .getDefinitionInstruction ( ) )
89+ }
8690}
8791
8892/**
@@ -107,6 +111,7 @@ private class CongruentCopyInstruction extends CopyInstruction {
107111 def = this .getSourceValue ( ) and
108112 (
109113 def .getResultMemoryAccess ( ) instanceof IndirectMemoryAccess or
114+ def .getResultMemoryAccess ( ) instanceof PhiMemoryAccess or
110115 not def .hasMemoryResult ( )
111116 )
112117 )
@@ -211,14 +216,21 @@ private predicate uniqueValueNumber(Instruction instr, FunctionIR funcIR) {
211216/**
212217 * Gets the value number assigned to `instr`, if any. Returns at most one result.
213218 */
214- ValueNumber valueNumber ( Instruction instr ) {
219+ cached ValueNumber valueNumber ( Instruction instr ) {
215220 result = nonUniqueValueNumber ( instr ) or
216221 exists ( FunctionIR funcIR |
217222 uniqueValueNumber ( instr , funcIR ) and
218223 result = TUniqueValueNumber ( funcIR , instr )
219224 )
220225}
221226
227+ /**
228+ * Gets the value number assigned to `instr`, if any. Returns at most one result.
229+ */
230+ ValueNumber valueNumberOfOperand ( Operand op ) {
231+ result = valueNumber ( op .getDefinitionInstruction ( ) )
232+ }
233+
222234/**
223235 * Gets the value number assigned to `instr`, if any, unless that instruction is assigned a unique
224236 * value number.
0 commit comments