aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vectorizer.h
diff options
context:
space:
mode:
authorBill Schmidt <wschmidt@linux.ibm.com>2012-07-31 12:25:04 +0000
committerWilliam Schmidt <wschmidt@gcc.gnu.org>2012-07-31 12:25:04 +0000
commit3393a7113e80689b21be74e1ff0bc7b7b6115a38 (patch)
treeb5228437c04a0ba87c454b39c628730188352ba0 /gcc/tree-vectorizer.h
parent8c503f0dd33d2521a1a64f5687f2033569a46c43 (diff)
downloadgcc-3393a7113e80689b21be74e1ff0bc7b7b6115a38.zip
gcc-3393a7113e80689b21be74e1ff0bc7b7b6115a38.tar.gz
gcc-3393a7113e80689b21be74e1ff0bc7b7b6115a38.tar.bz2
re PR tree-optimization/53773 (Vectorizer generates non-canonical multiplies)
gcc: 2012-07-31 Bill Schmidt <wschmidt@linux.ibm.com> PR tree-optimization/53773 * tree-vectorizer.h (struct _loop_vec_info): Add operands_swapped. (LOOP_VINFO_OPERANDS_SWAPPED): New macro. * tree-vect-loop.c (new_loop_vec_info): Initialize LOOP_VINFO_OPERANDS_SWAPPED field. (destroy_loop_vec_info): Restore canonical form. (vect_is_slp_reduction): Set LOOP_VINFO_OPERANDS_SWAPPED field. (vect_is_simple_reduction_1): Likewise. gcc/testsuite: 2012-07-31 Bill Schmidt <wschmidt@linux.ibm.com> PR tree-optimization/53773 * testsuite/gcc.dg/vect/pr53773.c: New test. From-SVN: r190007
Diffstat (limited to 'gcc/tree-vectorizer.h')
-rw-r--r--gcc/tree-vectorizer.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h
index 96cc52e..7641838 100644
--- a/gcc/tree-vectorizer.h
+++ b/gcc/tree-vectorizer.h
@@ -296,6 +296,12 @@ typedef struct _loop_vec_info {
this. */
bool peeling_for_gaps;
+ /* Reductions are canonicalized so that the last operand is the reduction
+ operand. If this places a constant into RHS1, this decanonicalizes
+ GIMPLE for other phases, so we must track when this has occurred and
+ fix it up. */
+ bool operands_swapped;
+
} *loop_vec_info;
/* Access Functions. */
@@ -326,6 +332,7 @@ typedef struct _loop_vec_info {
#define LOOP_VINFO_PEELING_HTAB(L) (L)->peeling_htab
#define LOOP_VINFO_TARGET_COST_DATA(L) (L)->target_cost_data
#define LOOP_VINFO_PEELING_FOR_GAPS(L) (L)->peeling_for_gaps
+#define LOOP_VINFO_OPERANDS_SWAPPED(L) (L)->operands_swapped
#define LOOP_REQUIRES_VERSIONING_FOR_ALIGNMENT(L) \
VEC_length (gimple, (L)->may_misalign_stmts) > 0