Patchwork Preserve loops from CFG build until after RTL loop opts

login
register
mail settings
Submitter Richard Guenther
Date April 26, 2013, 8:02 a.m.
Message ID <alpine.LNX.2.00.1304260951430.7969@zhemvz.fhfr.qr>
Download mbox | patch
Permalink /patch/239717/
State New
Headers show

Comments

Richard Guenther - April 26, 2013, 8:02 a.m.
On Thu, 25 Apr 2013, Jakub Jelinek wrote:

> On Thu, Apr 25, 2013 at 04:19:20PM +0200, Richard Biener wrote:
> > 
> > This is the patch that I consider final as a first step (to avoid
> > changing too much at once).  I've analyzed the few failures
> > and compared to the previous patch changed the tree-ssa-tailmerge.c
> > part to deal with merging of loop latch and loop preheader (even
> > if that's a really bad idea) to not regress gcc.dg/pr50763.c.
> > Any suggestion on how to improve that part welcome.
> > I've had to change a few testcases, mostly in parts that are not
> > really related to what they check (also reverting to a previous
> > testcase state).  One remaining failure is
> > 
> > FAIL: gcc.dg/pr53265.c  (test for bogus messages, line 147)
> > 
> > which I don't want to deal with in this patch.  I can either
> > followup or prepare the discussed fix of adding a copyprop
> > pass before cunrolli.  Another possibility is to XFAIL the above.
> 
> As that testcase was derived from real-world code (gcc itself, if I remember
> well two places actually hitting it at that point), I'd strongly prefer
> the former, rather than XFAIL, because people would be pretty much annoyed
> by the false positive warning, scratching heads where they invoke undefined
> behavior when they actually don't.  But sure, it can wait for a follow-up
> patch.
> 
> > Bootstrapped and tested on x86_64-unknown-linux-gnu for all languages
> > including Ada (including 32bit multilibs).
> > 
> > Ok for trunk?
> 
> Yes, thanks.

A bootstrap & test together with the additional copyprop pass did not
show any issues so the following is what I committed in addition
to the patch.

Richard.

        * passes.c (init_optimization_passes): Schedule a copy-propagation
        pass before complete unrolling of inner loops.

       /* After CCP we rewrite no longer addressed locals into SSA

Patch

Index: gcc/passes.c
===================================================================
--- gcc/passes.c        (revision 198332)
+++ gcc/passes.c        (working copy)
@@ -1397,6 +1397,7 @@  init_optimization_passes (void)
         They ensure memory accesses are not indirect wherever possible.  
*/
       NEXT_PASS (pass_strip_predict_hints);
       NEXT_PASS (pass_rename_ssa_copies);
+      NEXT_PASS (pass_copy_prop);
       NEXT_PASS (pass_complete_unrolli);
       NEXT_PASS (pass_ccp);