C++: Improve join order in IR reachability

This commit is contained in:
Dave Bartolomeo
2018-12-10 10:50:32 -08:00
parent 99d33f9623
commit b2e596fcc2
3 changed files with 18 additions and 6 deletions

View File

@@ -22,7 +22,9 @@ IRBlock getAFeasiblePredecessor(IRBlock successor) {
}
predicate isBlockReachable(IRBlock block) {
getAFeasiblePredecessor*(block) = block.getFunctionIR().getEntryBlock()
exists(FunctionIR f |
getAFeasiblePredecessor*(block) = f.getEntryBlock()
)
}
predicate isInstructionReachable(Instruction instr) {
@@ -43,7 +45,9 @@ class ReachableInstruction extends Instruction {
module Graph {
predicate isEntryBlock(ReachableBlock block) {
block = block.getFunctionIR().getEntryBlock()
exists(FunctionIR f |
block = f.getEntryBlock()
)
}
predicate blockSuccessor(ReachableBlock pred, ReachableBlock succ) {

View File

@@ -22,7 +22,9 @@ IRBlock getAFeasiblePredecessor(IRBlock successor) {
}
predicate isBlockReachable(IRBlock block) {
getAFeasiblePredecessor*(block) = block.getFunctionIR().getEntryBlock()
exists(FunctionIR f |
getAFeasiblePredecessor*(block) = f.getEntryBlock()
)
}
predicate isInstructionReachable(Instruction instr) {
@@ -43,7 +45,9 @@ class ReachableInstruction extends Instruction {
module Graph {
predicate isEntryBlock(ReachableBlock block) {
block = block.getFunctionIR().getEntryBlock()
exists(FunctionIR f |
block = f.getEntryBlock()
)
}
predicate blockSuccessor(ReachableBlock pred, ReachableBlock succ) {

View File

@@ -22,7 +22,9 @@ IRBlock getAFeasiblePredecessor(IRBlock successor) {
}
predicate isBlockReachable(IRBlock block) {
getAFeasiblePredecessor*(block) = block.getFunctionIR().getEntryBlock()
exists(FunctionIR f |
getAFeasiblePredecessor*(block) = f.getEntryBlock()
)
}
predicate isInstructionReachable(Instruction instr) {
@@ -43,7 +45,9 @@ class ReachableInstruction extends Instruction {
module Graph {
predicate isEntryBlock(ReachableBlock block) {
block = block.getFunctionIR().getEntryBlock()
exists(FunctionIR f |
block = f.getEntryBlock()
)
}
predicate blockSuccessor(ReachableBlock pred, ReachableBlock succ) {