aboutsummaryrefslogtreecommitdiff
path: root/gcc/cselib.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2019-10-01 08:55:50 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2019-10-01 08:55:50 +0000
commit17d184e5c4896264c27c27d125a6c1f8462d9d37 (patch)
tree1dca9c9172cc83f10975cf111475bbf1c2327df6 /gcc/cselib.c
parentbb6ce448fc194cca8e51aea274a1b2408c7746c3 (diff)
downloadgcc-17d184e5c4896264c27c27d125a6c1f8462d9d37.zip
gcc-17d184e5c4896264c27c27d125a6c1f8462d9d37.tar.gz
gcc-17d184e5c4896264c27c27d125a6c1f8462d9d37.tar.bz2
Remove clobber_high
The AArch64 SVE tlsdesc patterns were the main motivating reason for clobber_high. It's no longer needed now that the patterns use calls instead. At the time, one of the possible future uses for clobber_high was for asm statements. However, the current code wouldn't handle that case without modification, so I think we might as well remove it for now. We can always reapply it in future if it turns out to be useful again. 2019-10-01 Richard Sandiford <richard.sandiford@arm.com> gcc/ * rtl.def (CLOBBER_HIGH): Delete. * doc/rtl.texi (clobber_high): Remove documentation. * rtl.h (SET_DEST): Remove CLOBBER_HIGH from the list of codes. (reg_is_clobbered_by_clobber_high): Delete. (gen_hard_reg_clobber_high): Likewise. * alias.c (record_set): Remove CLOBBER_HIGH handling. * cfgexpand.c (expand_gimple_stmt): Likewise. * combine-stack-adj.c (single_set_for_csa): Likewise. * combine.c (find_single_use_1, set_nonzero_bits_and_sign_copies) (can_combine_p, is_parallel_of_n_reg_sets, try_combine) (record_dead_and_set_regs_1, reg_dead_at_p_1): Likewise. * cse.c (invalidate_reg): Remove clobber_high parameter. (invalidate): Update call accordingly. (canonicalize_insn): Remove CLOBBER_HIGH handling. (invalidate_from_clobbers, invalidate_from_sets_and_clobbers) (count_reg_usage, insn_live_p): Likewise. * cselib.h (cselib_invalidate_rtx): Remove sett argument. * cselib.c (cselib_invalidate_regno, cselib_invalidate_rtx): Likewise. (cselib_invalidate_rtx_note_stores): Update call accordingly. (cselib_expand_value_rtx_1): Remove CLOBBER_HIGH handling. (cselib_invalidate_regno, cselib_process_insn): Likewise. * dce.c (deletable_insn_p, mark_nonreg_stores_1): Likewise. (mark_nonreg_stores_2): Likewise. * df-scan.c (df_find_hard_reg_defs, df_uses_record): Likewise. (df_get_call_refs): Likewise. * dwarf2out.c (mem_loc_descriptor): Likewise. * emit-rtl.c (verify_rtx_sharing): Likewise. (copy_insn_1, copy_rtx_if_shared_1): Likewise. (hard_reg_clobbers_high, gen_hard_reg_clobber_high): Delete. * genconfig.c (walk_insn_part): Remove CLOBBER_HIGH handling. * genemit.c (gen_exp, gen_insn): Likewise. * genrecog.c (validate_pattern, remove_clobbers): Likewise. * haifa-sched.c (haifa_classify_rtx): Likewise. * ira-build.c (create_insn_allocnos): Likewise. * ira-costs.c (scan_one_insn): Likewise. * ira.c (equiv_init_movable_p, memref_referenced_p): Likewise. (rtx_moveable_p, interesting_dest_for_shprep): Likewise. * jump.c (mark_jump_label_1): Likewise. * lra-int.h (lra_insn_reg::clobber_high): Delete. * lra-eliminations.c (lra_eliminate_regs_1): Remove CLOBBER_HIGH handling. (mark_not_eliminable): Likewise. * lra-lives.c (process_bb_lives): Likewise. * lra.c (new_insn_reg): Remove clobber_high parameter. (collect_non_operand_hard_regs): Likewise. Update call to new insn_reg. Remove CLOBBER_HIGH handling. (lra_set_insn_recog_data): Remove CLOBBER_HIGH handling. Update call to collect_non_operand_hard_regs. (add_regs_to_insn_regno_info): Remove CLOBBER_HIGH handling. Update call to new_insn_reg. (lra_update_insn_regno_info): Remove CLOBBER_HIGH handling. * postreload.c (reload_cse_simplify, reload_combine_note_use) (move2add_note_store): Likewise. * print-rtl.c (print_pattern): Likewise. * recog.c (store_data_bypass_p_1, store_data_bypass_p): Likewise. (if_test_bypass_p): Likewise. * regcprop.c (kill_clobbered_value, kill_set_value): Likewise. * reginfo.c (reg_scan_mark_refs): Likewise. * reload1.c (maybe_fix_stack_asms, eliminate_regs_1): Likewise. (elimination_effects, mark_not_eliminable, scan_paradoxical_subregs) (forget_old_reloads_1): Likewise. * reorg.c (find_end_label, try_merge_delay_insns, redundant_insn) (own_thread_p, fill_simple_delay_slots, fill_slots_from_thread) (dbr_schedule): Likewise. * resource.c (update_live_status, mark_referenced_resources) (mark_set_resources): Likewise. * rtl.c (copy_rtx): Likewise. * rtlanal.c (reg_referenced_p, set_of_1, single_set_2, noop_move_p) (note_pattern_stores): Likewise. (reg_is_clobbered_by_clobber_high): Delete. * sched-deps.c (sched_analyze_reg, sched_analyze_insn): Remove CLOBBER_HIGH handling. From-SVN: r276393
Diffstat (limited to 'gcc/cselib.c')
-rw-r--r--gcc/cselib.c41
1 files changed, 10 insertions, 31 deletions
diff --git a/gcc/cselib.c b/gcc/cselib.c
index 36f649d..500793b 100644
--- a/gcc/cselib.c
+++ b/gcc/cselib.c
@@ -55,8 +55,7 @@ static unsigned int cselib_hash_rtx (rtx, int, machine_mode);
static cselib_val *new_cselib_val (unsigned int, machine_mode, rtx);
static void add_mem_for_addr (cselib_val *, cselib_val *, rtx);
static cselib_val *cselib_lookup_mem (rtx, int);
-static void cselib_invalidate_regno (unsigned int, machine_mode,
- const_rtx = NULL);
+static void cselib_invalidate_regno (unsigned int, machine_mode);
static void cselib_invalidate_mem (rtx);
static void cselib_record_set (rtx, cselib_val *, cselib_val *);
static void cselib_record_sets (rtx_insn *);
@@ -1663,7 +1662,6 @@ cselib_expand_value_rtx_1 (rtx orig, struct expand_value_data *evd,
/* SCRATCH must be shared because they represent distinct values. */
return orig;
case CLOBBER:
- case CLOBBER_HIGH:
if (REG_P (XEXP (orig, 0)) && HARD_REGISTER_NUM_P (REGNO (XEXP (orig, 0))))
return orig;
break;
@@ -2166,8 +2164,7 @@ cselib_lookup (rtx x, machine_mode mode,
invalidating call clobbered registers across a call. */
static void
-cselib_invalidate_regno (unsigned int regno, machine_mode mode,
- const_rtx setter)
+cselib_invalidate_regno (unsigned int regno, machine_mode mode)
{
unsigned int endregno;
unsigned int i;
@@ -2190,9 +2187,6 @@ cselib_invalidate_regno (unsigned int regno, machine_mode mode,
i = regno - max_value_regs;
endregno = end_hard_regno (mode, regno);
-
- if (setter && GET_CODE (setter) == CLOBBER_HIGH)
- gcc_assert (endregno == regno + 1);
}
else
{
@@ -2225,19 +2219,6 @@ cselib_invalidate_regno (unsigned int regno, machine_mode mode,
continue;
}
- /* Ignore if clobber high and the register isn't clobbered. */
- if (setter && GET_CODE (setter) == CLOBBER_HIGH)
- {
- gcc_assert (endregno == regno + 1);
- const_rtx x = XEXP (setter, 0);
- if (!reg_is_clobbered_by_clobber_high (i, GET_MODE (v->val_rtx),
- x))
- {
- l = &(*l)->next;
- continue;
- }
- }
-
/* We have an overlap. */
if (*l == REG_VALUES (i))
{
@@ -2372,10 +2353,10 @@ cselib_invalidate_mem (rtx mem_rtx)
*vp = &dummy_val;
}
-/* Invalidate DEST, which is being assigned to or clobbered by SETTER. */
+/* Invalidate DEST. */
void
-cselib_invalidate_rtx (rtx dest, const_rtx setter)
+cselib_invalidate_rtx (rtx dest)
{
while (GET_CODE (dest) == SUBREG
|| GET_CODE (dest) == ZERO_EXTRACT
@@ -2383,7 +2364,7 @@ cselib_invalidate_rtx (rtx dest, const_rtx setter)
dest = XEXP (dest, 0);
if (REG_P (dest))
- cselib_invalidate_regno (REGNO (dest), GET_MODE (dest), setter);
+ cselib_invalidate_regno (REGNO (dest), GET_MODE (dest));
else if (MEM_P (dest))
cselib_invalidate_mem (dest);
}
@@ -2391,10 +2372,10 @@ cselib_invalidate_rtx (rtx dest, const_rtx setter)
/* A wrapper for cselib_invalidate_rtx to be called via note_stores. */
static void
-cselib_invalidate_rtx_note_stores (rtx dest, const_rtx setter,
+cselib_invalidate_rtx_note_stores (rtx dest, const_rtx,
void *data ATTRIBUTE_UNUSED)
{
- cselib_invalidate_rtx (dest, setter);
+ cselib_invalidate_rtx (dest);
}
/* Record the result of a SET instruction. DEST is being set; the source
@@ -2809,11 +2790,9 @@ cselib_process_insn (rtx_insn *insn)
if (CALL_P (insn))
{
for (x = CALL_INSN_FUNCTION_USAGE (insn); x; x = XEXP (x, 1))
- {
- gcc_assert (GET_CODE (XEXP (x, 0)) != CLOBBER_HIGH);
- if (GET_CODE (XEXP (x, 0)) == CLOBBER)
- cselib_invalidate_rtx (XEXP (XEXP (x, 0), 0));
- }
+ if (GET_CODE (XEXP (x, 0)) == CLOBBER)
+ cselib_invalidate_rtx (XEXP (XEXP (x, 0), 0));
+
/* Flush everything on setjmp. */
if (cselib_preserve_constants
&& find_reg_note (insn, REG_SETJMP, NULL))