Remove IOR_COMPL_HARD_REG_SET
authorRichard Sandiford <richard.sandiford@arm.com>
Mon, 9 Sep 2019 17:59:29 +0000 (17:59 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Mon, 9 Sep 2019 17:59:29 +0000 (17:59 +0000)
Use "x |= ~y" instead of "IOR_COMPL_HARD_REG_SET (x, y)", or just
"x | ~y" if the result is a temporary.

2019-09-09  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* hard-reg-set.h (IOR_COMPL_HARD_REG_SET): Delete.
* config/aarch64/cortex-a57-fma-steering.c (rename_single_chain):
Use "|~" instead of IOR_COMPL_HARD_REG_SET.
* config/aarch64/falkor-tag-collision-avoidance.c (init_unavailable):
Likewise.
* ira-build.c (ira_create_object, ira_set_allocno_class): Likewise.
* ira.c (setup_reg_renumber): Likewise.
* lra-assigns.c (find_hard_regno_for_1): Likewise.
* regrename.c (regrename_find_superclass): Likewise.
* reload1.c (find_reg): Likewise.

From-SVN: r275533

gcc/ChangeLog
gcc/config/aarch64/cortex-a57-fma-steering.c
gcc/config/aarch64/falkor-tag-collision-avoidance.c
gcc/hard-reg-set.h
gcc/ira-build.c
gcc/ira.c
gcc/lra-assigns.c
gcc/regrename.c
gcc/reload1.c

index 1fc84aee644d6bda2ec616d6484cfadc10748b5a..5a97cb9e61af341969946dd069bd76337d8ef99b 100644 (file)
@@ -1,3 +1,16 @@
+2019-09-09  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * hard-reg-set.h (IOR_COMPL_HARD_REG_SET): Delete.
+       * config/aarch64/cortex-a57-fma-steering.c (rename_single_chain):
+       Use "|~" instead of IOR_COMPL_HARD_REG_SET.
+       * config/aarch64/falkor-tag-collision-avoidance.c (init_unavailable):
+       Likewise.
+       * ira-build.c (ira_create_object, ira_set_allocno_class): Likewise.
+       * ira.c (setup_reg_renumber): Likewise.
+       * lra-assigns.c (find_hard_regno_for_1): Likewise.
+       * regrename.c (regrename_find_superclass): Likewise.
+       * reload1.c (find_reg): Likewise.
+
 2019-09-09  Richard Sandiford  <richard.sandiford@arm.com>
 
        * hard-reg-set.h (AND_COMPL_HARD_REG_SET): Delete.
index eb91662b688cb5013f156aaf84ee7cc91d18c00f..3e890ad3de6a5b5e4145a8d874149982313b92a8 100644 (file)
@@ -267,7 +267,7 @@ rename_single_chain (du_head_p head, HARD_REG_SET *unavailable)
       if (DEBUG_INSN_P (tmp->insn))
        continue;
       n_uses++;
-      IOR_COMPL_HARD_REG_SET (*unavailable, reg_class_contents[tmp->cl]);
+      *unavailable |= ~reg_class_contents[tmp->cl];
       super_class = reg_class_superunion[(int) super_class][(int) tmp->cl];
     }
 
index 779dee81f7f4ed3d3ae1fc11f232fc558027b9fe..9faed40403c3639486119a392467f2ad7362a60c 100644 (file)
@@ -229,7 +229,7 @@ init_unavailable (tag_insn_info *insn_info, tag_map_t &tag_map, du_head_p head,
       if (DEBUG_INSN_P (tmp->insn))
        continue;
 
-      IOR_COMPL_HARD_REG_SET (*unavailable, reg_class_contents[tmp->cl]);
+      *unavailable |= ~reg_class_contents[tmp->cl];
       super_class = reg_class_superunion[(int) super_class][(int) tmp->cl];
     }
 
index 7d41162c4959a0b9665a4065ad28f440b20c7a24..793b8699c36b227e66e72e6b57ad3a29587f66fa 100644 (file)
@@ -126,11 +126,6 @@ struct hard_reg_set_container
    CLEAR_HARD_REG_SET and SET_HARD_REG_SET.
    These take just one argument.
 
-   Also define:
-   IOR_COMPL_HARD_REG_SET
-   This takes two arguments TO and FROM; it reads from FROM
-   and combines its complement bitwise into TO.
-
    Also define:
 
    hard_reg_set_subset_p (X, Y), which returns true if X is a subset of Y.
@@ -152,8 +147,6 @@ struct hard_reg_set_container
 #define CLEAR_HARD_REG_SET(TO) ((TO) = HARD_CONST (0))
 #define SET_HARD_REG_SET(TO) ((TO) = ~ HARD_CONST (0))
 
-#define IOR_COMPL_HARD_REG_SET(TO, FROM) ((TO) |= ~ (FROM))
-
 static inline bool
 hard_reg_set_subset_p (const_hard_reg_set x, const_hard_reg_set y)
 {
@@ -215,13 +208,6 @@ SET_HARD_REG_SET (HARD_REG_SET &set)
     set.elts[i] = -1;
 }
 
-inline void
-IOR_COMPL_HARD_REG_SET (HARD_REG_SET &to, const_hard_reg_set from)
-{
-  for (unsigned int i = 0; i < ARRAY_SIZE (to.elts); ++i)
-    to.elts[i] |= ~from.elts[i];
-}
-
 static inline bool
 hard_reg_set_subset_p (const_hard_reg_set x, const_hard_reg_set y)
 {
index 354f989e563a03944fa9071c4c098ac217317e7c..3170d7d16891a36364ad0fbb1cee3fe272ccc7d5 100644 (file)
@@ -458,10 +458,8 @@ ira_create_object (ira_allocno_t a, int subword)
   OBJECT_NUM_CONFLICTS (obj) = 0;
   OBJECT_CONFLICT_HARD_REGS (obj) = ira_no_alloc_regs;
   OBJECT_TOTAL_CONFLICT_HARD_REGS (obj) = ira_no_alloc_regs;
-  IOR_COMPL_HARD_REG_SET (OBJECT_CONFLICT_HARD_REGS (obj),
-                         reg_class_contents[aclass]);
-  IOR_COMPL_HARD_REG_SET (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj),
-                         reg_class_contents[aclass]);
+  OBJECT_CONFLICT_HARD_REGS (obj) |= ~reg_class_contents[aclass];
+  OBJECT_TOTAL_CONFLICT_HARD_REGS (obj) |= ~reg_class_contents[aclass];
   OBJECT_MIN (obj) = INT_MAX;
   OBJECT_MAX (obj) = -1;
   OBJECT_LIVE_RANGES (obj) = NULL;
@@ -549,10 +547,8 @@ ira_set_allocno_class (ira_allocno_t a, enum reg_class aclass)
   ALLOCNO_CLASS (a) = aclass;
   FOR_EACH_ALLOCNO_OBJECT (a, obj, oi)
     {
-      IOR_COMPL_HARD_REG_SET (OBJECT_CONFLICT_HARD_REGS (obj),
-                             reg_class_contents[aclass]);
-      IOR_COMPL_HARD_REG_SET (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj),
-                             reg_class_contents[aclass]);
+      OBJECT_CONFLICT_HARD_REGS (obj) |= ~reg_class_contents[aclass];
+      OBJECT_TOTAL_CONFLICT_HARD_REGS (obj) |= ~reg_class_contents[aclass];
     }
 }
 
index 7926ae09db99befc0ed8919a541d6849353a6140..344275a24a852461c4596643bb916ea2938a098e 100644 (file)
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -2370,8 +2370,8 @@ setup_reg_renumber (void)
          for (i = 0; i < nwords; i++)
            {
              obj = ALLOCNO_OBJECT (a, i);
-             IOR_COMPL_HARD_REG_SET (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj),
-                                     reg_class_contents[pclass]);
+             OBJECT_TOTAL_CONFLICT_HARD_REGS (obj)
+               |= ~reg_class_contents[pclass];
            }
          if (ALLOCNO_CALLS_CROSSED_NUM (a) != 0
              && ira_hard_reg_set_intersection_p (hard_regno, ALLOCNO_MODE (a),
index c2244f575101f714e41164faa48d7e367eb6067e..0a34ea921d0f4f014b72a1ca2475936aca73024b 100644 (file)
@@ -611,7 +611,7 @@ find_hard_regno_for_1 (int regno, int *cost, int try_only_hard_regno,
       }
   /* Make sure that all registers in a multi-word pseudo belong to the
      required class.  */
-  IOR_COMPL_HARD_REG_SET (conflict_set, reg_class_contents[rclass]);
+  conflict_set |= ~reg_class_contents[rclass];
   lra_assert (rclass != NO_REGS);
   rclass_size = ira_class_hard_regs_num[rclass];
   best_hard_regno = -1;
index c28023ea72d986ffc63ae7389d1c702901a971d1..d83e1e92d2577b7712b83a83115725cf56c79e52 100644 (file)
@@ -441,8 +441,7 @@ regrename_find_superclass (du_head_p head, int *pn_uses,
       if (DEBUG_INSN_P (tmp->insn))
        continue;
       n_uses++;
-      IOR_COMPL_HARD_REG_SET (*punavailable,
-                             reg_class_contents[tmp->cl]);
+      *punavailable |= ~reg_class_contents[tmp->cl];
       super_class
        = reg_class_superunion[(int) super_class][(int) tmp->cl];
     }
index 90cee06773bc4c761cae11799cc3505cd417a5a4..3c23e6e5eedb85d7367060839381a0e078da8825 100644 (file)
@@ -1823,8 +1823,9 @@ find_reg (class insn_chain *chain, int order)
   static int regno_pseudo_regs[FIRST_PSEUDO_REGISTER];
   static int best_regno_pseudo_regs[FIRST_PSEUDO_REGISTER];
 
-  not_usable = bad_spill_regs | bad_spill_regs_global;
-  IOR_COMPL_HARD_REG_SET (not_usable, reg_class_contents[rl->rclass]);
+  not_usable = (bad_spill_regs
+               | bad_spill_regs_global
+               | ~reg_class_contents[rl->rclass]);
 
   CLEAR_HARD_REG_SET (used_by_other_reload);
   for (k = 0; k < order; k++)