diff options
author | Paolo Bonzini <bonzini@gnu.org> | 2006-02-02 13:05:36 +0000 |
---|---|---|
committer | Paolo Bonzini <bonzini@gcc.gnu.org> | 2006-02-02 13:05:36 +0000 |
commit | 35771d345fbe800cb3769316ffe874909bccdc4b (patch) | |
tree | e16c886c00e7c4c7bd7f6e4ba89378213ccc7f6a | |
parent | 8843c120f1f0a562b0250c59ec66317feae2fb0c (diff) | |
download | gcc-35771d345fbe800cb3769316ffe874909bccdc4b.zip gcc-35771d345fbe800cb3769316ffe874909bccdc4b.tar.gz gcc-35771d345fbe800cb3769316ffe874909bccdc4b.tar.bz2 |
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
-rw-r--r-- | gcc/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/lambda-code.c | 2 | ||||
-rw-r--r-- | gcc/tree-flow-inline.h | 30 | ||||
-rw-r--r-- | gcc/tree-if-conv.c | 7 | ||||
-rw-r--r-- | gcc/tree-scalar-evolution.c | 7 | ||||
-rw-r--r-- | gcc/tree-ssa-loop-ivopts.c | 11 |
6 files changed, 29 insertions, 39 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7c6288e..078ea9d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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. diff --git a/gcc/lambda-code.c b/gcc/lambda-code.c index c19ea6c..ee1d169 100644 --- a/gcc/lambda-code.c +++ b/gcc/lambda-code.c @@ -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); } diff --git a/gcc/tree-flow-inline.h b/gcc/tree-flow-inline.h index 69bef68..0ae99b9 100644 --- a/gcc/tree-flow-inline.h +++ b/gcc/tree-flow-inline.h @@ -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; - - 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; + block_stmt_iterator bsi = bsi_start (bb); - 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; } diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c index 8c41e94..97deb28 100644 --- a/gcc/tree-if-conv.c +++ b/gcc/tree-if-conv.c @@ -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)) diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c index 3075839..462d78f 100644 --- a/gcc/tree-scalar-evolution.c +++ b/gcc/tree-scalar-evolution.c @@ -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); } diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c index 7e1363e..4925d45 100644 --- a/gcc/tree-ssa-loop-ivopts.c +++ b/gcc/tree-ssa-loop-ivopts.c @@ -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); } } } |