Merge pull request #856 from jbj/ir-getInstructionOperandDefinition

C++: Speed up `getInstructionOperandDefinition`
This commit is contained in:
Dave Bartolomeo
2019-01-31 10:11:59 -08:00
committed by GitHub
5 changed files with 25 additions and 8 deletions

View File

@@ -56,6 +56,11 @@ class FunctionIR extends TFunctionIR {
result.getFunctionIR() = this
}
pragma[noinline]
final UnmodeledUseInstruction getUnmodeledUseInstruction() {
result.getFunctionIR() = this
}
/**
* Gets the single return instruction for this function.
*/

View File

@@ -192,10 +192,11 @@ cached private module Cached {
instruction.getTag() = ChiTag(getOldInstruction(result)) and
tag instanceof ChiPartialOperandTag
or
instruction instanceof UnmodeledUseInstruction and
tag instanceof UnmodeledUseOperandTag and
result instanceof UnmodeledDefinitionInstruction and
instruction.getFunction() = result.getFunction()
exists(FunctionIR f |
tag instanceof UnmodeledUseOperandTag and
result = f.getUnmodeledDefinitionInstruction() and
instruction = f.getUnmodeledUseInstruction()
)
or
tag instanceof ChiTotalOperandTag and
result = getChiInstructionTotalOperand(instruction)

View File

@@ -56,6 +56,11 @@ class FunctionIR extends TFunctionIR {
result.getFunctionIR() = this
}
pragma[noinline]
final UnmodeledUseInstruction getUnmodeledUseInstruction() {
result.getFunctionIR() = this
}
/**
* Gets the single return instruction for this function.
*/

View File

@@ -56,6 +56,11 @@ class FunctionIR extends TFunctionIR {
result.getFunctionIR() = this
}
pragma[noinline]
final UnmodeledUseInstruction getUnmodeledUseInstruction() {
result.getFunctionIR() = this
}
/**
* Gets the single return instruction for this function.
*/

View File

@@ -192,10 +192,11 @@ cached private module Cached {
instruction.getTag() = ChiTag(getOldInstruction(result)) and
tag instanceof ChiPartialOperandTag
or
instruction instanceof UnmodeledUseInstruction and
tag instanceof UnmodeledUseOperandTag and
result instanceof UnmodeledDefinitionInstruction and
instruction.getFunction() = result.getFunction()
exists(FunctionIR f |
tag instanceof UnmodeledUseOperandTag and
result = f.getUnmodeledDefinitionInstruction() and
instruction = f.getUnmodeledUseInstruction()
)
or
tag instanceof ChiTotalOperandTag and
result = getChiInstructionTotalOperand(instruction)