diff options
author | Richard Biener <rguenther@suse.de> | 2015-05-06 10:49:35 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2015-05-06 10:49:35 +0000 |
commit | 240a94da04372488fb03284d5479687c9f8fbe57 (patch) | |
tree | 0ad58236fb46b1acfdb616f36490b2bdb04fd1fe /gcc/tree-vect-slp.c | |
parent | edbb33c7958d9ebb202f8dbfa84901e0b6d5ef7a (diff) | |
download | gcc-240a94da04372488fb03284d5479687c9f8fbe57.zip gcc-240a94da04372488fb03284d5479687c9f8fbe57.tar.gz gcc-240a94da04372488fb03284d5479687c9f8fbe57.tar.bz2 |
tree-vect-slp.c (vect_supported_load_permutation_p): Use vect_transform_slp_perm_load to check if...
2015-05-06 Richard Biener <rguenther@suse.de>
* tree-vect-slp.c (vect_supported_load_permutation_p): Use
vect_transform_slp_perm_load to check if we support a permutation
for basic-block vectorization.
* gcc.dg/vect/bb-slp-34.c: New testcase.
From-SVN: r222846
Diffstat (limited to 'gcc/tree-vect-slp.c')
-rw-r--r-- | gcc/tree-vect-slp.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index d41aa10..fc96df3 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -1325,17 +1325,36 @@ vect_supported_load_permutation_p (slp_instance slp_instn) FORNOW: not supported in loop SLP because of realignment compications. */ if (STMT_VINFO_BB_VINFO (vinfo_for_stmt (stmt))) { - /* Check that for every node in the instance the loads - form a subchain. */ + /* Check whether the loads in an instance form a subchain and thus + no permutation is necessary. */ FOR_EACH_VEC_ELT (SLP_INSTANCE_LOADS (slp_instn), i, node) { + bool subchain_p = true; next_load = NULL; FOR_EACH_VEC_ELT (SLP_TREE_SCALAR_STMTS (node), j, load) { if (j != 0 && next_load != load) - return false; + { + subchain_p = false; + break; + } next_load = GROUP_NEXT_ELEMENT (vinfo_for_stmt (load)); } + if (subchain_p) + SLP_TREE_LOAD_PERMUTATION (node).release (); + else + { + /* Verify the permutation can be generated. */ + vec<tree> tem; + if (!vect_transform_slp_perm_load (node, tem, NULL, + 1, slp_instn, true)) + { + dump_printf_loc (MSG_MISSED_OPTIMIZATION, + vect_location, + "unsupported load permutation\n"); + return false; + } + } } /* Check that the alignment of the first load in every subchain, i.e., @@ -1364,9 +1383,6 @@ vect_supported_load_permutation_p (slp_instance slp_instn) } } - /* We are done, no actual permutations need to be generated. */ - FOR_EACH_VEC_ELT (SLP_INSTANCE_LOADS (slp_instn), i, node) - SLP_TREE_LOAD_PERMUTATION (node).release (); return true; } |