re PR tree-optimization/35085 (gcc.dg/vect/vect-iv-9.c fails)
authorUros Bizjak <ubizjak@gmail.com>
Thu, 7 Feb 2008 14:11:26 +0000 (15:11 +0100)
committerUros Bizjak <uros@gcc.gnu.org>
Thu, 7 Feb 2008 14:11:26 +0000 (15:11 +0100)
PR tree-optimization/35085
* tree-ssa-reassoc.c (rewrite_expr_tree): Enable destructive update
for operand entry oe2 in addition to operand entry oe3 in order to
expose more opportunities for vectorizer sum reduction.

From-SVN: r132168

gcc/ChangeLog
gcc/tree-ssa-reassoc.c

index 98b577fa4b3a812d62a9051542a62986376eb6d8..334fabf07c16b49ccc415edbf11ebfdda75f8f42 100644 (file)
@@ -1,3 +1,10 @@
+2008-02-07  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR tree-optimization/35085
+       * tree-ssa-reassoc.c (rewrite_expr_tree): Enable destructive update
+       for operand entry oe2 in addition to operand entry oe3 in order to
+       expose more opportunities for vectorizer sum reduction.
+
 2008-02-06  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        PR other/35107
index 200088d7dd43871f2b10929e5e6ea49f40204fed..a4118c923392ba9ad44cf19515c8f29b85f1fb85 100644 (file)
@@ -857,6 +857,18 @@ rewrite_expr_tree (tree stmt, unsigned int opindex,
          oe1->op = temp.op;
          oe1->rank= temp.rank;
        }
+      else if ((oe1->rank == oe3->rank
+               && oe2->rank != oe3->rank)
+              || (is_phi_for_stmt (stmt, oe2->op)
+                  && !is_phi_for_stmt (stmt, oe1->op)
+                  && !is_phi_for_stmt (stmt, oe3->op)))
+       {
+         struct operand_entry temp = *oe2;
+         oe2->op = oe1->op;
+         oe2->rank = oe1->rank;
+         oe1->op = temp.op;
+         oe1->rank= temp.rank;
+       }
     }
 
   /* The final recursion case for this function is that you have