aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-slp.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2015-03-23 12:47:54 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2015-03-23 12:47:54 +0000
commit89d390e57a34432f9a8f14b752eec061fcb2b64e (patch)
tree6b21732ccd16640529efa5c8589edbb5d82d1f92 /gcc/tree-vect-slp.c
parentc61928d098559fedd9032e4292740ba020103629 (diff)
downloadgcc-89d390e57a34432f9a8f14b752eec061fcb2b64e.zip
gcc-89d390e57a34432f9a8f14b752eec061fcb2b64e.tar.gz
gcc-89d390e57a34432f9a8f14b752eec061fcb2b64e.tar.bz2
re PR tree-optimization/65494 (Loop is not vectorized because of operand canonicalization.)
2015-03-23 Richard Biener <rguenther@suse.de> PR tree-optimization/65494 * tree-vect-slp.c (vect_build_slp_tree): Do not (re-)allocate matches here. (vect_analyze_slp_instance): But do that here, always and once. * gcc.dg/vect/pr65494.c: New testcase. From-SVN: r221592
Diffstat (limited to 'gcc/tree-vect-slp.c')
-rw-r--r--gcc/tree-vect-slp.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index ce0ca91..c57a5ca 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -926,14 +926,9 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
bool *matches, unsigned *npermutes, unsigned *tree_size,
unsigned max_tree_size)
{
- unsigned nops, i, this_npermutes = 0, this_tree_size = 0;
+ unsigned nops, i, this_tree_size = 0;
gimple stmt;
- if (!matches)
- matches = XALLOCAVEC (bool, group_size);
- if (!npermutes)
- npermutes = &this_npermutes;
-
matches[0] = false;
stmt = SLP_TREE_SCALAR_STMTS (*node)[0];
@@ -1012,7 +1007,6 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
return false;
}
- bool *matches = XALLOCAVEC (bool, group_size);
if (vect_build_slp_tree (loop_vinfo, bb_vinfo, &child,
group_size, max_nunits, loads,
vectorization_factor, matches,
@@ -1637,9 +1631,11 @@ vect_analyze_slp_instance (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
loads.create (group_size);
/* Build the tree for the SLP instance. */
+ bool *matches = XALLOCAVEC (bool, group_size);
+ unsigned npermutes = 0;
if (vect_build_slp_tree (loop_vinfo, bb_vinfo, &node, group_size,
&max_nunits, &loads,
- vectorization_factor, NULL, NULL, NULL,
+ vectorization_factor, matches, &npermutes, NULL,
max_tree_size))
{
/* Calculate the unrolling factor based on the smallest type. */