@@ -106,8 +106,7 @@ private predicate operandEscapesDomain(Operand operand) {
106
106
not isArgumentForParameter ( _, operand , _) and
107
107
not isOnlyEscapesViaReturnArgument ( operand ) and
108
108
not operand .getUse ( ) instanceof ReturnValueInstruction and
109
- not operand .getUse ( ) instanceof ReturnIndirectionInstruction and
110
- not operand instanceof PhiInputOperand
109
+ not operand .getUse ( ) instanceof ReturnIndirectionInstruction
111
110
}
112
111
113
112
/**
@@ -191,6 +190,11 @@ private predicate operandIsPropagated(Operand operand, IntValue bitOffset, Instr
191
190
// A copy propagates the source value.
192
191
operand = instr .( CopyInstruction ) .getSourceValueOperand ( ) and bitOffset = 0
193
192
)
193
+ or
194
+ operand = instr .( PhiInstruction ) .getAnInputOperand ( ) and
195
+ // Using `unknown` ensures termination since we cannot keep incrementing a bit offset
196
+ // through the back edge of a loop (or through recursion).
197
+ bitOffset = Ints:: unknown ( )
194
198
}
195
199
196
200
private predicate operandEscapesNonReturn ( Operand operand ) {
@@ -212,9 +216,6 @@ private predicate operandEscapesNonReturn(Operand operand) {
212
216
or
213
217
isOnlyEscapesViaReturnArgument ( operand ) and resultEscapesNonReturn ( operand .getUse ( ) )
214
218
or
215
- operand instanceof PhiInputOperand and
216
- resultEscapesNonReturn ( operand .getUse ( ) )
217
- or
218
219
operandEscapesDomain ( operand )
219
220
}
220
221
@@ -236,9 +237,6 @@ private predicate operandMayReachReturn(Operand operand) {
236
237
operand .getUse ( ) instanceof ReturnValueInstruction
237
238
or
238
239
isOnlyEscapesViaReturnArgument ( operand ) and resultMayReachReturn ( operand .getUse ( ) )
239
- or
240
- operand instanceof PhiInputOperand and
241
- resultMayReachReturn ( operand .getUse ( ) )
242
240
}
243
241
244
242
private predicate operandReturned ( Operand operand , IntValue bitOffset ) {
0 commit comments