combine.c (gen_lowpart_for_combine): Update handling of subregs_of_mode
authorJan Hubicka <jh@suse.cz>
Fri, 28 Feb 2003 10:11:47 +0000 (11:11 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Fri, 28 Feb 2003 10:11:47 +0000 (10:11 +0000)
* combine.c (gen_lowpart_for_combine): Update handling of
subregs_of_mode
* flow.c (life_analysis, mark_used_regs): Likewise.
* regclass.c (subregs_of_mode): Turn into single bitmap.
(cannot_change-mode_set_regs, invalid_mode_change_p): Update
dealing with subregs_of_mode
* regs.h (subregs_of_mode): Update prototype.

From-SVN: r63552

gcc/ChangeLog
gcc/combine.c
gcc/flow.c
gcc/reg-stack.c
gcc/regclass.c
gcc/regs.h
gcc/toplev.c

index 42db6357cc178867698913977d036bd38b5fffad..5023208ea0b5507bdc18961bf95a02552a457d22 100644 (file)
@@ -1,3 +1,13 @@
+Fri Feb 28 11:09:14 CET 2003  Jan Hubicka  <jh@suse.cz>
+
+       * combine.c (gen_lowpart_for_combine): Update handling of
+       subregs_of_mode
+       * flow.c (life_analysis, mark_used_regs): Likewise.
+       * regclass.c (subregs_of_mode): Turn into single bitmap.
+       (cannot_change-mode_set_regs, invalid_mode_change_p): Update
+       dealing with subregs_of_mode
+       * regs.h (subregs_of_mode): Update prototype.
+
 2003-02-28  Josef Zlomek  <zlomekj@suse.cz>
 
        * emit-rtl.c (set_reg_attrs_for_parm): New function.
index 50b1876eb581751d8ccd4022eba086bfd7cdcd80..e193387025196ee6aedd87125d96912fba762f51 100644 (file)
@@ -10201,8 +10201,9 @@ gen_lowpart_for_combine (mode, x)
       && GET_CODE (result) == SUBREG
       && GET_CODE (SUBREG_REG (result)) == REG
       && REGNO (SUBREG_REG (result)) >= FIRST_PSEUDO_REGISTER)
-    SET_REGNO_REG_SET (&subregs_of_mode[GET_MODE (result)],
-                      REGNO (SUBREG_REG (result)));
+    bitmap_set_bit (&subregs_of_mode, REGNO (SUBREG_REG (result))
+                                     * MAX_MACHINE_MODE
+                                     + GET_MODE (result));
 #endif
 
   if (result)
index 24f869153c0e2b2fab20ae75605d5f56d1202ebf..fb60610a7a87322fa913c552c324db4ec95480dd 100644 (file)
@@ -436,11 +436,7 @@ life_analysis (f, file, flags)
 
 #ifdef CANNOT_CHANGE_MODE_CLASS
   if (flags & PROP_REG_INFO)
-    {
-      int j;
-      for (j=0; j < NUM_MACHINE_MODES; ++j)
-       INIT_REG_SET (&subregs_of_mode[j]);
-    }
+    bitmap_initialize (&subregs_of_mode, 1);
 #endif
 
   if (! optimize)
@@ -3845,8 +3841,9 @@ mark_used_regs (pbi, x, cond, insn)
 #ifdef CANNOT_CHANGE_MODE_CLASS
       if (GET_CODE (SUBREG_REG (x)) == REG
          && REGNO (SUBREG_REG (x)) >= FIRST_PSEUDO_REGISTER)
-       SET_REGNO_REG_SET (&subregs_of_mode[GET_MODE (x)],
-                          REGNO (SUBREG_REG (x)));
+       bitmap_set_bit (&subregs_of_mode, REGNO (SUBREG_REG (x))
+                                         * MAX_MACHINE_MODE
+                                         + GET_MODE (x));
 #endif
 
       /* While we're here, optimize this case.  */
@@ -3894,8 +3891,9 @@ mark_used_regs (pbi, x, cond, insn)
            if (GET_CODE (testreg) == SUBREG
                && GET_CODE (SUBREG_REG (testreg)) == REG
                && REGNO (SUBREG_REG (testreg)) >= FIRST_PSEUDO_REGISTER)
-             SET_REGNO_REG_SET (&subregs_of_mode[GET_MODE (testreg)],
-                                REGNO (SUBREG_REG (testreg)));
+             bitmap_set_bit (&subregs_of_mode, REGNO (SUBREG_REG (testreg))
+                                               * MAX_MACHINE_MODE
+                                               + GET_MODE (testreg));
 #endif
 
            /* Modifying a single register in an alternate mode
index 52be2a20bc25e9abdb7ee0b314f4d84439910942..8626d6367787a185714748f0f4308a93e207480c 100644 (file)
@@ -428,9 +428,6 @@ reg_to_stack (first, file)
   /* Clean up previous run.  */
   stack_regs_mentioned_data = 0;
 
-  if (!optimize)
-    split_all_insns (0);
-
   /* See if there is something to do.  Flow analysis is quite
      expensive so we might save some compilation time.  */
   for (i = FIRST_STACK_REG; i <= LAST_STACK_REG; i++)
index abbd6eabe3d50c01a3eccd725dcc723a8de6df63..01c08f3a07861dac6f392d82eb2ccdecff5ff6f2 100644 (file)
@@ -232,9 +232,9 @@ static char *in_inc_dec;
 #endif /* FORBIDDEN_INC_DEC_CLASSES */
 
 #ifdef CANNOT_CHANGE_MODE_CLASS
-/* All registers that have been subreged.  Indexed by mode, where each
-   entry is a regset of registers.  */
-regset_head subregs_of_mode [NUM_MACHINE_MODES];
+/* All registers that have been subreged.  Indexed by regno * MAX_MACHINE_MODE
+   + mode.  */
+bitmap_head subregs_of_mode;
 #endif
 
 /* Sample MEM values for use by memory_move_secondary_cost.  */
@@ -2638,16 +2638,18 @@ cannot_change_mode_set_regs (used, from, regno)
      unsigned int regno;
 {
   enum machine_mode to;
+  int n, i;
+  int start = regno * MAX_MACHINE_MODE;
 
-  for (to = VOIDmode; to < MAX_MACHINE_MODE; ++to)
-    if (REGNO_REG_SET_P (&subregs_of_mode[to], regno))
-      {
-       int i;
-       for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
-          if (! TEST_HARD_REG_BIT (*used, i)
-             && REG_CANNOT_CHANGE_MODE_P (i, from, to))
-           SET_HARD_REG_BIT (*used, i);
-      }
+  EXECUTE_IF_SET_IN_BITMAP (&subregs_of_mode, start, n,
+    if (n >= MAX_MACHINE_MODE + start)
+      return;
+    to = n - start;
+    for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+      if (! TEST_HARD_REG_BIT (*used, i)
+         && REG_CANNOT_CHANGE_MODE_P (i, from, to))
+       SET_HARD_REG_BIT (*used, i);
+  );
 }
 
 /* Return 1 if REGNO has had an invalid mode change in CLASS from FROM
@@ -2660,11 +2662,16 @@ invalid_mode_change_p (regno, class, from_mode)
      enum machine_mode from_mode;
 {
   enum machine_mode to_mode;
-
-  for (to_mode = 0; to_mode < NUM_MACHINE_MODES; ++to_mode)
-    if (REGNO_REG_SET_P (&subregs_of_mode[(int) to_mode], regno)
-       && CANNOT_CHANGE_MODE_CLASS (from_mode, to_mode, class))
+  int n;
+  int start = regno * MAX_MACHINE_MODE;
+
+  EXECUTE_IF_SET_IN_BITMAP (&subregs_of_mode, start, n,
+    if (n >= MAX_MACHINE_MODE + start)
+      return 0;
+    to_mode = n - start;
+    if (CANNOT_CHANGE_MODE_CLASS (from_mode, to_mode, class))
       return 1;
+  );
   return 0;
 }
 #endif /* CANNOT_CHANGE_MODE_CLASS */
index 4a78212ec805ad60a859c6f1b8a8dccb8c6d67b9..2e838e329398a563525077f5b38a40825234fd79 100644 (file)
@@ -66,7 +66,7 @@ typedef struct reg_info_def
 
 extern varray_type reg_n_info;
 
-extern regset_head subregs_of_mode [NUM_MACHINE_MODES];
+extern bitmap_head subregs_of_mode;
 
 /* Indexed by n, gives number of times (REG n) is used or set.  */
 
index b90edcba5a8199df06530aba14dd365bfb27dc7c..ef0ac60ded7fc2f6838b2dded0725cfbf0d393df 100644 (file)
@@ -3458,7 +3458,9 @@ rest_of_compilation (decl)
 #endif
 
   /* If optimizing, then go ahead and split insns now.  */
+#ifndef STACK_REGS
   if (optimize > 0)
+#endif
     split_all_insns (0);
 
   cleanup_cfg (optimize ? CLEANUP_EXPENSIVE : 0);
@@ -3551,10 +3553,6 @@ rest_of_compilation (decl)
       close_dump_file (DFI_ce3, print_rtl_with_bb, insns);
       timevar_pop (TV_IFCVT2);
     }
-#ifdef STACK_REGS
-  if (optimize)
-    split_all_insns (1);
-#endif
 
 #ifdef INSN_SCHEDULING
   if (optimize > 0 && flag_schedule_insns_after_reload)