[PING] [patch] PR tree-optimizations/26969 (vectorizer)

Dorit Nuzman DORIT@il.ibm.com
Wed Aug 2 10:59:00 GMT 2006


> Victor Kaplansky wrote on 08/01/06 07:41:
>
> >         PR tree-optimization/26969
> >         * tree-vect-analyze.c (vect_analyze_loop_form): Add check of
latch
> >          witch an empty list of PHIs.
witch --> with

Also note that with this fix this PR should become a missed optimization
PR.

In fact, the phi node in question, which fails vectorization, looks
redundant:

loop:
      SMT.6_16 = phi <SMT.6_1, SMT.6_12>
      ....
      # SMT.6_13 = V_MAY_DEF <SMT.6_16>
      if (...) goto latch else goto exit
latch:
      SMT.6_1 = phi <SMT.6_13>
      goto loop

the code could be transformed into the following (replace use of SMT.6_1
with use of SMT.6_13 and delete the redundant phi):

loop:
      SMT.6_16 = phi <SMT.6_13, SMT.6_12>
      ....
      # SMT.6_13 = V_MAY_DEF <SMT.6_16>
      if (...) goto latch else goto exit
latch:
      goto loop

So I think we should just clean away these redundant latch-block phis. The
question is what's the best way to do that - do a loop_dce pass before
vectorization? is there a more appropriate phi-node cleanup pass? or just
do this cleanup from within the vectorizer? I think it's an easy special
case - we only work with loops whose latch block is empty, has one
predecessor and one successor, and the result (def) of any phi_node in a
latch block would be used only by the loop header phi nodes. right? seems
like we could always get rid of these phis under these circumstances.

thanks,
dorit

> >
> OK.



More information about the Gcc-patches mailing list