aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2008-02-07 15:11:26 +0100
committerUros Bizjak <uros@gcc.gnu.org>2008-02-07 15:11:26 +0100
commitc4ae80d945388a7350ec8cf799f60b30036f7ba9 (patch)
treecaa1218e23262b710b363a0ef1598e5755b4ea94 /gcc
parent0d566d211a223de3a4745d511d4479b5db97b9be (diff)
downloadgcc-c4ae80d945388a7350ec8cf799f60b30036f7ba9.zip
gcc-c4ae80d945388a7350ec8cf799f60b30036f7ba9.tar.gz
gcc-c4ae80d945388a7350ec8cf799f60b30036f7ba9.tar.bz2
re PR tree-optimization/35085 (gcc.dg/vect/vect-iv-9.c fails)
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/tree-ssa-reassoc.c12
2 files changed, 19 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 98b577f..334fabf 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index 200088d..a4118c9 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -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