summaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-11-21 17:21:30 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-11-21 17:21:30 +0000
commit25dd612e84678972313516b9b935fa3959a2cd60 (patch)
tree24e4c33ad0ca5ee52147f1c54c49fc8e17575f21 /gcc/tree-vect-loop.c
parent054f015a946adc4e35050757613873fd8ed92178 (diff)
downloadgcc-25dd612e84678972313516b9b935fa3959a2cd60.tar.gz
2009-11-21 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 154407 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@154408 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r--gcc/tree-vect-loop.c46
1 files changed, 45 insertions, 1 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index c23577034b1..55b9fb2bf99 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -4112,6 +4112,44 @@ vectorizable_live_operation (gimple stmt,
return true;
}
+/* Kill any debug uses outside LOOP of SSA names defined in STMT. */
+
+static void
+vect_loop_kill_debug_uses (struct loop *loop, gimple stmt)
+{
+ ssa_op_iter op_iter;
+ imm_use_iterator imm_iter;
+ def_operand_p def_p;
+ gimple ustmt;
+
+ FOR_EACH_PHI_OR_STMT_DEF (def_p, stmt, op_iter, SSA_OP_DEF)
+ {
+ FOR_EACH_IMM_USE_STMT (ustmt, imm_iter, DEF_FROM_PTR (def_p))
+ {
+ basic_block bb;
+
+ if (!is_gimple_debug (ustmt))
+ continue;
+
+ bb = gimple_bb (ustmt);
+
+ if (!flow_bb_inside_loop_p (loop, bb))
+ {
+ if (gimple_debug_bind_p (ustmt))
+ {
+ if (vect_print_dump_info (REPORT_DETAILS))
+ fprintf (vect_dump, "killing debug use");
+
+ gimple_debug_bind_reset_value (ustmt);
+ update_stmt (ustmt);
+ }
+ else
+ gcc_unreachable ();
+ }
+ }
+ }
+}
+
/* Function vect_transform_loop.
The analysis phase has determined that the loop is vectorizable.
@@ -4202,7 +4240,11 @@ vect_transform_loop (loop_vec_info loop_vinfo)
if (!STMT_VINFO_RELEVANT_P (stmt_info)
&& !STMT_VINFO_LIVE_P (stmt_info))
- continue;
+ {
+ if (MAY_HAVE_DEBUG_STMTS)
+ vect_loop_kill_debug_uses (loop, phi);
+ continue;
+ }
if ((TYPE_VECTOR_SUBPARTS (STMT_VINFO_VECTYPE (stmt_info))
!= (unsigned HOST_WIDE_INT) vectorization_factor)
@@ -4242,6 +4284,8 @@ vect_transform_loop (loop_vec_info loop_vinfo)
if (!STMT_VINFO_RELEVANT_P (stmt_info)
&& !STMT_VINFO_LIVE_P (stmt_info))
{
+ if (MAY_HAVE_DEBUG_STMTS)
+ vect_loop_kill_debug_uses (loop, stmt);
gsi_next (&si);
continue;
}