This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix PR middle-end/39976, 200.sixtrack degradation



On Fri, 2011-12-02 at 11:28 -0700, Jeff Law wrote:
> 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.
> 

OK, this is what I was missing.  Including edge->src->index in the hash
and equality test to get the actual origin of the arguments should allow
the PHIs to match when they're truly equivalent.  Thanks!

> > 
> > 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.

Yes, once the origin of the PHI arguments is correctly taken into
account, then equivalent PHIs can be eliminated within the 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

Much obliged,
Bill


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]