df-scan.c (persistent_obstack, [...]): Remove.
authorJan Hubicka <jh@suse.cz>
Thu, 18 Dec 2008 13:52:45 +0000 (14:52 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Thu, 18 Dec 2008 13:52:45 +0000 (13:52 +0000)
* df-scan.c (persistent_obstack, df_invalidated_by_call): Remove.
(df_scan_start_dump, df_get_call_refs, df_hard_reg_init): Rename
df_invalidated_by_call to invalidated_by_call_regset.
* df.h (df_invalidated_by_call): Remove.
* regclass.c (regs_invalidated_by_call_regset, persistent_obstack): New
variables.
(init_reg_sets_1): Initialize regs_invalidated_by_call_regset.
(globalize_reg): Likewise.
* df-problems.c (df_rd_local_compute, df_lr_confluence_n,
df_byte_lr_alloc): Rename df_invalidated_by_call to
invalidated_by_call_regset.
* basic-block.h (regs_invalidated_by_call_regset): Declare.

Co-Authored-By: Kai Tietz <kai.tietz@onevision.com>
From-SVN: r142812

gcc/ChangeLog
gcc/basic-block.h
gcc/df-problems.c
gcc/df-scan.c
gcc/df.h
gcc/regclass.c

index 8c10d1a789b049c6e03379d4cb7ad24f90a40541..07009dade543c93b3abd2e9fd5c11d83ed9a613c 100644 (file)
@@ -1,3 +1,19 @@
+2008-12-18  Jan Hubicka  <jh@suse.cz>
+           Kai Tietz <kai.tietz@onevision.com>
+
+       * df-scan.c (persistent_obstack, df_invalidated_by_call): Remove.
+       (df_scan_start_dump, df_get_call_refs, df_hard_reg_init): Rename
+       df_invalidated_by_call to invalidated_by_call_regset.
+       * df.h (df_invalidated_by_call): Remove.
+       * regclass.c (regs_invalidated_by_call_regset, persistent_obstack): New
+       variables.
+       (init_reg_sets_1): Initialize regs_invalidated_by_call_regset.
+       (globalize_reg): Likewise.
+       * df-problems.c (df_rd_local_compute, df_lr_confluence_n,
+       df_byte_lr_alloc): Rename df_invalidated_by_call to
+       invalidated_by_call_regset.
+       * basic-block.h (regs_invalidated_by_call_regset): Declare.
+
 2008-12-18  Jan Hubicka  <jh@suse.cz>
            Kai Tietz <kai.tietz@onevision.com>
 
index f954c9ffa5dcafc27524b35fa4d86495b0ce9755..bd741b52275db63a612a265e2c19b4d6cc5b2870 100644 (file)
@@ -106,6 +106,11 @@ typedef bitmap_iterator reg_set_iterator;
 #define EXECUTE_IF_AND_IN_REG_SET(REGSET1, REGSET2, MIN, REGNUM, RSI) \
   EXECUTE_IF_AND_IN_BITMAP (REGSET1, REGSET2, MIN, REGNUM, RSI)        \
 
+/* Same information as REGS_INVALIDATED_BY_CALL but in regset form to be used
+   in dataflow more conveniently.  */
+
+extern regset regs_invalidated_by_call_regset;
+
 /* Type we use to hold basic block counters.  Should be at least
    64bit.  Although a counter cannot be negative, we use a signed
    type, because erroneous negative counts can be generated when the
index 829698ba1b3760a910e53a65333439c7b2b448f4..9175f106c960b01fecb5ddc65927e20daaf91aa2 100644 (file)
@@ -443,7 +443,7 @@ df_rd_local_compute (bitmap all_blocks)
     }
   
   /* Set up the knockout bit vectors to be applied across EH_EDGES.  */
-  EXECUTE_IF_SET_IN_BITMAP (df_invalidated_by_call, 0, regno, bi)
+  EXECUTE_IF_SET_IN_BITMAP (regs_invalidated_by_call_regset, 0, regno, bi)
     {
       if (DF_DEFS_COUNT (regno) > DF_SPARSE_THRESHOLD)
        bitmap_set_bit (sparse_invalidated, regno);
@@ -975,7 +975,7 @@ df_lr_confluence_n (edge e)
   /* ??? Abnormal call edges ignored for the moment, as this gets
      confused by sibling call edges, which crashes reg-stack.  */
   if (e->flags & EDGE_EH)
-    bitmap_ior_and_compl_into (op1, op2, df_invalidated_by_call);
+    bitmap_ior_and_compl_into (op1, op2, regs_invalidated_by_call_regset);
   else
     bitmap_ior_into (op1, op2);
 
@@ -2542,7 +2542,7 @@ df_byte_lr_alloc (bitmap all_blocks ATTRIBUTE_UNUSED)
   df_byte_lr_expand_bitmap (problem_data->hardware_regs_used, 
                            df->hardware_regs_used);
   df_byte_lr_expand_bitmap (problem_data->invalidated_by_call, 
-                           df_invalidated_by_call);
+                           regs_invalidated_by_call_regset);
 
   EXECUTE_IF_SET_IN_BITMAP (df_byte_lr->out_of_date_transfer_functions, 0, bb_index, bi)
     {
index 6a750a8a9b3dd85bb7a81c331a5016f0535143ee..14434d2c09280f2576341907acb4b272690d966a 100644 (file)
@@ -75,20 +75,10 @@ along with GCC; see the file COPYING3.  If not see
       free (V);  \
   } while (0)
 
-/* The bitmap_obstack is used to hold some static variables that
-   should not be reset after each function is compiled.  */
-
-static bitmap_obstack persistent_obstack;
-
 /* The set of hard registers in eliminables[i].from. */
 
 static HARD_REG_SET elim_reg_set;
 
-/* This is a bitmap copy of regs_invalidated_by_call so that we can
-   easily add it into bitmaps, etc. */ 
-
-bitmap df_invalidated_by_call = NULL;
-
 /* Initialize ur_in and ur_out as if all hard registers were partially
    available.  */
 
@@ -436,7 +426,7 @@ df_scan_start_dump (FILE *file ATTRIBUTE_UNUSED)
   rtx insn;
 
   fprintf (file, ";;  invalidated by call \t");
-  df_print_regset (file, df_invalidated_by_call);
+  df_print_regset (file, regs_invalidated_by_call_regset);
   fprintf (file, ";;  hardware regs used \t");
   df_print_regset (file, df->hardware_regs_used);
   fprintf (file, ";;  regular block artificial uses \t");
@@ -3391,7 +3381,7 @@ df_get_call_refs (struct df_collection_rec * collection_rec,
       }
 
   is_sibling_call = SIBLING_CALL_P (insn_info->insn);
-  EXECUTE_IF_SET_IN_BITMAP (df_invalidated_by_call, 0, ui, bi)
+  EXECUTE_IF_SET_IN_BITMAP (regs_invalidated_by_call_regset, 0, ui, bi)
     {
       if (!global_regs[ui]
          && (!bitmap_bit_p (defs_generated, ui))
@@ -4121,8 +4111,6 @@ df_hard_reg_init (void)
   if (initialized)
     return;
 
-  bitmap_obstack_initialize (&persistent_obstack);
-
   /* Record which registers will be eliminated.  We use this in
      mark_used_regs.  */
   CLEAR_HARD_REG_SET (elim_reg_set);
@@ -4134,14 +4122,6 @@ df_hard_reg_init (void)
   SET_HARD_REG_BIT (elim_reg_set, FRAME_POINTER_REGNUM);
 #endif
   
-  df_invalidated_by_call = BITMAP_ALLOC (&persistent_obstack);
-  
-  /* Inconveniently, this is only readily available in hard reg set
-     form.  */
-  for (i = 0; i < FIRST_PSEUDO_REGISTER; ++i)
-    if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i))
-      bitmap_set_bit (df_invalidated_by_call, i);
-  
   initialized = true;
 }
 
index 5cd5dfccb25e2c6d9cfa3b5a0c92e590387b93ff..dd00d9284d100d49f38653627a1cce593830f55e 100644 (file)
--- a/gcc/df.h
+++ b/gcc/df.h
@@ -762,11 +762,6 @@ struct df
 
 extern bitmap_obstack df_bitmap_obstack;
 
-/* This is a bitmap copy of regs_invalidated_by_call so that we can
-   easily add it into bitmaps, etc. */ 
-
-extern bitmap df_invalidated_by_call;
-
 
 /* One of these structures is allocated for every basic block.  */
 struct df_scan_bb_info
index b12d41685066b5795df5607592df2ce5fc932196..f31ccd15e4026ddf4213c65b25abf6caeb6ed67c 100644 (file)
@@ -145,6 +145,16 @@ char global_regs[FIRST_PSEUDO_REGISTER];
 
 HARD_REG_SET regs_invalidated_by_call;
 
+/* Same information as REGS_INVALIDATED_BY_CALL but in regset form to be used
+   in dataflow more conveniently.  */
+
+regset regs_invalidated_by_call_regset;
+
+/* The bitmap_obstack is used to hold some static variables that
+   should not be reset after each function is compiled.  */
+
+static bitmap_obstack persistent_obstack;
+
 /* Table of register numbers in the order in which to try to use them.  */
 #ifdef REG_ALLOC_ORDER
 int reg_alloc_order[FIRST_PSEUDO_REGISTER] = REG_ALLOC_ORDER;
@@ -568,6 +578,13 @@ init_reg_sets_1 (void)
   CLEAR_HARD_REG_SET (call_fixed_reg_set);
   CLEAR_HARD_REG_SET (regs_invalidated_by_call);
   CLEAR_HARD_REG_SET (losing_caller_save_reg_set);
+  if (!regs_invalidated_by_call_regset)
+    {
+      bitmap_obstack_initialize (&persistent_obstack);
+      regs_invalidated_by_call_regset = ALLOC_REG_SET (&persistent_obstack);
+    }
+  else
+    CLEAR_REG_SET (regs_invalidated_by_call_regset);
 
   memcpy (call_fixed_regs, fixed_regs, sizeof call_fixed_regs);
 
@@ -602,7 +619,10 @@ init_reg_sets_1 (void)
       if (i == STACK_POINTER_REGNUM)
        ;
       else if (global_regs[i])
-       SET_HARD_REG_BIT (regs_invalidated_by_call, i);
+        {
+         SET_HARD_REG_BIT (regs_invalidated_by_call, i);
+         SET_REGNO_REG_SET (regs_invalidated_by_call_regset, i);
+       }
       else if (i == FRAME_POINTER_REGNUM)
        ;
 #if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM
@@ -618,7 +638,10 @@ init_reg_sets_1 (void)
        ;
 #endif
       else if (CALL_REALLY_USED_REGNO_P (i))
-       SET_HARD_REG_BIT (regs_invalidated_by_call, i);
+        {
+         SET_HARD_REG_BIT (regs_invalidated_by_call, i);
+         SET_REGNO_REG_SET (regs_invalidated_by_call_regset, i);
+        }
     }
 
   /* Preserve global registers if called more than once.  */
@@ -912,7 +935,10 @@ globalize_reg (int i)
      appropriate regs_invalidated_by_call bit, even if it's already
      set in fixed_regs.  */
   if (i != STACK_POINTER_REGNUM)
-    SET_HARD_REG_BIT (regs_invalidated_by_call, i);
+    {
+      SET_HARD_REG_BIT (regs_invalidated_by_call, i);
+      SET_REGNO_REG_SET (regs_invalidated_by_call_regset, i);
+   }
 
   /* If already fixed, nothing else to do.  */
   if (fixed_regs[i])