summaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop.c
diff options
context:
space:
mode:
authoralalaw01 <alalaw01@138bc75d-0d04-0410-961f-82ee72b054a4>2014-11-14 17:20:40 +0000
committeralalaw01 <alalaw01@138bc75d-0d04-0410-961f-82ee72b054a4>2014-11-14 17:20:40 +0000
commit1e937a2e7a008f40c13678f3326bb617fa39b194 (patch)
tree7db8c7ede2c9504c71888e1c759e6c694ae291c0 /gcc/tree-vect-loop.c
parentf3d688fbc4887b4e99d27a35d077d731f51303e7 (diff)
downloadgcc-1e937a2e7a008f40c13678f3326bb617fa39b194.tar.gz
[Vectorizer] Tidy up vect_create_epilog / use_scalar_result
* tree-vect-loop.c (vect_create_epilog_for_reduction): Move code for 'if (extract_scalar_result)' to the only place that it is true. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217580 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r--gcc/tree-vect-loop.c40
1 files changed, 16 insertions, 24 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 5e66dcf5354..70405d86f34 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -3914,7 +3914,6 @@ vect_create_epilog_for_reduction (vec<tree> vect_defs, gimple stmt,
tree orig_name, scalar_result;
imm_use_iterator imm_iter, phi_imm_iter;
use_operand_p use_p, phi_use_p;
- bool extract_scalar_result = false;
gimple use_stmt, orig_stmt, reduction_phi = NULL;
bool nested_in_vect_loop = false;
auto_vec<gimple> new_phis;
@@ -4281,6 +4280,8 @@ vect_create_epilog_for_reduction (vec<tree> vect_defs, gimple stmt,
Create: va = vop <va, va'>
} */
+ tree rhs;
+
if (dump_enabled_p ())
dump_printf_loc (MSG_NOTE, vect_location,
"Reduce using vector shifts\n");
@@ -4307,7 +4308,20 @@ vect_create_epilog_for_reduction (vec<tree> vect_defs, gimple stmt,
gsi_insert_before (&exit_gsi, epilog_stmt, GSI_SAME_STMT);
}
- extract_scalar_result = true;
+ /* 2.4 Extract the final scalar result. Create:
+ s_out3 = extract_field <v_out2, bitpos> */
+
+ if (dump_enabled_p ())
+ dump_printf_loc (MSG_NOTE, vect_location,
+ "extract scalar result\n");
+
+ rhs = build3 (BIT_FIELD_REF, scalar_type, new_temp,
+ bitsize, bitsize_zero_node);
+ epilog_stmt = gimple_build_assign (new_scalar_dest, rhs);
+ new_temp = make_ssa_name (new_scalar_dest, epilog_stmt);
+ gimple_assign_set_lhs (epilog_stmt, new_temp);
+ gsi_insert_before (&exit_gsi, epilog_stmt, GSI_SAME_STMT);
+ scalar_results.safe_push (new_temp);
}
else
{
@@ -4401,30 +4415,8 @@ vect_create_epilog_for_reduction (vec<tree> vect_defs, gimple stmt,
else
/* Not SLP - we have one scalar to keep in SCALAR_RESULTS. */
scalar_results.safe_push (new_temp);
-
- extract_scalar_result = false;
}
}
-
- /* 2.4 Extract the final scalar result. Create:
- s_out3 = extract_field <v_out2, bitpos> */
-
- if (extract_scalar_result)
- {
- tree rhs;
-
- if (dump_enabled_p ())
- dump_printf_loc (MSG_NOTE, vect_location,
- "extract scalar result\n");
-
- rhs = build3 (BIT_FIELD_REF, scalar_type,
- new_temp, bitsize, bitsize_zero_node);
- epilog_stmt = gimple_build_assign (new_scalar_dest, rhs);
- new_temp = make_ssa_name (new_scalar_dest, epilog_stmt);
- gimple_assign_set_lhs (epilog_stmt, new_temp);
- gsi_insert_before (&exit_gsi, epilog_stmt, GSI_SAME_STMT);
- scalar_results.safe_push (new_temp);
- }
vect_finalize_reduction: