From: Richard Sandiford <richard.sandiford@arm.com>
To: Jeff Law <law@redhat.com>
Cc: "gcc-patches\@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [2/9] Add a REG_NREGS macro
Date: Tue, 19 May 2015 07:00:00 -0000 [thread overview]
Message-ID: <87wq05dpq0.fsf@e105548-lin.cambridge.arm.com> (raw)
In-Reply-To: <555A4AC7.4040005@redhat.com> (Jeff Law's message of "Mon, 18 May 2015 21:25:43 +0100")
Jeff Law <law@redhat.com> writes:
> On 05/18/2015 12:13 PM, Richard Sandiford wrote:
>> This patch adds a REG_NREGS macro that by the end of the series
>> will simply be an rtx field access. The definition in this patch
>> is just a placeholder (and so I haven't tried to avoid the double
>> evaluation of the parameter).
>>
>> The diff has extra context because in most cases it makes it obvious
>> that we really are looking at hard_regno_nregs[REGNO (x)][GET_MODE (x)]
>> for some rtx x. There are a couple of sites where it's more indirect
>> though.
>>
>>
>> gcc/
>> * rtl.h (REG_NREGS): New macro
>> * alias.c (record_set): Use it.
>> * cfgcleanup.c (mark_effect): Likewise.
>> * combine.c (likely_spilled_retval_1): Likewise.
>> (likely_spilled_retval_p, can_change_dest_mode): Likewise.
>> (move_deaths, distribute_notes): Likewise.
>> * cselib.c (cselib_record_set): Likewise.
>> * df-problems.c (df_simulate_one_insn_forwards): Likewise.
>> * df-scan.c (df_mark_reg): Likewise.
>> * dse.c (look_for_hardregs): Likewise.
>> * dwarf2out.c (reg_loc_descriptor): Likewise.
>> (multiple_reg_loc_descriptor): Likewise.
>> * expr.c (write_complex_part, read_complex_part): Likewise.
>> (emit_move_complex): Likewise.
>> * haifa-sched.c (setup_ref_regs): Likewise.
>> * ira-lives.c (mark_hard_reg_live): Likewise.
>> * lra.c (lra_set_insn_recog_data): Likewise.
>> * mode-switching.c (create_pre_exit): Likewise.
>> * postreload.c (reload_combine_recognize_const_pattern): Likewise.
>> (reload_combine_recognize_pattern): Likewise.
>> (reload_combine_note_use, move2add_record_mode): Likewise.
>> (reload_cse_move2add): Likewise.
>> * reg-stack.c (subst_stack_regs_pat): Likewise.
>> * regcprop.c (kill_value, copy_value): Likewise.
>> (copyprop_hardreg_forward_1): Likewise.
>> * regrename.c (verify_reg_in_set, scan_rtx_reg): Likewise.
>> (build_def_use): Likewise.
>> * sched-deps.c (mark_insn_reg_birth, mark_reg_death): Likewise.
>> (deps_analyze_insn): Likewise.
>> * sched-rgn.c (check_live_1, update_live_1): Likewise.
>> * sel-sched.c (count_occurrences_equiv): Likewise.
>> * valtrack.c (dead_debug_insert_temp): Likewise.
>>
> OK.
>
> Makes me wonder if we want to poison hard_regno_nregs in some way to
> avoid folks re-introducing this stuff in the future... Your call if you
> want to tackle that as a follow-up.
The problem is that many uses of hard_regno_nregs aren't about
existing REGs. E.g. the register allocators need to know how many
registers something would occupy before allocating it, so they (rightly)
make heavy use of it with a calculated regno and/or mode.
Agree that people will probably do things the old way out of habit.
Maybe it's just something I should grep for occasionally...
Thanks,
Richard
next prev parent reply other threads:[~2015-05-19 6:51 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-18 18:11 [0/9] Record number of hard registers in a REG Richard Sandiford
2015-05-18 18:13 ` [1/9] Make more use of END_REGNO Richard Sandiford
2015-05-18 19:06 ` Jeff Law
2015-05-18 18:15 ` [2/9] Add a REG_NREGS macro Richard Sandiford
2015-05-18 20:27 ` Jeff Law
2015-05-19 7:00 ` Richard Sandiford [this message]
2015-05-18 18:19 ` [3/9] Clean up df_ref_change_reg_with_loc Richard Sandiford
2015-05-18 20:33 ` Jeff Law
2015-05-18 18:22 ` [4/9] Add a dedicated rtx union member for REGs Richard Sandiford
2015-05-18 20:41 ` Jeff Law
2015-05-19 7:04 ` Richard Sandiford
2015-05-19 7:17 ` Jeff Law
2015-05-18 18:23 ` [5/9] Create sensible dummy registers Richard Sandiford
2015-05-18 21:29 ` Jeff Law
2015-05-19 9:02 ` Eric Botcazou
2015-05-22 15:44 ` Richard Sandiford
2015-05-22 20:05 ` Jeff Law
2015-05-18 18:24 ` [6/9] Pass REG changes through a new function Richard Sandiford
2015-05-18 21:32 ` Jeff Law
2015-05-18 18:24 ` [7/9] Record the number of registers in a REG Richard Sandiford
2015-05-18 21:33 ` Jeff Law
2015-05-18 18:26 ` [8/9] Remove END_HARD_REGNO Richard Sandiford
2015-05-18 21:34 ` Jeff Law
2015-05-18 18:31 ` [9/9] Simplify register bitmap operations Richard Sandiford
2015-05-18 21:39 ` Jeff Law
2015-05-19 15:21 ` breakage with series "[0/9] Record number of hard registers in a REG" Hans-Peter Nilsson
2015-05-19 15:54 ` Richard Sandiford
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wq05dpq0.fsf@e105548-lin.cambridge.arm.com \
--to=richard.sandiford@arm.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=law@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).