]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2002-06-10 Roger Sayle <roger@eyesopen.com>
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 10 Jun 2002 22:33:08 +0000 (22:33 +0000)
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 10 Jun 2002 22:33:08 +0000 (22:33 +0000)
    Andreas Jaeger <aj@suse.de>

* cfgrtl.c (create_basic_block_structure):  Remove index argument
and use last_basic_block++ instead.  (create_basic_block): Update.
* cfgbuild.c (find_basic_blocks_1): Likewise.

* cfgrtl.c (compute_bb_for_insn): Remove unused "max" argument.
* haifa-sched.c (sched_init): Update compute_bb_for_insn caller.
* sched-ebb.c (schedule_ebbs): Likewise.
* sched-rgn.c (schedule_insns): Likewise.
* ssa-ccp.c (ssa_const_prop): Likewise.
* ssa-dcs.c (ssa_eliminate_dead_code): Likewise.
* toplev.c (rest_of_compilation): Likewise.
* config/ia64/ia64.c (ia64_reorg): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54477 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/basic-block.h
gcc/cfgbuild.c
gcc/cfgrtl.c
gcc/config/ia64/ia64.c
gcc/haifa-sched.c
gcc/sched-ebb.c
gcc/sched-rgn.c
gcc/ssa-ccp.c
gcc/ssa-dce.c
gcc/toplev.c

index 8d45988d53747390a2faad97ebefb610256921a5..f7cb2aa6fd40011254c80420d9bf42d8096a5899 100644 (file)
@@ -1,3 +1,19 @@
+2002-06-10  Roger Sayle  <roger@eyesopen.com>
+           Andreas Jaeger <aj@suse.de>
+
+       * cfgrtl.c (create_basic_block_structure):  Remove index argument
+       and use last_basic_block++ instead.  (create_basic_block): Update.
+       * cfgbuild.c (find_basic_blocks_1): Likewise.
+
+       * cfgrtl.c (compute_bb_for_insn): Remove unused "max" argument.
+       * haifa-sched.c (sched_init): Update compute_bb_for_insn caller.
+       * sched-ebb.c (schedule_ebbs): Likewise.
+       * sched-rgn.c (schedule_insns): Likewise.
+       * ssa-ccp.c (ssa_const_prop): Likewise.
+       * ssa-dcs.c (ssa_eliminate_dead_code): Likewise.
+       * toplev.c (rest_of_compilation): Likewise.
+       * config/ia64/ia64.c (ia64_reorg): Likewise.
+
 2002-06-10  Roger Sayle  <roger@eyesopen.com>
 
        * simplify-rtx.c (simplify_replace_rtx): Allow replacement
index 7de4c7c088a8524cff77a7fb163d013c20f15dfa..e50c020dc55f5ad258cbb03de0c658d77cba33ef 100644 (file)
@@ -306,7 +306,7 @@ extern struct basic_block_def entry_exit_blocks[2];
 #define BLOCK_NUM(INSN)              (BLOCK_FOR_INSN (INSN)->index + 0)
 #define set_block_for_insn(INSN, BB)  (BLOCK_FOR_INSN (INSN) = BB)
 
-extern void compute_bb_for_insn                PARAMS ((int));
+extern void compute_bb_for_insn                PARAMS ((void));
 extern void free_bb_for_insn           PARAMS ((void));
 extern void update_bb_for_insn         PARAMS ((basic_block));
 
@@ -333,7 +333,7 @@ extern void remove_edge                     PARAMS ((edge));
 extern void redirect_edge_succ         PARAMS ((edge, basic_block));
 extern edge redirect_edge_succ_nodup   PARAMS ((edge, basic_block));
 extern void redirect_edge_pred         PARAMS ((edge, basic_block));
-extern basic_block create_basic_block_structure PARAMS ((int, rtx, rtx, rtx, basic_block));
+extern basic_block create_basic_block_structure PARAMS ((rtx, rtx, rtx, basic_block));
 extern basic_block create_basic_block  PARAMS ((rtx, rtx, basic_block));
 extern int flow_delete_block           PARAMS ((basic_block));
 extern int flow_delete_block_noexpunge PARAMS ((basic_block));
index 0352fbe52a039c227b46e655ed8c32c8b6348d27..0c9c279a30281335f09aaa3cd488a7b549d638f5 100644 (file)
@@ -493,7 +493,7 @@ find_basic_blocks_1 (f)
       if ((GET_CODE (insn) == CODE_LABEL || GET_CODE (insn) == BARRIER)
          && head)
        {
-         prev = create_basic_block_structure (last_basic_block++, head, end, bb_note, prev);
+         prev = create_basic_block_structure (head, end, bb_note, prev);
          head = end = NULL_RTX;
          bb_note = NULL_RTX;
        }
@@ -507,7 +507,7 @@ find_basic_blocks_1 (f)
 
       if (head && control_flow_insn_p (insn))
        {
-         prev = create_basic_block_structure (last_basic_block++, head, end, bb_note, prev);
+         prev = create_basic_block_structure (head, end, bb_note, prev);
          head = end = NULL_RTX;
          bb_note = NULL_RTX;
        }
@@ -589,7 +589,7 @@ find_basic_blocks_1 (f)
     }
 
   if (head != NULL_RTX)
-    create_basic_block_structure (last_basic_block++, head, end, bb_note, prev);
+    create_basic_block_structure (head, end, bb_note, prev);
   else if (bb_note)
     delete_insn (bb_note);
 
@@ -612,7 +612,6 @@ find_basic_blocks (f, nregs, file)
      int nregs ATTRIBUTE_UNUSED;
      FILE *file ATTRIBUTE_UNUSED;
 {
-  int max_uid;
   basic_block bb;
 
   timevar_push (TV_CFG);
@@ -653,14 +652,7 @@ find_basic_blocks (f, nregs, file)
      tagged directly with the basic block that it starts.  It is used for
      more than that currently, but IMO that is the only valid use.  */
 
-  max_uid = get_max_uid ();
-#ifdef AUTO_INC_DEC
-  /* Leave space for insns life_analysis makes in some cases for auto-inc.
-     These cases are rare, so we don't need too much space.  */
-  max_uid += max_uid / 10;
-#endif
-
-  compute_bb_for_insn (max_uid);
+  compute_bb_for_insn ();
 
   /* Discover the edges of our cfg.  */
   make_edges (label_value_list, ENTRY_BLOCK_PTR->next_bb, EXIT_BLOCK_PTR->prev_bb, 0);
index e40ecf23dea485daf1abb29b378a1b401f600277..70bf73b4f129e3f49404ad79d717d3dfe8a6502c 100644 (file)
@@ -245,8 +245,7 @@ delete_insn_chain_and_edges (first, last)
    AFTER is the basic block we should be put after.  */
 
 basic_block
-create_basic_block_structure (index, head, end, bb_note, after)
-     int index;
+create_basic_block_structure (head, end, bb_note, after)
      rtx head, end, bb_note;
      basic_block after;
 {
@@ -304,10 +303,10 @@ create_basic_block_structure (index, head, end, bb_note, after)
 
   bb->head = head;
   bb->end = end;
-  bb->index = index;
+  bb->index = last_basic_block++;
   bb->flags = BB_NEW;
   link_block (bb, after);
-  BASIC_BLOCK (index) = bb;
+  BASIC_BLOCK (bb->index) = bb;
   update_bb_for_insn (bb);
 
   /* Tag the block so that we know it has been used when considering
@@ -328,14 +327,13 @@ create_basic_block (head, end, after)
      basic_block after;
 {
   basic_block bb;
-  int index = last_basic_block++;
 
   /* Place the new block just after the end.  */
-  VARRAY_GROW (basic_block_info, last_basic_block);
+  VARRAY_GROW (basic_block_info, last_basic_block+1);
 
   n_basic_blocks++;
 
-  bb = create_basic_block_structure (index, head, end, NULL, after);
+  bb = create_basic_block_structure (head, end, NULL, after);
   bb->aux = NULL;
   return bb;
 }
@@ -423,12 +421,10 @@ flow_delete_block (b)
   return deleted_handler;
 }
 \f
-/* Records the basic block struct in BB_FOR_INSN, for every instruction
-   indexed by INSN_UID.  MAX is the size of the array.  */
+/* Records the basic block struct in BLOCK_FOR_INSN for every insn.  */
 
 void
-compute_bb_for_insn (max)
-     int max;
+compute_bb_for_insn ()
 {
   basic_block bb;
 
index bf045cd8092fccf3e28281034d641e7856d3c737..7601d761847cadc4c319ad6d4a9e6c2b3f416a70 100644 (file)
@@ -6933,7 +6933,7 @@ ia64_reorg (insns)
 {
   /* We are freeing block_for_insn in the toplev to keep compatibility
      with old MDEP_REORGS that are not CFG based.  Recompute it now.  */
-  compute_bb_for_insn (get_max_uid ());
+  compute_bb_for_insn ();
 
   /* If optimizing, we'll have split before scheduling.  */
   if (optimize == 0)
index 0dc84e5b7c2497bb7190833c6e83d4f970d70569..c39b0505111ddd30df200214eefcb9703182241b 100644 (file)
@@ -2368,7 +2368,7 @@ sched_init (dump_file)
 
   init_dependency_caches (luid);
 
-  compute_bb_for_insn (old_max_uid);
+  compute_bb_for_insn ();
 
   init_alias_analysis ();
 
index 91bf88ec2b999ef5dfa35021b42164277cfb9b06..43bf9ab4ca4b6778b354cd21beed9175c3929234 100644 (file)
@@ -291,7 +291,7 @@ schedule_ebbs (dump_file)
   current_sched_info = &ebb_sched_info;
 
   allocate_reg_life_data ();
-  compute_bb_for_insn (get_max_uid ());
+  compute_bb_for_insn ();
 
   /* Schedule every region in the subroutine.  */
   FOR_EACH_BB (bb)
index 280f33089d6008d29200fa563c8f1dbf17595a4b..30b2cf0d8f5ea6090dddfe4182bbe72d401e5b26 100644 (file)
@@ -3016,7 +3016,7 @@ schedule_insns (dump_file)
      best way to test for this kind of thing...  */
 
   allocate_reg_life_data ();
-  compute_bb_for_insn (get_max_uid ());
+  compute_bb_for_insn ();
 
   any_large_regions = 0;
   large_region_blocks = sbitmap_alloc (last_basic_block);
index 2549f67b4dc76a56bbb2bcfbb5ba09609afbe1a1..af4c59356dc7446ef770b656cad47a09c4258047 100644 (file)
@@ -992,7 +992,7 @@ ssa_const_prop ()
              DF_RD_CHAIN | DF_RU_CHAIN | DF_REG_INFO | DF_HARD_REGS);
 
   /* We need mappings from insn to its containing block.  */
-  compute_bb_for_insn (get_max_uid ());
+  compute_bb_for_insn ();
 
   /* Perform a quick and dirty dead code elimination pass.  This is not
      as aggressive as it could be, but it's good enough to clean up a
index 4f89941fa8599c448fbe3251a20f060f992364f8..db13b9ae7e8fe10ba7cc0ce430d7cbe075b2bba9 100644 (file)
@@ -500,8 +500,6 @@ ssa_eliminate_dead_code ()
   int *pdom;
   struct edge_list *el;
 
-  int max_insn_uid = get_max_uid ();
-
   /* Initialize the data structures.  */
   mark_all_insn_unnecessary ();
   VARRAY_RTX_INIT (unprocessed_instructions, 64,
@@ -511,7 +509,7 @@ ssa_eliminate_dead_code ()
   /* Prepare for use of BLOCK_NUM ().  */
   connect_infinite_loops_to_exit ();
    /* Be careful not to clear the added edges.  */
-  compute_bb_for_insn (max_insn_uid);
+  compute_bb_for_insn ();
 
   /* Compute control dependence.  */
   pdom = (int *) xmalloc (last_basic_block * sizeof (int));
index 47011f4f4ae456ec203bb0bf3519cb188d6d492a..12be2b1e6ee8d13b15ede7f340cbb669379f6a3e 100644 (file)
@@ -2746,7 +2746,7 @@ rest_of_compilation (decl)
      we'll save big on memory.  */
   renumber_insns (rtl_dump_file);
   if (optimize)
-    compute_bb_for_insn (get_max_uid ());
+    compute_bb_for_insn ();
   timevar_pop (TV_JUMP);
 
   close_dump_file (DFI_jump, print_rtl_with_bb, insns);
@@ -2794,7 +2794,7 @@ rest_of_compilation (decl)
       /* The second pass of jump optimization is likely to have
          removed a bunch more instructions.  */
       renumber_insns (rtl_dump_file);
-      compute_bb_for_insn (get_max_uid ());
+      compute_bb_for_insn ();
 
       timevar_pop (TV_CSE);
       close_dump_file (DFI_cse, print_rtl_with_bb, insns);