Use "x == y" instead of "hard_reg_set_equal_p (x, y)".
2019-09-09 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* hard-reg-set.h (HARD_REG_SET::operator==): New function.
(HARD_REG_SET::operator!=): Likewise.
(hard_reg_set_equal_p): Delete.
* cfgcleanup.c (old_insns_match_p): Use == instead of
hard_reg_set_equal_p and != instead of !hard_reg_set_equal_p.
* ira-color.c (allocno_hard_regs_hasher::equal): Likewise.
(add_allocno_hard_regs_to_forest): Likewise.
(setup_allocno_available_regs_num): Likewise.
* ira.c (setup_pressure_classes): Likewise.
(setup_allocno_and_important_classes): Likewise.
(setup_reg_class_relations): Likewise.
* lra-lives.c (process_bb_lives): Likewise.
* reg-stack.c (change_stack, convert_regs_1): Likewise.
From-SVN: r275534
+2019-09-09 Richard Sandiford <richard.sandiford@arm.com>
+
+ * hard-reg-set.h (HARD_REG_SET::operator==): New function.
+ (HARD_REG_SET::operator!=): Likewise.
+ (hard_reg_set_equal_p): Delete.
+ * cfgcleanup.c (old_insns_match_p): Use == instead of
+ hard_reg_set_equal_p and != instead of !hard_reg_set_equal_p.
+ * ira-color.c (allocno_hard_regs_hasher::equal): Likewise.
+ (add_allocno_hard_regs_to_forest): Likewise.
+ (setup_allocno_available_regs_num): Likewise.
+ * ira.c (setup_pressure_classes): Likewise.
+ (setup_allocno_and_important_classes): Likewise.
+ (setup_reg_class_relations): Likewise.
+ * lra-lives.c (process_bb_lives): Likewise.
+ * reg-stack.c (change_stack, convert_regs_1): Likewise.
+
2019-09-09 Richard Sandiford <richard.sandiford@arm.com>
* hard-reg-set.h (IOR_COMPL_HARD_REG_SET): Delete.
get_call_reg_set_usage (i1, &i1_used, call_used_reg_set);
get_call_reg_set_usage (i2, &i2_used, call_used_reg_set);
- if (!hard_reg_set_equal_p (i1_used, i2_used))
+ if (i1_used != i2_used)
return dir_none;
}
if (REG_NOTE_KIND (note) == REG_DEAD && STACK_REG_P (XEXP (note, 0)))
SET_HARD_REG_BIT (i2_regset, REGNO (XEXP (note, 0)));
- if (!hard_reg_set_equal_p (i1_regset, i2_regset))
+ if (i1_regset != i2_regset)
return dir_none;
}
#endif
return *this;
}
+ bool
+ operator== (const HARD_REG_SET &other) const
+ {
+ HARD_REG_ELT_TYPE bad = 0;
+ for (unsigned int i = 0; i < ARRAY_SIZE (elts); ++i)
+ bad |= (elts[i] ^ other.elts[i]);
+ return bad == 0;
+ }
+
+ bool
+ operator!= (const HARD_REG_SET &other) const
+ {
+ return !operator== (other);
+ }
+
HARD_REG_ELT_TYPE elts[HARD_REG_SET_LONGS];
};
typedef const HARD_REG_SET &const_hard_reg_set;
Also define:
hard_reg_set_subset_p (X, Y), which returns true if X is a subset of Y.
- hard_reg_set_equal_p (X, Y), which returns true if X and Y are equal.
hard_reg_set_intersect_p (X, Y), which returns true if X and Y intersect.
hard_reg_set_empty_p (X), which returns true if X is empty. */
return (x & ~y) == HARD_CONST (0);
}
-static inline bool
-hard_reg_set_equal_p (const_hard_reg_set x, const_hard_reg_set y)
-{
- return x == y;
-}
-
static inline bool
hard_reg_set_intersect_p (const_hard_reg_set x, const_hard_reg_set y)
{
return bad == 0;
}
-static inline bool
-hard_reg_set_equal_p (const_hard_reg_set x, const_hard_reg_set y)
-{
- HARD_REG_ELT_TYPE bad = 0;
- for (unsigned int i = 0; i < ARRAY_SIZE (x.elts); ++i)
- bad |= (x.elts[i] ^ y.elts[i]);
- return bad == 0;
-}
-
static inline bool
hard_reg_set_intersect_p (const_hard_reg_set x, const_hard_reg_set y)
{
allocno_hard_regs_hasher::equal (const allocno_hard_regs *hv1,
const allocno_hard_regs *hv2)
{
- return hard_reg_set_equal_p (hv1->set, hv2->set);
+ return hv1->set == hv2->set;
}
/* Hash table of unique allocno hard registers. */
start = hard_regs_node_vec.length ();
for (node = *roots; node != NULL; node = node->next)
{
- if (hard_reg_set_equal_p (hv->set, node->hard_regs->set))
+ if (hv->set == node->hard_regs->set)
return;
if (hard_reg_set_subset_p (hv->set, node->hard_regs->set))
{
reg_class_names[aclass], ira_class_hard_regs_num[aclass], n);
print_hard_reg_set (ira_dump_file, data->profitable_hard_regs, false);
fprintf (ira_dump_file, ", %snode: ",
- hard_reg_set_equal_p (data->profitable_hard_regs,
- data->hard_regs_node->hard_regs->set)
+ data->profitable_hard_regs == data->hard_regs_node->hard_regs->set
? "" : "^");
print_hard_reg_set (ira_dump_file,
data->hard_regs_node->hard_regs->set, false);
temp_hard_regset2 = (reg_class_contents[cl2]
& ~no_unit_alloc_regs);
if (hard_reg_set_subset_p (temp_hard_regset, temp_hard_regset2)
- && (! hard_reg_set_equal_p (temp_hard_regset,
- temp_hard_regset2)
+ && (temp_hard_regset != temp_hard_regset2
|| cl2 == (int) GENERAL_REGS))
{
pressure_classes[curr++] = (enum reg_class) cl2;
continue;
}
if (hard_reg_set_subset_p (temp_hard_regset2, temp_hard_regset)
- && (! hard_reg_set_equal_p (temp_hard_regset2,
- temp_hard_regset)
+ && (temp_hard_regset2 != temp_hard_regset
|| cl == (int) GENERAL_REGS))
continue;
- if (hard_reg_set_equal_p (temp_hard_regset2, temp_hard_regset))
+ if (temp_hard_regset2 == temp_hard_regset)
insert_p = false;
pressure_classes[curr++] = (enum reg_class) cl2;
}
{
cl = classes[j];
temp_hard_regset2 = reg_class_contents[cl] & ~no_unit_alloc_regs;
- if (hard_reg_set_equal_p (temp_hard_regset,
- temp_hard_regset2))
+ if (temp_hard_regset == temp_hard_regset2)
break;
}
if (j >= n || targetm.additional_allocno_class_p (i))
the same, prefer GENERAL_REGS or the
smallest class for debugging
purposes. */
- || (hard_reg_set_equal_p (temp_hard_regset, temp_set2)
+ || (temp_hard_regset == temp_set2
&& (cl3 == GENERAL_REGS
|| ((ira_reg_class_intersect[cl1][cl2]
!= GENERAL_REGS)
if (! hard_reg_set_subset_p (temp_hard_regset, temp_set2)
/* Ignore unavailable hard registers and prefer
smallest class for debugging purposes. */
- || (hard_reg_set_equal_p (temp_hard_regset, temp_set2)
+ || (temp_hard_regset == temp_set2
&& hard_reg_set_subset_p
(reg_class_contents[cl3],
reg_class_contents
if (ira_reg_class_subunion[cl1][cl2] == NO_REGS
|| (hard_reg_set_subset_p (temp_set2, temp_hard_regset)
- && (! hard_reg_set_equal_p (temp_set2,
- temp_hard_regset)
+ && (temp_set2 != temp_hard_regset
|| cl3 == GENERAL_REGS
/* If the allocatable hard register sets are the
same, prefer GENERAL_REGS or the smallest
if (ira_reg_class_superunion[cl1][cl2] == NO_REGS
|| (hard_reg_set_subset_p (temp_hard_regset, temp_set2)
- && (! hard_reg_set_equal_p (temp_set2,
- temp_hard_regset)
+ && (temp_set2 != temp_hard_regset
|| cl3 == GENERAL_REGS
/* If the allocatable hard register sets are the
same, prefer GENERAL_REGS or the smallest
call_used_reg_set);
bool flush = (! hard_reg_set_empty_p (last_call_used_reg_set)
- && ( ! hard_reg_set_equal_p (last_call_used_reg_set,
- this_call_used_reg_set)))
+ && (last_call_used_reg_set
+ != this_call_used_reg_set))
|| (last_call_insn && ! calls_have_same_clobbers_p
(call_insn,
last_call_insn));
/* By now, the only difference should be the order of the stack,
not their depth or liveliness. */
- gcc_assert (hard_reg_set_equal_p (old->reg_set, new_stack->reg_set));
+ gcc_assert (old->reg_set == new_stack->reg_set);
gcc_assert (old->top == new_stack->top);
/* If the stack is not empty (new_stack->top != -1), loop here emitting
asms, we zapped the instruction itself, but that didn't produce the
same pattern of register kills as before. */
- gcc_assert (hard_reg_set_equal_p (regstack.reg_set, bi->out_reg_set)
- || any_malformed_asm);
+ gcc_assert (regstack.reg_set == bi->out_reg_set || any_malformed_asm);
bi->stack_out = regstack;
bi->done = true;