diff options
author | ramana <ramana@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-06-15 13:06:51 +0000 |
---|---|---|
committer | ramana <ramana@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-06-15 13:06:51 +0000 |
commit | 53d84863bf0c1650eff422003e5fc6b10f333cec (patch) | |
tree | a5f0f8cfabc844031e7fce105d0d85dbdf167188 /gcc/tree-vect-generic.c | |
parent | eca8fccf3c39397956c1fe14be2a42d223037f3d (diff) | |
download | gcc-53d84863bf0c1650eff422003e5fc6b10f333cec.tar.gz |
2012-06-15 Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org>
* tree-vect-generic.c (lower_vec_perm): Propagate vector constants
into VEC_PERM_EXPR.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@188659 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vect-generic.c')
-rw-r--r-- | gcc/tree-vect-generic.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/gcc/tree-vect-generic.c b/gcc/tree-vect-generic.c index 06334bb8fd1..3b9f561bbfb 100644 --- a/gcc/tree-vect-generic.c +++ b/gcc/tree-vect-generic.c @@ -628,6 +628,14 @@ lower_vec_perm (gimple_stmt_iterator *gsi) location_t loc = gimple_location (gsi_stmt (*gsi)); unsigned i; + if (TREE_CODE (mask) == SSA_NAME) + { + gimple def_stmt = SSA_NAME_DEF_STMT (mask); + if (is_gimple_assign (def_stmt) + && gimple_assign_rhs_code (def_stmt) == VECTOR_CST) + mask = gimple_assign_rhs1 (def_stmt); + } + if (TREE_CODE (mask) == VECTOR_CST) { unsigned char *sel_int = XALLOCAVEC (unsigned char, elements); @@ -637,7 +645,11 @@ lower_vec_perm (gimple_stmt_iterator *gsi) & (2 * elements - 1)); if (can_vec_perm_p (TYPE_MODE (vect_type), false, sel_int)) - return; + { + gimple_assign_set_rhs3 (stmt, mask); + update_stmt (stmt); + return; + } } else if (can_vec_perm_p (TYPE_MODE (vect_type), true, NULL)) return; |