Merge pull request #8542 from MathiasVP/public-iterated-dominance-frontier

C++: Use `iterated (post)dominance frontier` algorithm in `IRBlock`
This commit is contained in:
Mathias Vorreiter Pedersen
2022-03-25 11:51:15 +00:00
committed by GitHub
5 changed files with 70 additions and 20 deletions

View File

@@ -161,8 +161,13 @@ class IRBlock extends IRBlockBase {
*/ */
pragma[noinline] pragma[noinline]
final IRBlock dominanceFrontier() { final IRBlock dominanceFrontier() {
this.dominates(result.getAPredecessor()) and this.getASuccessor() = result and
not this.strictlyDominates(result) not this.immediatelyDominates(result)
or
exists(IRBlock prev | result = prev.dominanceFrontier() |
this.immediatelyDominates(prev) and
not this.immediatelyDominates(result)
)
} }
/** /**
@@ -201,8 +206,13 @@ class IRBlock extends IRBlockBase {
*/ */
pragma[noinline] pragma[noinline]
final IRBlock postDominanceFrontier() { final IRBlock postDominanceFrontier() {
this.postDominates(result.getASuccessor()) and this.getAPredecessor() = result and
not this.strictlyPostDominates(result) not this.immediatelyPostDominates(result)
or
exists(IRBlock prev | result = prev.postDominanceFrontier() |
this.immediatelyPostDominates(prev) and
not this.immediatelyPostDominates(result)
)
} }
/** /**

View File

@@ -161,8 +161,13 @@ class IRBlock extends IRBlockBase {
*/ */
pragma[noinline] pragma[noinline]
final IRBlock dominanceFrontier() { final IRBlock dominanceFrontier() {
this.dominates(result.getAPredecessor()) and this.getASuccessor() = result and
not this.strictlyDominates(result) not this.immediatelyDominates(result)
or
exists(IRBlock prev | result = prev.dominanceFrontier() |
this.immediatelyDominates(prev) and
not this.immediatelyDominates(result)
)
} }
/** /**
@@ -201,8 +206,13 @@ class IRBlock extends IRBlockBase {
*/ */
pragma[noinline] pragma[noinline]
final IRBlock postDominanceFrontier() { final IRBlock postDominanceFrontier() {
this.postDominates(result.getASuccessor()) and this.getAPredecessor() = result and
not this.strictlyPostDominates(result) not this.immediatelyPostDominates(result)
or
exists(IRBlock prev | result = prev.postDominanceFrontier() |
this.immediatelyPostDominates(prev) and
not this.immediatelyPostDominates(result)
)
} }
/** /**

View File

@@ -161,8 +161,13 @@ class IRBlock extends IRBlockBase {
*/ */
pragma[noinline] pragma[noinline]
final IRBlock dominanceFrontier() { final IRBlock dominanceFrontier() {
this.dominates(result.getAPredecessor()) and this.getASuccessor() = result and
not this.strictlyDominates(result) not this.immediatelyDominates(result)
or
exists(IRBlock prev | result = prev.dominanceFrontier() |
this.immediatelyDominates(prev) and
not this.immediatelyDominates(result)
)
} }
/** /**
@@ -201,8 +206,13 @@ class IRBlock extends IRBlockBase {
*/ */
pragma[noinline] pragma[noinline]
final IRBlock postDominanceFrontier() { final IRBlock postDominanceFrontier() {
this.postDominates(result.getASuccessor()) and this.getAPredecessor() = result and
not this.strictlyPostDominates(result) not this.immediatelyPostDominates(result)
or
exists(IRBlock prev | result = prev.postDominanceFrontier() |
this.immediatelyPostDominates(prev) and
not this.immediatelyPostDominates(result)
)
} }
/** /**

View File

@@ -161,8 +161,13 @@ class IRBlock extends IRBlockBase {
*/ */
pragma[noinline] pragma[noinline]
final IRBlock dominanceFrontier() { final IRBlock dominanceFrontier() {
this.dominates(result.getAPredecessor()) and this.getASuccessor() = result and
not this.strictlyDominates(result) not this.immediatelyDominates(result)
or
exists(IRBlock prev | result = prev.dominanceFrontier() |
this.immediatelyDominates(prev) and
not this.immediatelyDominates(result)
)
} }
/** /**
@@ -201,8 +206,13 @@ class IRBlock extends IRBlockBase {
*/ */
pragma[noinline] pragma[noinline]
final IRBlock postDominanceFrontier() { final IRBlock postDominanceFrontier() {
this.postDominates(result.getASuccessor()) and this.getAPredecessor() = result and
not this.strictlyPostDominates(result) not this.immediatelyPostDominates(result)
or
exists(IRBlock prev | result = prev.postDominanceFrontier() |
this.immediatelyPostDominates(prev) and
not this.immediatelyPostDominates(result)
)
} }
/** /**

View File

@@ -161,8 +161,13 @@ class IRBlock extends IRBlockBase {
*/ */
pragma[noinline] pragma[noinline]
final IRBlock dominanceFrontier() { final IRBlock dominanceFrontier() {
this.dominates(result.getAPredecessor()) and this.getASuccessor() = result and
not this.strictlyDominates(result) not this.immediatelyDominates(result)
or
exists(IRBlock prev | result = prev.dominanceFrontier() |
this.immediatelyDominates(prev) and
not this.immediatelyDominates(result)
)
} }
/** /**
@@ -201,8 +206,13 @@ class IRBlock extends IRBlockBase {
*/ */
pragma[noinline] pragma[noinline]
final IRBlock postDominanceFrontier() { final IRBlock postDominanceFrontier() {
this.postDominates(result.getASuccessor()) and this.getAPredecessor() = result and
not this.strictlyPostDominates(result) not this.immediatelyPostDominates(result)
or
exists(IRBlock prev | result = prev.postDominanceFrontier() |
this.immediatelyPostDominates(prev) and
not this.immediatelyPostDominates(result)
)
} }
/** /**