summaryrefslogtreecommitdiff
path: root/gcc/tree-vect-generic.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2012-06-18 05:26:28 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2012-06-18 05:26:28 +0000
commitf1cd63ec5edabe50519f93140a554f53b92d3e0a (patch)
tree991b2524d0f174578979bf67e18962015ea4b711 /gcc/tree-vect-generic.c
parent2f2639928aeeee7b4f0bdffc81807e900d6ddcd7 (diff)
downloadgcc-f1cd63ec5edabe50519f93140a554f53b92d3e0a.tar.gz
2012-06-18 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 188721 using svnmerge git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@188723 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vect-generic.c')
-rw-r--r--gcc/tree-vect-generic.c14
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;