Merge pull request #576 from jbj/bbEntryReachesLocally-perf

C++: Fix performance of bbEntryReachesLocally (1.19)
This commit is contained in:
Geoffrey White
2018-11-29 17:12:47 +00:00
committed by GitHub

View File

@@ -96,10 +96,18 @@ abstract class LocalScopeVariableReachability extends string {
private predicate bbEntryReachesLocally(BasicBlock bb, SemanticStackVariable v, ControlFlowNode node) {
exists(int n |
node = bb.getNode(n) and isSink(node, v) |
not exists(int m | m < n | isBarrier(bb.getNode(m), v))
node = bb.getNode(n) and
isSink(node, v)
|
not exists(this.firstBarrierIndexIn(bb, v))
or
n <= this.firstBarrierIndexIn(bb, v)
)
}
private int firstBarrierIndexIn(BasicBlock bb, SemanticStackVariable v) {
result = min(int m | isBarrier(bb.getNode(m), v))
}
}
/**