aboutsummaryrefslogtreecommitdiff
path: root/gcc/resource.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2019-09-09 17:59:25 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2019-09-09 17:59:25 +0000
commitd15e5131845e2a68513230a624839ef5abcda690 (patch)
treeef0379a5c245addad8d4072f885d6fc06dae2fd5 /gcc/resource.c
parent44942965f4eae141bd1f8300e7f77d0c9a3936e4 (diff)
downloadgcc-d15e5131845e2a68513230a624839ef5abcda690.zip
gcc-d15e5131845e2a68513230a624839ef5abcda690.tar.gz
gcc-d15e5131845e2a68513230a624839ef5abcda690.tar.bz2
Remove AND_COMPL_HARD_REG_SET
Use "x &= ~y" instead of "AND_COMPL_HARD_REG_SET (x, y)", or just "x & ~y" if the result is a temporary. This means that we're splitting it into two operations, but the compiler should be able to combine them for reasonable values of FIRST_PSEUDO_REGISTER. 2019-09-09 Richard Sandiford <richard.sandiford@arm.com> gcc/ * hard-reg-set.h (AND_COMPL_HARD_REG_SET): Delete. * caller-save.c (setup_save_areas): Use "&~" instead of AND_COMPL_HARD_REG_SET. (save_call_clobbered_regs): Likewise. * config/epiphany/epiphany.c (epiphany_conditional_register_usage): Likewise. * config/frv/frv.c (frv_ifcvt_modify_tests): Likewise. * config/gcn/gcn.c (gcn_md_reorg): Likewise. * config/i386/i386.c (ix86_conditional_register_usage): Likewise. * config/mips/mips.c (mips_class_max_nregs): Likewise. (mips_conditional_register_usage): Likewise. * config/sh/sh.c (output_stack_adjust): Likewise. * ira-color.c (form_allocno_hard_regs_nodes_forest): Likewise. (setup_profitable_hard_regs): Likewise. (get_conflict_and_start_profitable_regs): Likewise. * ira-conflicts.c (print_allocno_conflicts): Likewise. (ira_build_conflicts): Likewise. * ira-costs.c (restrict_cost_classes): Likewise. (setup_regno_cost_classes_by_aclass): Likewise. * ira-lives.c (process_bb_node_lives): Likewise. * ira.c (setup_class_hard_regs, setup_reg_subclasses): Likewise. (setup_class_subset_and_memory_move_costs, setup_pressure_classes) (setup_allocno_and_important_classes, setup_class_translate_array) (setup_reg_class_relations, setup_prohibited_class_mode_regs): Likewise. * lra-assigns.c (find_hard_regno_for_1): Likewise. * lra-constraints.c (prohibited_class_reg_set_mode_p): Likewise. (process_alt_operands, inherit_in_ebb): Likewise. * lra-eliminations.c (update_reg_eliminate): Likewise. * lra-lives.c (process_bb_lives): Likewise. * reload1.c (update_eliminables_and_spill, reload_as_needed): Likewise. * resource.c (find_dead_or_set_registers): Likewise. (mark_target_live_regs): Likewise. * sched-deps.c (get_implicit_reg_pending_clobbers): Likewise. * sel-sched.c (mark_unavailable_hard_regs): Likewise. (implicit_clobber_conflict_p): Likewise. * shrink-wrap.c (requires_stack_frame_p): Likewise. (try_shrink_wrapping): Likewise. From-SVN: r275532
Diffstat (limited to 'gcc/resource.c')
-rw-r--r--gcc/resource.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/gcc/resource.c b/gcc/resource.c
index f13956b..2d30e08 100644
--- a/gcc/resource.c
+++ b/gcc/resource.c
@@ -450,8 +450,8 @@ find_dead_or_set_registers (rtx_insn *target, struct resources *res,
case CODE_LABEL:
/* After a label, any pending dead registers that weren't yet
used can be made dead. */
- AND_COMPL_HARD_REG_SET (pending_dead_regs, needed.regs);
- AND_COMPL_HARD_REG_SET (res->regs, pending_dead_regs);
+ pending_dead_regs &= ~needed.regs;
+ res->regs &= ~pending_dead_regs;
CLEAR_HARD_REG_SET (pending_dead_regs);
continue;
@@ -565,14 +565,12 @@ find_dead_or_set_registers (rtx_insn *target, struct resources *res,
}
target_res = *res;
- scratch = target_set.regs;
- AND_COMPL_HARD_REG_SET (scratch, needed.regs);
- AND_COMPL_HARD_REG_SET (target_res.regs, scratch);
+ scratch = target_set.regs & ~needed.regs;
+ target_res.regs &= ~scratch;
fallthrough_res = *res;
- scratch = set.regs;
- AND_COMPL_HARD_REG_SET (scratch, needed.regs);
- AND_COMPL_HARD_REG_SET (fallthrough_res.regs, scratch);
+ scratch = set.regs & ~needed.regs;
+ fallthrough_res.regs &= ~scratch;
if (!ANY_RETURN_P (this_jump_insn->jump_label ()))
find_dead_or_set_registers
@@ -601,9 +599,8 @@ find_dead_or_set_registers (rtx_insn *target, struct resources *res,
mark_referenced_resources (insn, &needed, true);
mark_set_resources (insn, &set, 0, MARK_SRC_DEST_CALL);
- scratch = set.regs;
- AND_COMPL_HARD_REG_SET (scratch, needed.regs);
- AND_COMPL_HARD_REG_SET (res->regs, scratch);
+ scratch = set.regs & ~needed.regs;
+ res->regs &= ~scratch;
}
return jump_insn;
@@ -1048,8 +1045,7 @@ mark_target_live_regs (rtx_insn *insns, rtx target_maybe_return, struct resource
/* CALL clobbers all call-used regs that aren't fixed except
sp, ap, and fp. Do this before setting the result of the
call live. */
- AND_COMPL_HARD_REG_SET (current_live_regs,
- regs_invalidated_by_this_call);
+ current_live_regs &= ~regs_invalidated_by_this_call;
}
/* A CALL_INSN sets any global register live, since it may
@@ -1097,7 +1093,7 @@ mark_target_live_regs (rtx_insn *insns, rtx target_maybe_return, struct resource
/* A label clobbers the pending dead registers since neither
reload nor jump will propagate a value across a label. */
- AND_COMPL_HARD_REG_SET (current_live_regs, pending_dead_regs);
+ current_live_regs &= ~pending_dead_regs;
CLEAR_HARD_REG_SET (pending_dead_regs);
/* We must conservatively assume that all registers that used
@@ -1160,8 +1156,7 @@ mark_target_live_regs (rtx_insn *insns, rtx target_maybe_return, struct resource
{
mark_referenced_resources (insn, &needed, true);
- scratch = needed.regs;
- AND_COMPL_HARD_REG_SET (scratch, set.regs);
+ scratch = needed.regs & ~set.regs;
new_resources.regs |= scratch;
mark_set_resources (insn, &set, 0, MARK_SRC_DEST_CALL);