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 10:52 -0700, Jeff Law wrote:
> On 12/02/11 10:40, Michael Matz wrote:
> > Hi,
> > 
> > On Fri, 2 Dec 2011, William J. Schmidt wrote:
> > 
> >> It seems like a fair amount of rip-up to avoid keeping the PHI
> >> state around between blocks, so I just check to ensure the PHI
> >> definitions occur in the same block before recording their
> >> equivalence.
> > 
> > Then you should at least mix the BB number into the hash value (and
> >  possibly also check it already in hashable_expr_equal_p) in order
> > to reduce number of collissions.
> > 
> > But I wonder why it's not enough to just do a push/pop sequence on
> >  avail_exprs_stack around your new PHI processing in
> > dom_opt_enter_block, ala
> > 
> > +  VEC_safe_push (expr_hash_elt_t, heap, avail_exprs_stack, NULL); 
> > /* Create equivalences from redundant PHIs.  */ for (gsi =
> > gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi)) 
> > eliminate_redundant_computations (&gsi); +
> > remove_local_expressions_from_table ();
> > 
> > on top of your current version.  That ought to remove the added PHI
> >  expressions (and only them) from the hash table but retain the
> > information of equality in the const_or_copies_stack.  Checking the
> > BB wouldn't be required then.
> Sorry, I haven't been following this thread and there isn't much
> discussion about what problem we're trying to solve using DOM within
> the PR.
> 
> 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)>

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

Michael, you're quite right, I think using the extra marker and stack
pop should work quite well and would be more elegant and efficient.
I'll try it out.  I was initially thinking the PHI copies and existing
copies would be intermingled, but that's not the case.

Thanks,
Bill

> 
> jeff


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