Merge pull request #4319 from hvitved/python-java-block-precedes-var

Java/Python: Reduce size of `blockPrecedesVar`
This commit is contained in:
Anders Schack-Mulligen
2020-09-24 16:07:49 +02:00
committed by GitHub
4 changed files with 12 additions and 6 deletions

View File

@@ -706,9 +706,9 @@ module Ssa {
/**
* Holds if `def` is accessed in basic block `bb1` (either a read or a write),
* `bb2` is a transitive successor of `bb1`, and `def` is *maybe* read in `bb2`
* or one of its transitive successors, but not in any block on the path between
* `bb1` and `bb2`.
* `bb2` is a transitive successor of `bb1`, `def` is live at the end of `bb1`,
* and the underlying variable for `def` is neither read nor written in any block
* on the path between `bb1` and `bb2`.
*/
private predicate varBlockReaches(TrackedDefinition def, BasicBlock bb1, BasicBlock bb2) {
varOccursInBlock(def, bb1, _) and

View File

@@ -770,7 +770,9 @@ private module SsaImpl {
/** Holds if `v` occurs in `b` or one of `b`'s transitive successors. */
private predicate blockPrecedesVar(TrackedVar v, BasicBlock b) {
varOccursInBlock(v, b.getABBSuccessor*())
varOccursInBlock(v, b)
or
ssaDefReachesEndOfBlock(v, _, b)
}
/**

View File

@@ -321,7 +321,9 @@ private module SsaImpl {
/** Holds if `v` occurs in `b` or one of `b`'s transitive successors. */
private predicate blockPrecedesVar(BaseSsaSourceVariable v, BasicBlock b) {
varOccursInBlock(v, b.getABBSuccessor*())
varOccursInBlock(v, b)
or
ssaDefReachesEndOfBlock(v, _, b)
}
/**

View File

@@ -382,7 +382,9 @@ private module SsaComputeImpl {
/** Holds if `v` occurs in `b` or one of `b`'s transitive successors. */
private predicate blockPrecedesVar(SsaSourceVariable v, BasicBlock b) {
varOccursInBlock(v, b.getASuccessor*())
varOccursInBlock(v, b)
or
SsaDefinitionsImpl::reachesEndOfBlock(v, _, _, b)
}
/**