Closed johnwickerson closed 2 years ago
But in my solution, constraining that A
is structurally reachable and that A
structurally dominates B
, it implies that B
is structurally reachable, too (structural dominance implies structural reachability).
Your alternatives work, too, but are not orthogonal. When you say:
require that
B
is structurally reachable. (From this, it follows thatA
is structurally reachable too.)
the conclusion derives from other rules like: BackEdgesBranchToLoopHeader
Hmm, I'm not sure... the thing is, the fact about A
structurally dominating B
is on the other side of the implication.
To be concrete: suppose I have a graph that looks like this.
EntryPoint
|
jump
|
v
B -jump-> H -continue-> A
The current ContinueTargetStructurallyDominatesBackEdge
predicate does not hold for this graph. But my reformulated predicate does hold.
There are presumably other predicates that do not hold for this graph, making my point a bit moot. But still, it means that the current definition of this predicate is a little hard to explain in isolation.
Now that the tennis game ended I can see you are right :) Our formulations disagree between them when there are structurally unreachable blocks in the graph.
I'm glad we agree :).
In which case, I think I'll write about a different predicate in the paper (maybe BackEdgeStructurallyPostDominatesContinueTarget
, which doesn't have this problem). That way, the paper-writing isn't blocked by needing to fix the ContinueTargetStructurallyDominatesBackEdge
predicate.
In due course, I think the neater of my two proposed ways to fix the ContinueTargetStructurallyDominatesBackEdge
predicate is the second one, StructurallyReachableBlock <: (backEdge.continue) in ~structurallyDominates
.
Consider the
ContinueTargetStructurallyDominatesBackEdge
axiom here. Explanation as follows:~continue.~backEdge
gives us the set of pairs(A,B)
whereA
is the continue target of some loop header and there is a back-edge fromB
to that loop header.StructurallyReachableBlock <: ...
we are saying thatA
is structurally reachable.A
must structually dominateB
.A
is structurally reachable because we only wish to impose this rule on blocks in the CFG that are structurally reachable.A
is structurally reachable. We are not requiringB
or the loop header to be structurally reachable too, and the arrows are pointing the wrong way to make the inference thatB
is structurally reachable too.A
is structurally reachable andB
is not, but we are nonetheless insisting thatA
structurally dominatesB
.Possible fix: require that
B
is structurally reachable. (From this, it follows thatA
is structurally reachable too.) That is, changeto
or