-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12/02/11 11:10, William J. Schmidt wrote:
> 
>> 
>> I see a mention of creating equivalences for redundant PHIs?  Are
>> we just trying to determine that two PHIs are going to result in
>> the same value?
> 
> Jeff, see comment #37 in 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39976.  The issue is
> that we have two PHIs in the same block as follows:
> 
> # prephitmp.35_322 = PHI <prephitmp.35_59(6), prephitmp.35_113(7)> 
> # prephitmp.35_225 = PHI <prephitmp.35_59(6), prephitmp.35_113(7)>
OK.  Make sure you has the phi argument & its edge...  Simlarly the
equality comparison needs to check args & edges.  Or s/edge/edge->src/
if that's easier.

> 
> The coalescing algorithm in tree-outof-ssa doesn't handle this well
> and ends up splitting the back arc of a simple loop as a result.
> I'm creating an equivalence between prephitmp.35_322 and
> prephitmp.35_225 in this case so that one PHI goes dead and is
> removed.
Right.  I don't think I bothered with this because I didn't see it
happening and the comparison of the PHIs with each other gets
potentially expensive.


 As pointed out in
> the comments, this needs to be restricted to occur only in the
> same block since the PHIs aren't necessarily equivalent otherwise.
I must be missing something -- why is the equivalence only valid in
the same block?

Conceptually this situation isn't any different replacing the second
PHI with a copy
blah_225 = blah_322

And the equivalence is valid for the entire dominator subtree.

If you really need to create a temporary equiv, pushing the marker,
create the equiv and pop the marker when equiv dies is simple and easy.

Jeff
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJO2RjmAAoJEBRtltQi2kC7I7YH/RTVZF6jzBpyg+68kMTZuHDH
hETg03jnqhSXhWOzBoALZwtR9iCJ/UehCCcnjQ3eV7o1AqsImLMnap+VrS6lYfI3
hYQXtdb2F770H70yY/fgEX/VDAdGlyduXfMqHl4mLw7Apz3mpvyBucqHqECHJ+xj
AtZf3duGXp3Fpvhm3PZ7wQa+Pl0qnJU3VxqU6xkGWn9A8et8U1IdYs/wnHPR/HPY
KP7oY3JWxwR6kpzNkFJM1OZ+Nn9XWGgScAp1uBXJhK2RLgIuxaLiM5wl6VAJR1Fs
EuMBnQbHELA1ugtqC26UsDCTkjDpLGgs02ID7ArySsVgmIYvXCVzEi0cdJA42V4=
=NKrB
-----END PGP SIGNATURE-----

Reply via email to