OSDN Git Service

PR tree-optimization/35085
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 7 Feb 2008 14:11:26 +0000 (14:11 +0000)
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 7 Feb 2008 14:11:26 +0000 (14:11 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@132168 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 98b577f..334fabf 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 200088d..a4118c9 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