JavaScript: Pull out auxiliary predicate to improve join order in TPhi.

This commit is contained in:
Max Schaefer
2018-10-11 09:22:18 +01:00
parent d2993b9e04
commit 59bbd025a5

View File

@@ -122,10 +122,7 @@ private cached module Internal {
}
or TPhi(ReachableJoinBlock bb, SsaSourceVariable v) {
liveAtEntry(bb, v) and
exists (ReachableBasicBlock defbb, SsaDefinition def |
def.definesAt(defbb, _, v) and
bb.inDominanceFrontierOf(defbb)
)
inDefDominanceFrontier(bb, v)
}
or TRefinement(ReachableBasicBlock bb, int i, GuardControlFlowNode guard, SsaSourceVariable v) {
bb.getNode(i) = guard and
@@ -133,6 +130,17 @@ private cached module Internal {
liveAtEntry(bb, v)
}
/**
* Holds if `bb` is in the dominance frontier of a block containing a definition of `v`.
*/
pragma[noinline]
private predicate inDefDominanceFrontier(ReachableJoinBlock bb, SsaSourceVariable v) {
exists (ReachableBasicBlock defbb, SsaDefinition def |
def.definesAt(defbb, _, v) and
bb.inDominanceFrontierOf(defbb)
)
}
/**
* Holds if `v` is a captured variable which is declared in `declContainer` and read in
* `useContainer`.