]> gcc.gnu.org Git - gcc.git/commitdiff
tree-cfg.c (bsi_for_stmt): Rename from stmt_for_bsi.
authorDiego Novillo <dnovillo@redhat.com>
Mon, 18 Oct 2004 18:01:10 +0000 (18:01 +0000)
committerDiego Novillo <dnovillo@gcc.gnu.org>
Mon, 18 Oct 2004 18:01:10 +0000 (14:01 -0400)
* tree-cfg.c (bsi_for_stmt): Rename from stmt_for_bsi.
Update all callers.
* tree-ssa.c (replace_immediate_uses): Call bsi_for_stmt.
Don't call fold_stmt more than once, use bsi_replace.

From-SVN: r89234

gcc/ChangeLog
gcc/lambda-code.c
gcc/tree-cfg.c
gcc/tree-flow.h
gcc/tree-ssa-loop-ivopts.c
gcc/tree-ssa.c

index c6bcd56d4ce769233685acfb6e367fff5f198486..fe4213bd8c7e053e4e6e63623c94e92009e63b13 100644 (file)
@@ -1,3 +1,10 @@
+2004-10-18  Diego Novillo  <dnovillo@redhat.com>
+
+       * tree-cfg.c (bsi_for_stmt): Rename from stmt_for_bsi.
+       Update all callers.
+       * tree-ssa.c (replace_immediate_uses): Call bsi_for_stmt.
+       Don't call fold_stmt more than once, use bsi_replace.
+
 2004-10-18  Diego Novillo  <dnovillo@redhat.com>
 
        PR tree-optimization/17656
index 2f75db9f998d89ec404e7e84e41983f0d827ed06..4ad62b49eff58e1d5c242bb9c9213dee6820593e 100644 (file)
@@ -1937,7 +1937,7 @@ lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest,
                  LBV_COEFFICIENTS (lbv)[i] = 1;
                  lbv = lambda_body_vector_compute_new (transform, lbv);
                  newiv = lbv_to_gcc_expression (lbv, new_ivs, &stmts);
-                 bsi = stmt_for_bsi (stmt);
+                 bsi = bsi_for_stmt (stmt);
                  /* Insert the statements to build that
                     expression.  */
                  bsi_insert_before (&bsi, stmts, BSI_SAME_STMT);
index 7874000a1d5fb1ee50ce4d2cc1282076179f48cb..72cbbd88044843040dce6748c7e2c8d48ae93a21 100644 (file)
@@ -2638,7 +2638,7 @@ set_bb_for_stmt (tree t, basic_block bb)
 /* Finds iterator for STMT.  */
 
 extern block_stmt_iterator
-stmt_for_bsi (tree stmt)
+bsi_for_stmt (tree stmt)
 {
   block_stmt_iterator bsi;
 
index c26e91b5c19e71c2cdffdd21d84de6abb6f9c177..4db7fa9833be677e3e7971f66437fce6a8dff888 100644 (file)
@@ -416,7 +416,7 @@ typedef struct {
 static inline block_stmt_iterator bsi_start (basic_block);
 static inline block_stmt_iterator bsi_last (basic_block);
 static inline block_stmt_iterator bsi_after_labels (basic_block);
-block_stmt_iterator stmt_for_bsi (tree);
+block_stmt_iterator bsi_for_stmt (tree);
 static inline bool bsi_end_p (block_stmt_iterator);
 static inline void bsi_next (block_stmt_iterator *);
 static inline void bsi_prev (block_stmt_iterator *);
index 53d899d669e38c906469fb49e1bcb12b58fb5e85..a620aca8ce44f9b299fefd678de7b737d3717512 100644 (file)
@@ -3878,7 +3878,7 @@ remove_statement (tree stmt, bool including_defined_name)
     }
   else
     {
-      block_stmt_iterator bsi = stmt_for_bsi (stmt);
+      block_stmt_iterator bsi = bsi_for_stmt (stmt);
 
       bsi_remove (&bsi);
     }
@@ -3916,7 +3916,7 @@ rewrite_use_nonlinear_expr (struct ivopts_data *data,
 
     case MODIFY_EXPR:
       tgt = TREE_OPERAND (use->stmt, 0);
-      bsi = stmt_for_bsi (use->stmt);
+      bsi = bsi_for_stmt (use->stmt);
       break;
 
     default:
@@ -4055,7 +4055,7 @@ rewrite_use_address (struct ivopts_data *data,
 {
   tree comp = unshare_expr (get_computation (data->current_loop,
                                             use, cand));
-  block_stmt_iterator bsi = stmt_for_bsi (use->stmt);
+  block_stmt_iterator bsi = bsi_for_stmt (use->stmt);
   tree stmts;
   tree op = force_gimple_operand (comp, &stmts, true, NULL_TREE);
 
@@ -4074,7 +4074,7 @@ rewrite_use_compare (struct ivopts_data *data,
 {
   tree comp;
   tree *op_p, cond, op, stmts, bound;
-  block_stmt_iterator bsi = stmt_for_bsi (use->stmt);
+  block_stmt_iterator bsi = bsi_for_stmt (use->stmt);
   enum tree_code compare;
   
   if (may_eliminate_iv (data->current_loop,
index 4362e01aff8d6e93979c4d14bdd71b2e769aad1f..7f73bcf6e73e831968168edcccc5d28fdf07686b 100644 (file)
@@ -1105,20 +1105,9 @@ replace_immediate_uses (tree var, tree repl)
          fold_stmt (&tmp);
          if (tmp != stmt)
            {
-             basic_block bb = bb_for_stmt (stmt);
-             block_stmt_iterator si;
-
-             /* Start iterating at the start of the basic block
-                holding STMT until we reach it.  This is slow, but
-                it's the only way to get a statement pointer
-                reliably.  */
-             for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
-               if (bsi_stmt (si) == stmt)
-                 {
-                   fold_stmt (bsi_stmt_ptr (si));
-                   stmt = bsi_stmt (si);
-                   break;
-                 }
+             block_stmt_iterator si = bsi_for_stmt (stmt);
+             bsi_replace (&si, tmp, true);
+             stmt = bsi_stmt (si);
            }
        }
 
This page took 0.095227 seconds and 5 git commands to generate.