[Soot-list] MHGPostDominatorFinder issues
Patrick Meredith
pmeredit at gmail.com
Sat Apr 13 20:24:31 EDT 2013
MHGPostDominatorFinder does not seem to work within the body of a
loop. I would expect given instructions X and Y in the same basic
block within a loop that X post dominates Y if X follows Y, but that
is not the result I am getting. Within a loop the
MHGPostDominatorFinder claims that X post dominates Y iff X == Y.
Here is my example loop:
label1:
$i1 = <emp.Simple: int y>
$i2 = $i1 + 1
<emp.Simple: int y> = $i2
$i3 = <emp.Simple: int x>
$i4 = $i3 + 1
<emp.Simple: int x> = $i4
i0 = i0 + 1
if i0 < 20 goto label 1
And the only instruction that post dominates:
$i1 = <emp.Simple: int y>
is
$i1 = <emp.Simple: int y> itself. It returns false for every other instruction.
I am initializing the Post Dominantor Finder with:
new MHGPostDominatorsFinder(new CompleteUnitGraph(body));
Here is the output of checking every Stmt in the Loop pairwise:
%%%%% if i0 < 20 goto $i1 = <emp.Simple: int y>
Post Dominated by
if i0 < 20 goto $i1 = <emp.Simple: int y>
%%%%% $i1 = <emp.Simple: int y>
Post Dominated by
$i1 = <emp.Simple: int y>
%%%%% $i2 = $i1 + 1
Post Dominated by
$i2 = $i1 + 1
%%%%% <emp.Simple: int y> = $i2
Post Dominated by
<emp.Simple: int y> = $i2
%%%%% $i3 = <emp.Simple: int x>
Post Dominated by
$i3 = <emp.Simple: int x>
%%%%% $i4 = $i3 + 1
Post Dominated by
$i4 = $i3 + 1
%%%%% <emp.Simple: int x> = $i4
Post Dominated by
<emp.Simple: int x> = $i4
%%%%% i0 = i0 + 1
Post Dominated by
i0 = i0 + 1
--
-Patrick
More information about the Soot-list
mailing list