tree-vect-stmts.c (vectorizable_load): When vectorizing an invariant load do not generate a vector load from the...

2013-01-02  Richard Biener  <rguenther@suse.de>

	* tree-vect-stmts.c (vectorizable_load): When vectorizing an
	invariant load do not generate a vector load from the scalar
	location.

From-SVN: r194806
This commit is contained in:
Richard Biener 2013-01-02 14:10:36 +00:00 committed by Richard Biener
parent 0f9f12f6f8
commit 0682ed3eb2
2 changed files with 19 additions and 11 deletions

View File

@ -1,3 +1,9 @@
2013-01-02 Richard Biener <rguenther@suse.de>
* tree-vect-stmts.c (vectorizable_load): When vectorizing an
invariant load do not generate a vector load from the scalar
location.
2013-01-02 Richard Biener <rguenther@suse.de>
PR bootstrap/55784

View File

@ -4988,6 +4988,19 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
/* Record the mapping between SSA_NAMEs and statements. */
vect_record_grouped_load_vectors (stmt, dr_chain);
}
/* Handle invariant-load. */
else if (inv_p && !bb_vinfo)
{
gimple_stmt_iterator gsi2 = *gsi;
gcc_assert (!grouped_load && !slp_perm);
gsi_next (&gsi2);
new_temp = vect_init_vector (stmt, scalar_dest,
vectype, &gsi2);
new_stmt = SSA_NAME_DEF_STMT (new_temp);
/* Store vector loads in the corresponding SLP_NODE. */
if (slp)
SLP_TREE_VEC_STMTS (slp_node).quick_push (new_stmt);
}
else
{
for (i = 0; i < vec_num; i++)
@ -5135,17 +5148,6 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
}
}
/* 4. Handle invariant-load. */
if (inv_p && !bb_vinfo)
{
gimple_stmt_iterator gsi2 = *gsi;
gcc_assert (!grouped_load);
gsi_next (&gsi2);
new_temp = vect_init_vector (stmt, scalar_dest,
vectype, &gsi2);
new_stmt = SSA_NAME_DEF_STMT (new_temp);
}
if (negative)
{
tree perm_mask = perm_mask_for_reverse (vectype);