diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2019-10-01 08:55:50 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2019-10-01 08:55:50 +0000 |
commit | 17d184e5c4896264c27c27d125a6c1f8462d9d37 (patch) | |
tree | 1dca9c9172cc83f10975cf111475bbf1c2327df6 /gcc/cse.c | |
parent | bb6ce448fc194cca8e51aea274a1b2408c7746c3 (diff) | |
download | gcc-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/cse.c')
-rw-r--r-- | gcc/cse.c | 69 |
1 files changed, 10 insertions, 59 deletions
@@ -561,7 +561,6 @@ static struct table_elt *insert_with_costs (rtx, struct table_elt *, unsigned, static struct table_elt *insert (rtx, struct table_elt *, unsigned, machine_mode); static void merge_equiv_classes (struct table_elt *, struct table_elt *); -static void invalidate_reg (rtx, bool); static void invalidate (rtx, machine_mode); static void remove_invalid_refs (unsigned int); static void remove_invalid_subreg_refs (unsigned int, poly_uint64, @@ -1822,12 +1821,10 @@ check_dependence (const_rtx x, rtx exp, machine_mode mode, rtx addr) } /* Remove from the hash table, or mark as invalid, all expressions whose - values could be altered by storing in register X. - - CLOBBER_HIGH is set if X was part of a CLOBBER_HIGH expression. */ + values could be altered by storing in register X. */ static void -invalidate_reg (rtx x, bool clobber_high) +invalidate_reg (rtx x) { gcc_assert (GET_CODE (x) == REG); @@ -1852,10 +1849,7 @@ invalidate_reg (rtx x, bool clobber_high) SUBREG_TICKED (regno) = -1; if (regno >= FIRST_PSEUDO_REGISTER) - { - gcc_assert (!clobber_high); - remove_pseudo_from_table (x, hash); - } + remove_pseudo_from_table (x, hash); else { HOST_WIDE_INT in_table = TEST_HARD_REG_BIT (hard_regs_in_table, regno); @@ -1883,18 +1877,10 @@ invalidate_reg (rtx x, bool clobber_high) if (!REG_P (p->exp) || REGNO (p->exp) >= FIRST_PSEUDO_REGISTER) continue; - if (clobber_high) - { - if (reg_is_clobbered_by_clobber_high (p->exp, x)) - remove_from_table (p, hash); - } - else - { - unsigned int tregno = REGNO (p->exp); - unsigned int tendregno = END_REGNO (p->exp); - if (tendregno > regno && tregno < endregno) - remove_from_table (p, hash); - } + unsigned int tregno = REGNO (p->exp); + unsigned int tendregno = END_REGNO (p->exp); + if (tendregno > regno && tregno < endregno) + remove_from_table (p, hash); } } } @@ -1921,7 +1907,7 @@ invalidate (rtx x, machine_mode full_mode) switch (GET_CODE (x)) { case REG: - invalidate_reg (x, false); + invalidate_reg (x); return; case SUBREG: @@ -4425,8 +4411,6 @@ canonicalize_insn (rtx_insn *insn, struct set **psets, int n_sets) if (MEM_P (XEXP (x, 0))) canon_reg (XEXP (x, 0), insn); } - else if (GET_CODE (x) == CLOBBER_HIGH) - gcc_assert (REG_P (XEXP (x, 0))); else if (GET_CODE (x) == USE && ! (REG_P (XEXP (x, 0)) && REGNO (XEXP (x, 0)) < FIRST_PSEUDO_REGISTER)) @@ -4458,8 +4442,6 @@ canonicalize_insn (rtx_insn *insn, struct set **psets, int n_sets) if (MEM_P (XEXP (y, 0))) canon_reg (XEXP (y, 0), insn); } - else if (GET_CODE (y) == CLOBBER_HIGH) - gcc_assert (REG_P (XEXP (y, 0))); else if (GET_CODE (y) == USE && ! (REG_P (XEXP (y, 0)) && REGNO (XEXP (y, 0)) < FIRST_PSEUDO_REGISTER)) @@ -6149,12 +6131,6 @@ invalidate_from_clobbers (rtx_insn *insn) invalidate (XEXP (ref, 0), GET_MODE (ref)); } } - if (GET_CODE (x) == CLOBBER_HIGH) - { - rtx ref = XEXP (x, 0); - gcc_assert (REG_P (ref)); - invalidate_reg (ref, true); - } else if (GET_CODE (x) == PARALLEL) { int i; @@ -6171,12 +6147,6 @@ invalidate_from_clobbers (rtx_insn *insn) || GET_CODE (ref) == ZERO_EXTRACT) invalidate (XEXP (ref, 0), GET_MODE (ref)); } - else if (GET_CODE (y) == CLOBBER_HIGH) - { - rtx ref = XEXP (y, 0); - gcc_assert (REG_P (ref)); - invalidate_reg (ref, true); - } } } } @@ -6198,12 +6168,6 @@ invalidate_from_sets_and_clobbers (rtx_insn *insn) rtx temx = XEXP (tem, 0); if (GET_CODE (temx) == CLOBBER) invalidate (SET_DEST (temx), VOIDmode); - else if (GET_CODE (temx) == CLOBBER_HIGH) - { - rtx temref = XEXP (temx, 0); - gcc_assert (REG_P (temref)); - invalidate_reg (temref, true); - } } } @@ -6231,12 +6195,6 @@ invalidate_from_sets_and_clobbers (rtx_insn *insn) || GET_CODE (clobbered) == ZERO_EXTRACT) invalidate (XEXP (clobbered, 0), GET_MODE (clobbered)); } - else if (GET_CODE (y) == CLOBBER_HIGH) - { - rtx ref = XEXP (y, 0); - gcc_assert (REG_P (ref)); - invalidate_reg (ref, true); - } else if (GET_CODE (y) == SET && GET_CODE (SET_SRC (y)) == CALL) invalidate (SET_DEST (y), VOIDmode); } @@ -6896,10 +6854,6 @@ count_reg_usage (rtx x, int *counts, rtx dest, int incr) count_reg_usage (XEXP (XEXP (x, 0), 0), counts, NULL_RTX, incr); return; - case CLOBBER_HIGH: - gcc_assert (REG_P ((XEXP (x, 0)))); - return; - case SET: /* Unless we are setting a REG, count everything in SET_DEST. */ if (!REG_P (SET_DEST (x))) @@ -6952,8 +6906,7 @@ count_reg_usage (rtx x, int *counts, rtx dest, int incr) || (REG_NOTE_KIND (x) != REG_NONNEG && GET_CODE (XEXP (x,0)) == USE) /* FUNCTION_USAGE expression lists may include (CLOBBER (mem /u)), involving registers in the address. */ - || GET_CODE (XEXP (x, 0)) == CLOBBER - || GET_CODE (XEXP (x, 0)) == CLOBBER_HIGH) + || GET_CODE (XEXP (x, 0)) == CLOBBER) count_reg_usage (XEXP (x, 0), counts, NULL_RTX, incr); count_reg_usage (XEXP (x, 1), counts, NULL_RTX, incr); @@ -7037,9 +6990,7 @@ insn_live_p (rtx_insn *insn, int *counts) if (set_live_p (elt, insn, counts)) return true; } - else if (GET_CODE (elt) != CLOBBER - && GET_CODE (elt) != CLOBBER_HIGH - && GET_CODE (elt) != USE) + else if (GET_CODE (elt) != CLOBBER && GET_CODE (elt) != USE) return true; } return false; |