From 0682ed3eb20eb8d5f248710c1e23a819c8b2d2a5 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Wed, 2 Jan 2013 14:10:36 +0000 Subject: [PATCH] tree-vect-stmts.c (vectorizable_load): When vectorizing an invariant load do not generate a vector load from the... 2013-01-02 Richard Biener * tree-vect-stmts.c (vectorizable_load): When vectorizing an invariant load do not generate a vector load from the scalar location. From-SVN: r194806 --- gcc/ChangeLog | 6 ++++++ gcc/tree-vect-stmts.c | 24 +++++++++++++----------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 210fb54f26e..10592b89885 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-01-02 Richard Biener + + * 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 PR bootstrap/55784 diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 1e8d7ee4401..da9f12b5c8c 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -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);