Skip to content

Commit 6b9aaf6

Browse files
committed
C++: Speed up getAFeasiblePredecessorBlock
This predicate was unbearably slow on a ChakraCore snapshot (and probably everywhere else): ReachableBlock::getAFeasiblePredecessorBlock#2#ff#antijoin_rhs .. 1m6s ReachableBlock::getAFeasiblePredecessorBlock#ff#antijoin_rhs .... 31.8s With this change, the predicate is so fast that it doesn't even show up in the clause timing report. It's possible that we only tested this for performance in 1.18, and then it has regressed in 1.19. Otherwise I can't explain how we've missed this. I'm using QL for Eclipse 1.20.0.201901070127.
1 parent f85f05d commit 6b9aaf6

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

cpp/ql/src/semmle/code/cpp/ir/implementation/raw/internal/reachability/ReachableBlock.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ predicate isInfeasibleInstructionSuccessor(Instruction instr, EdgeKind kind) {
1313
)
1414
}
1515

16+
pragma[noinline]
1617
predicate isInfeasibleEdge(IRBlockBase block, EdgeKind kind) {
1718
isInfeasibleInstructionSuccessor(block.getLastInstruction(), kind)
1819
}

cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/reachability/ReachableBlock.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ predicate isInfeasibleInstructionSuccessor(Instruction instr, EdgeKind kind) {
1313
)
1414
}
1515

16+
pragma[noinline]
1617
predicate isInfeasibleEdge(IRBlockBase block, EdgeKind kind) {
1718
isInfeasibleInstructionSuccessor(block.getLastInstruction(), kind)
1819
}

0 commit comments

Comments
 (0)