@@ -66,6 +66,13 @@ module InstructionSanity {
6666 count ( instr .getOperand ( tag ) ) > 1 and
6767 not tag instanceof UnmodeledUseOperand
6868 }
69+
70+ query predicate operandAcrossFunctions (
71+ Instruction op , Instruction operand , OperandTag tag
72+ ) {
73+ operand = op .getOperand ( tag ) and
74+ operand .getFunctionIR ( ) != op .getFunctionIR ( )
75+ }
6976}
7077
7178/**
@@ -262,8 +269,8 @@ class Instruction extends Construction::TInstruction {
262269 // Register results are always in SSA form.
263270 not hasMemoryResult ( ) or
264271 // An unmodeled result will have a use on the `UnmodeledUse` instruction.
265- not exists ( UnmodeledUseOperand useTag |
266- hasUse ( _ , useTag )
272+ not exists ( Instruction useInstr , UnmodeledUseOperand useTag |
273+ this = useInstr . getOperand ( useTag )
267274 )
268275 }
269276
@@ -296,15 +303,6 @@ class Instruction extends Construction::TInstruction {
296303 final Instruction getAPredecessor ( ) {
297304 result = getPredecessor ( _)
298305 }
299-
300- /**
301- * Holds if the result of this instruction is consumed by `useInstruction` as
302- * an operand with tag `useTag`.
303- */
304- final predicate hasUse ( Instruction useInstruction , OperandTag useTag ) {
305- useInstruction .getFunctionIR ( ) = funcIR and
306- this = useInstruction .getOperand ( useTag )
307- }
308306}
309307
310308class VariableInstruction extends Instruction {
0 commit comments