Skip to content

Commit 5723d27

Browse files
committed
SSA: Make inReadDominanceFrontier a bit smaller without affecting phi-read creation.
1 parent c5e2884 commit 5723d27

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

shared/ssa/codeql/ssa/Ssa.qll

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,6 @@ module Make<LocationSig Location, InputSig<Location> Input> {
182182
not result + 1 = refRank(bb, _, v, _)
183183
}
184184

185-
predicate lastRefIsRead(BasicBlock bb, SourceVariable v) {
186-
maxRefRank(bb, v) = refRank(bb, _, v, Read())
187-
}
188-
189185
/**
190186
* Gets the (1-based) rank of the first reference to `v` inside basic block `bb`
191187
* that is either a read or a certain write.
@@ -295,7 +291,8 @@ module Make<LocationSig Location, InputSig<Location> Input> {
295291
pragma[nomagic]
296292
private predicate inReadDominanceFrontier(BasicBlock bb, SourceVariable v) {
297293
exists(BasicBlock readbb | inDominanceFrontier(readbb, bb) |
298-
lastRefIsRead(readbb, v)
294+
variableRead(readbb, _, v, _) and
295+
not variableWrite(readbb, _, v, _)
299296
or
300297
exists(TPhiReadNode(v, readbb)) and
301298
not ref(readbb, _, v, _)

0 commit comments

Comments
 (0)