diff options
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/tree-vect-generic.c | 14 |
2 files changed, 18 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d4174c2397f..5ce784a4c0e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2012-06-15 Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org> + + * tree-vect-generic.c (lower_vec_perm): Propagate vector constants + into VEC_PERM_EXPR. + 2012-06-15 Jakub Jelinek <jakub@redhat.com> * tree-vect-patterns.c (vect_pattern_recog): Don't unnecessarily 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; |