]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Eliminate FOR_EACH_BB_REVERSE macro.
authorDavid Malcolm <dmalcolm@redhat.com>
Mon, 9 Dec 2013 21:16:25 +0000 (21:16 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Mon, 9 Dec 2013 21:16:25 +0000 (21:16 +0000)
gcc/
* basic-block.h (FOR_EACH_BB_REVERSE): Eliminate macro.

* cfghooks.c (verify_flow_info): Replace uses of FOR_EACH_BB_REVERSE
with FOR_EACH_BB_REVERSE_FN, making uses of cfun explicit.
* cfgrtl.c (print_rtl_with_bb, rtl_verify_edges,
rtl_verify_bb_insns, rtl_verify_bb_pointers,
rtl_verify_bb_insn_chain, rtl_verify_fallthru): Likewise.
* config/ia64/ia64.c (emit_predicate_relation_info): Likewise.
* config/sh/sh.c (sh_md_init_global): Likewise.
* config/sh/sh_optimize_sett_clrt.cc
(sh_optimize_sett_clrt::execute): Likewise.
* dce.c (reset_unmarked_insns_debug_uses, delete_unmarked_insns):
Likewise.
* dominance.c (calc_dfs_tree): Likewise.
* final.c (final): Likewise.
* function.c (thread_prologue_and_epilogue_insns): Likewise.
* gcse.c (compute_code_hoist_vbeinout): Likewise.
* ira.c (update_equiv_regs, build_insn_chain): Likewise.
* lcm.c (compute_antinout_edge): Likewise.
* mode-switching.c (optimize_mode_switching): Likewise.
* postreload.c (reload_combine): Likewise.
* recog.c (split_all_insns, peephole2_optimize): Likewise.
* tree-ssa-live.c (live_worklist): Likewise.

From-SVN: r205829

18 files changed:
gcc/ChangeLog
gcc/basic-block.h
gcc/cfghooks.c
gcc/cfgrtl.c
gcc/config/ia64/ia64.c
gcc/config/sh/sh.c
gcc/config/sh/sh_optimize_sett_clrt.cc
gcc/dce.c
gcc/dominance.c
gcc/final.c
gcc/function.c
gcc/gcse.c
gcc/ira.c
gcc/lcm.c
gcc/mode-switching.c
gcc/postreload.c
gcc/recog.c
gcc/tree-ssa-live.c

index 3a53226154c33029ae2e801f81be155266bcc340..0ddcecb92d3920a021acf3af4a66607ab2ef7186 100644 (file)
@@ -1,3 +1,29 @@
+2013-12-09  David Malcolm  <dmalcolm@redhat.com>
+
+       * basic-block.h (FOR_EACH_BB_REVERSE): Eliminate macro.
+
+       * cfghooks.c (verify_flow_info): Replace uses of FOR_EACH_BB_REVERSE
+       with FOR_EACH_BB_REVERSE_FN, making uses of cfun explicit.
+       * cfgrtl.c (print_rtl_with_bb, rtl_verify_edges,
+       rtl_verify_bb_insns, rtl_verify_bb_pointers,
+       rtl_verify_bb_insn_chain, rtl_verify_fallthru): Likewise.
+       * config/ia64/ia64.c (emit_predicate_relation_info): Likewise.
+       * config/sh/sh.c (sh_md_init_global): Likewise.
+       * config/sh/sh_optimize_sett_clrt.cc
+       (sh_optimize_sett_clrt::execute): Likewise.
+       * dce.c (reset_unmarked_insns_debug_uses, delete_unmarked_insns):
+       Likewise.
+       * dominance.c (calc_dfs_tree): Likewise.
+       * final.c (final): Likewise.
+       * function.c (thread_prologue_and_epilogue_insns): Likewise.
+       * gcse.c (compute_code_hoist_vbeinout): Likewise.
+       * ira.c (update_equiv_regs, build_insn_chain): Likewise.
+       * lcm.c (compute_antinout_edge): Likewise.
+       * mode-switching.c (optimize_mode_switching): Likewise.
+       * postreload.c (reload_combine): Likewise.
+       * recog.c (split_all_insns, peephole2_optimize): Likewise.
+       * tree-ssa-live.c (live_worklist): Likewise.
+
 2013-12-09  David Malcolm  <dmalcolm@redhat.com>
 
        * basic-block.h (FOR_EACH_BB): Eliminate macro.
index b378a5b240c7ee6432c56ca479018e2b452dfa95..75f16acf52597a3e462bce7d10d0a944a7023485 100644 (file)
@@ -336,8 +336,6 @@ struct GTY(()) control_flow_graph {
 #define FOR_EACH_BB_REVERSE_FN(BB, FN) \
   FOR_BB_BETWEEN (BB, (FN)->cfg->x_exit_block_ptr->prev_bb, (FN)->cfg->x_entry_block_ptr, prev_bb)
 
-#define FOR_EACH_BB_REVERSE(BB) FOR_EACH_BB_REVERSE_FN (BB, cfun)
-
 /* For iterating over insns in basic block.  */
 #define FOR_BB_INSNS(BB, INSN)                 \
   for ((INSN) = BB_HEAD (BB);                  \
index 24009655631649eedf346d607750e0f4ceda1a00..78218b5f56e654873943300e7bb2c8f10603e61b 100644 (file)
@@ -123,7 +123,7 @@ verify_flow_info (void)
     }
 
   /* Now check the basic blocks (boundaries etc.) */
-  FOR_EACH_BB_REVERSE (bb)
+  FOR_EACH_BB_REVERSE_FN (bb, cfun)
     {
       int n_fallthru = 0;
       edge e;
index daadd9b0e2d744fb5d988ec55ffe9c47497d4ef9..7734ac1e0c3a785bd34d2782afb933f1737e7b46 100644 (file)
@@ -2153,7 +2153,7 @@ print_rtl_with_bb (FILE *outf, const_rtx rtx_first, int flags)
 
       if (flags & TDF_BLOCKS)
        {
-         FOR_EACH_BB_REVERSE (bb)
+         FOR_EACH_BB_REVERSE_FN (bb, cfun)
            {
              rtx x;
 
@@ -2408,7 +2408,7 @@ rtl_verify_edges (void)
   int err = 0;
   basic_block bb;
 
-  FOR_EACH_BB_REVERSE (bb)
+  FOR_EACH_BB_REVERSE_FN (bb, cfun)
     {
       int n_fallthru = 0, n_branch = 0, n_abnormal_call = 0, n_sibcall = 0;
       int n_eh = 0, n_abnormal = 0;
@@ -2586,7 +2586,7 @@ rtl_verify_bb_insns (void)
   int err = 0;
   basic_block bb;
 
-  FOR_EACH_BB_REVERSE (bb)
+  FOR_EACH_BB_REVERSE_FN (bb, cfun)
     {
       /* Now check the header of basic
         block.  It ought to contain optional CODE_LABEL followed
@@ -2649,7 +2649,7 @@ rtl_verify_bb_pointers (void)
   basic_block bb;
 
   /* Check the general integrity of the basic blocks.  */
-  FOR_EACH_BB_REVERSE (bb)
+  FOR_EACH_BB_REVERSE_FN (bb, cfun)
     {
       rtx insn;
 
@@ -2739,7 +2739,7 @@ rtl_verify_bb_insn_chain (void)
 
   bb_info = XCNEWVEC (basic_block, max_uid);
 
-  FOR_EACH_BB_REVERSE (bb)
+  FOR_EACH_BB_REVERSE_FN (bb, cfun)
     {
       rtx head = BB_HEAD (bb);
       rtx end = BB_END (bb);
@@ -2821,7 +2821,7 @@ rtl_verify_fallthru (void)
   basic_block bb;
   int err = 0;
 
-  FOR_EACH_BB_REVERSE (bb)
+  FOR_EACH_BB_REVERSE_FN (bb, cfun)
     {
       edge e;
 
index a8379745a14a4b7ad11b7212a05ed40bbb27d033..99bc094132c8bd82b39c20db6b62183e9174dc58 100644 (file)
@@ -9613,7 +9613,7 @@ emit_predicate_relation_info (void)
 {
   basic_block bb;
 
-  FOR_EACH_BB_REVERSE (bb)
+  FOR_EACH_BB_REVERSE_FN (bb, cfun)
     {
       int r;
       rtx head = BB_HEAD (bb);
@@ -9641,7 +9641,7 @@ emit_predicate_relation_info (void)
      relations around them.  Otherwise the assembler will assume the call
      returns, and complain about uses of call-clobbered predicates after
      the call.  */
-  FOR_EACH_BB_REVERSE (bb)
+  FOR_EACH_BB_REVERSE_FN (bb, cfun)
     {
       rtx insn = BB_HEAD (bb);
 
index 519892e1855d29e2c61fda1c1a683d1f7eeb89e8..864b04e9b0f3df571bea588d21a1861ed1ae5ec8 100644 (file)
@@ -11115,7 +11115,7 @@ sh_md_init_global (FILE *dump ATTRIBUTE_UNUSED,
   regmode_weight[1] = (short *) xcalloc (old_max_uid, sizeof (short));
   r0_life_regions = 0;
 
-  FOR_EACH_BB_REVERSE (b)
+  FOR_EACH_BB_REVERSE_FN (b, cfun)
   {
     find_regmode_weight (b, SImode);
     find_regmode_weight (b, SFmode);
index fc58bf9efdf7a3b9fc263fd8f18dc19e02727e21..8d40ce1270b6bfe5036b7827263bc0d9e2246ed7 100644 (file)
@@ -206,7 +206,7 @@ sh_optimize_sett_clrt::execute (void)
   // Look for insns that set the ccreg to a constant value and see if it can
   // be optimized.
   basic_block bb;
-  FOR_EACH_BB_REVERSE (bb)
+  FOR_EACH_BB_REVERSE_FN (bb, cfun)
     for (rtx next_i, i = NEXT_INSN (BB_HEAD (bb));
         i != NULL_RTX && i != BB_END (bb); i = next_i)
       {
index 3101102723783e9e8b257dcd66a69227ebad383c..843dfc6204e6c7d5f9aa47dd2b649c1eec36d4fb 100644 (file)
--- a/gcc/dce.c
+++ b/gcc/dce.c
@@ -511,7 +511,7 @@ reset_unmarked_insns_debug_uses (void)
   basic_block bb;
   rtx insn, next;
 
-  FOR_EACH_BB_REVERSE (bb)
+  FOR_EACH_BB_REVERSE_FN (bb, cfun)
     FOR_BB_INSNS_REVERSE_SAFE (bb, insn, next)
       if (DEBUG_INSN_P (insn))
        {
@@ -550,7 +550,7 @@ delete_unmarked_insns (void)
   rtx insn, next;
   bool must_clean = false;
 
-  FOR_EACH_BB_REVERSE (bb)
+  FOR_EACH_BB_REVERSE_FN (bb, cfun)
     FOR_BB_INSNS_REVERSE_SAFE (bb, insn, next)
       if (NONDEBUG_INSN_P (insn))
        {
index 521b224b8fbe1c34f1d080294798a3643c1bf035..69816c1186a559f157d2da619dcce7fc5dc47ec0 100644 (file)
@@ -357,7 +357,7 @@ calc_dfs_tree (struct dom_info *di, bool reverse)
       basic_block b;
       bool saw_unconnected = false;
 
-      FOR_EACH_BB_REVERSE (b)
+      FOR_EACH_BB_REVERSE_FN (b, cfun)
        {
          if (EDGE_COUNT (b->succs) > 0)
            {
@@ -376,7 +376,7 @@ calc_dfs_tree (struct dom_info *di, bool reverse)
 
       if (saw_unconnected)
        {
-         FOR_EACH_BB_REVERSE (b)
+         FOR_EACH_BB_REVERSE_FN (b, cfun)
            {
              basic_block b2;
              if (di->dfs_order[b->index])
index f475d276b70c8720c20caf1b7b2dd2fb221a0b90..55269741211c7770f09cc152b2c5782994969976 100644 (file)
@@ -1996,7 +1996,7 @@ final (rtx first, FILE *file, int optimize_p)
 
       /* There is no cfg for a thunk.  */
       if (!cfun->is_thunk)
-       FOR_EACH_BB_REVERSE (bb)
+       FOR_EACH_BB_REVERSE_FN (bb, cfun)
          {
            start_to_bb[INSN_UID (BB_HEAD (bb))] = bb;
            end_to_bb[INSN_UID (BB_END (bb))] = bb;
index e00f583b74367b58e99cddbb9b0f27a07b83220a..e2d0e233e80960f15288e6d7ad58eb54286317b3 100644 (file)
@@ -6236,7 +6236,7 @@ thread_prologue_and_epilogue_insns (void)
            }
          /* Now duplicate the tails.  */
          if (!bitmap_empty_p (&bb_tail))
-           FOR_EACH_BB_REVERSE (bb)
+           FOR_EACH_BB_REVERSE_FN (bb, cfun)
              {
                basic_block copy_bb, tbb;
                rtx insert_point;
index a6874abe009884aa94753d2b9003df618f90b4ba..fdf0a572379d2b90a28d3a74778c12dd6e48a759 100644 (file)
@@ -2829,7 +2829,7 @@ compute_code_hoist_vbeinout (void)
 
       /* We scan the blocks in the reverse order to speed up
         the convergence.  */
-      FOR_EACH_BB_REVERSE (bb)
+      FOR_EACH_BB_REVERSE_FN (bb, cfun)
        {
          if (bb->next_bb != EXIT_BLOCK_PTR_FOR_FN (cfun))
            {
index b4ae0ca7451da5988295e536e6ba75f367716ebe..740387087be67b92a2fa3f3ab0863f86371c55e7 100644 (file)
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -3772,7 +3772,7 @@ update_equiv_regs (void)
      within the same loop (or in an inner loop), then move the register
      initialization just before the use, so that they are in the same
      basic block.  */
-  FOR_EACH_BB_REVERSE (bb)
+  FOR_EACH_BB_REVERSE_FN (bb, cfun)
     {
       loop_depth = bb_loop_depth (bb);
       for (insn = BB_END (bb);
@@ -4127,7 +4127,7 @@ build_insn_chain (void)
   for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
     if (TEST_HARD_REG_BIT (eliminable_regset, i))
       bitmap_set_bit (elim_regset, i);
-  FOR_EACH_BB_REVERSE (bb)
+  FOR_EACH_BB_REVERSE_FN (bb, cfun)
     {
       bitmap_iterator bi;
       rtx insn;
index 0b528d9466943f4371195d0726a7cb1615314a80..b5d56e05bf8a3907ff3ecb24170b05430e1e7aa6 100644 (file)
--- a/gcc/lcm.c
+++ b/gcc/lcm.c
@@ -109,7 +109,7 @@ compute_antinout_edge (sbitmap *antloc, sbitmap *transp, sbitmap *antin,
 
   /* Put every block on the worklist; this is necessary because of the
      optimistic initialization of ANTIN above.  */
-  FOR_EACH_BB_REVERSE (bb)
+  FOR_EACH_BB_REVERSE_FN (bb, cfun)
     {
       *qin++ = bb;
       bb->aux = bb;
index 4e31d6812a392a3ee8af3aa58bb2b9aef602f1a9..4f68536d62295f86ced15c85774ac86d4f14c6f3 100644 (file)
@@ -692,7 +692,7 @@ optimize_mode_switching (void)
              insert_insn_on_edge (mode_set, eg);
            }
 
-         FOR_EACH_BB_REVERSE (bb)
+         FOR_EACH_BB_REVERSE_FN (bb, cfun)
            if (bitmap_bit_p (del[bb->index], j))
              {
                make_preds_opaque (bb, j);
@@ -712,7 +712,7 @@ optimize_mode_switching (void)
     {
       int no_mode = num_modes[entity_map[j]];
 
-      FOR_EACH_BB_REVERSE (bb)
+      FOR_EACH_BB_REVERSE_FN (bb, cfun)
        {
          struct seginfo *ptr, *next;
          for (ptr = bb_info[j][bb->index].seginfo; ptr; ptr = next)
index bfa5a38f062c4fbf24dadd50d36239da07f4d255..37bd9ff6ae38668caed601be87809853dfc7a2c8 100644 (file)
@@ -1281,7 +1281,7 @@ reload_combine (void)
   label_live = XNEWVEC (HARD_REG_SET, n_labels);
   CLEAR_HARD_REG_SET (ever_live_at_start);
 
-  FOR_EACH_BB_REVERSE (bb)
+  FOR_EACH_BB_REVERSE_FN (bb, cfun)
     {
       insn = BB_HEAD (bb);
       if (LABEL_P (insn))
index c59aa0e268e04a641af23acbe02c6c3173a9a75b..dbd9a8a506565a89b4f52d289b37213de3526795 100644 (file)
@@ -2902,7 +2902,7 @@ split_all_insns (void)
   bitmap_clear (blocks);
   changed = false;
 
-  FOR_EACH_BB_REVERSE (bb)
+  FOR_EACH_BB_REVERSE_FN (bb, cfun)
     {
       rtx insn, next;
       bool finish = false;
@@ -3556,7 +3556,7 @@ peephole2_optimize (void)
   search_ofs = 0;
   live = BITMAP_ALLOC (&reg_obstack);
 
-  FOR_EACH_BB_REVERSE (bb)
+  FOR_EACH_BB_REVERSE_FN (bb, cfun)
     {
       bool past_end = false;
       int pos;
index da7198bc24851b3f0eea66366407b3a65f570620..a37ef85d6fb6c605db92e49f25b6d5404b5c3378 100644 (file)
@@ -1050,7 +1050,7 @@ live_worklist (tree_live_info_p live)
 
   /* Visit all the blocks in reverse order and propagate live on entry values
      into the predecessors blocks.  */
-  FOR_EACH_BB_REVERSE (bb)
+  FOR_EACH_BB_REVERSE_FN (bb, cfun)
     loe_visit_block (live, bb, visited, tmp);
 
   /* Process any blocks which require further iteration.  */