tree-flow-inline.h (bsi_after_labels): Rewrite, return what its name says.

2006-02-02  Paolo Bonzini  <bonzini@gnu.org>

	* tree-flow-inline.h (bsi_after_labels): Rewrite, return
	what its name says.
	* lambda-code.c (perfect_nestify): Use bsi_insert_before on
	bsi_after_labels iterator.
	* tree-if-conv.c (find_phi_replacement_condition,
	replace_phi_with_cond_modify_expr): Likewise.
	* tree-scalar-evolution.c (scev_const_prop): Likewise.
	* tree-ssa-loop-ivopts.c (compute_phi_arg_on_exit): Likewise.

From-SVN: r110514
This commit is contained in:
Paolo Bonzini 2006-02-02 13:05:36 +00:00 committed by Paolo Bonzini
parent 8843c120f1
commit 35771d345f
6 changed files with 29 additions and 39 deletions

View File

@ -1,3 +1,14 @@
2006-02-02 Paolo Bonzini <bonzini@gnu.org>
* tree-flow-inline.h (bsi_after_labels): Rewrite, return
what its name says.
* lambda-code.c (perfect_nestify): Use bsi_insert_before on
bsi_after_labels iterator.
* tree-if-conv.c (find_phi_replacement_condition,
replace_phi_with_cond_modify_expr): Likewise.
* tree-scalar-evolution.c (scev_const_prop): Likewise.
* tree-ssa-loop-ivopts.c (compute_phi_arg_on_exit): Likewise.
2006-02-02 Diego Novillo <dnovillo@redhat.com>
* tree-inline.c (copy_tree_r): Also copy OMP_CLAUSE nodes.

View File

@ -2556,7 +2556,7 @@ perfect_nestify (struct loops *loops,
newname = make_ssa_name (newname, newstmt);
TREE_OPERAND (newstmt, 0) = newname;
SET_USE (use_p, TREE_OPERAND (newstmt, 0));
bsi_insert_after (&tobsi, newstmt, BSI_SAME_STMT);
bsi_insert_before (&tobsi, newstmt, BSI_SAME_STMT);
update_stmt (newstmt);
update_stmt (imm_stmt);
}

View File

@ -734,37 +734,15 @@ bsi_start (basic_block bb)
}
/* Return a block statement iterator that points to the first non-label
block BB. */
statement in block BB. */
static inline block_stmt_iterator
bsi_after_labels (basic_block bb)
{
block_stmt_iterator bsi;
tree_stmt_iterator next;
block_stmt_iterator bsi = bsi_start (bb);
bsi.bb = bb;
if (!bb->stmt_list)
{
gcc_assert (bb->index < NUM_FIXED_BLOCKS);
bsi.tsi.ptr = NULL;
bsi.tsi.container = NULL;
return bsi;
}
bsi.tsi = tsi_start (bb->stmt_list);
if (tsi_end_p (bsi.tsi))
return bsi;
next = bsi.tsi;
tsi_next (&next);
while (!tsi_end_p (next)
&& TREE_CODE (tsi_stmt (next)) == LABEL_EXPR)
{
bsi.tsi = next;
tsi_next (&next);
}
while (!bsi_end_p (bsi) && TREE_CODE (bsi_stmt (bsi)) == LABEL_EXPR)
bsi_next (&bsi);
return bsi;
}

View File

@ -737,8 +737,7 @@ find_phi_replacement_condition (struct loop *loop,
tree new_stmt;
new_stmt = ifc_temp_var (TREE_TYPE (*cond), unshare_expr (*cond));
bsi_insert_after (bsi, new_stmt, BSI_SAME_STMT);
bsi_next (bsi);
bsi_insert_before (bsi, new_stmt, BSI_SAME_STMT);
*cond = TREE_OPERAND (new_stmt, 0);
}
@ -804,9 +803,7 @@ replace_phi_with_cond_modify_expr (tree phi, tree cond, basic_block true_bb,
SSA_NAME_DEF_STMT (PHI_RESULT (phi)) = new_stmt;
/* Insert using iterator. */
bsi_insert_after (bsi, new_stmt, BSI_SAME_STMT);
bsi_next (bsi);
bsi_insert_before (bsi, new_stmt, BSI_SAME_STMT);
update_stmt (new_stmt);
if (dump_file && (dump_flags & TDF_DETAILS))

View File

@ -2793,8 +2793,11 @@ scev_const_prop (void)
ass = build2 (MODIFY_EXPR, void_type_node, rslt, NULL_TREE);
SSA_NAME_DEF_STMT (rslt) = ass;
bsi_insert_after (&bsi, ass, BSI_NEW_STMT);
def = force_gimple_operand_bsi (&bsi, def, false, NULL_TREE);
{
block_stmt_iterator dest = bsi;
bsi_insert_before (&dest, ass, BSI_NEW_STMT);
def = force_gimple_operand_bsi (&dest, def, false, NULL_TREE);
}
TREE_OPERAND (ass, 1) = def;
update_stmt (ass);
}

View File

@ -5695,14 +5695,15 @@ compute_phi_arg_on_exit (edge exit, tree stmts, tree op)
{
for (tsi = tsi_start (stmts); !tsi_end_p (tsi); tsi_next (&tsi))
{
bsi_insert_after (&bsi, tsi_stmt (tsi), BSI_NEW_STMT);
protect_loop_closed_ssa_form (exit, bsi_stmt (bsi));
tree stmt = tsi_stmt (tsi);
bsi_insert_before (&bsi, stmt, BSI_SAME_STMT);
protect_loop_closed_ssa_form (exit, stmt);
}
}
else
{
bsi_insert_after (&bsi, stmts, BSI_NEW_STMT);
protect_loop_closed_ssa_form (exit, bsi_stmt (bsi));
bsi_insert_before (&bsi, stmts, BSI_SAME_STMT);
protect_loop_closed_ssa_form (exit, stmts);
}
if (!op)
@ -5719,7 +5720,7 @@ compute_phi_arg_on_exit (edge exit, tree stmts, tree op)
stmt = build2 (MODIFY_EXPR, TREE_TYPE (op),
def, op);
SSA_NAME_DEF_STMT (def) = stmt;
bsi_insert_after (&bsi, stmt, BSI_CONTINUE_LINKING);
bsi_insert_before (&bsi, stmt, BSI_SAME_STMT);
}
}
}