From: Jeff Law <law@redhat.com>
To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
richard.sandiford@arm.com
Subject: Re: [PATCH 4/5] Generalise invalid_mode_change_p
Date: Mon, 22 Sep 2014 16:29:00 -0000 [thread overview]
Message-ID: <54204E5E.3090406@redhat.com> (raw)
In-Reply-To: <87lhpcm7lr.fsf@e105548-lin.cambridge.arm.com>
On 09/22/14 01:34, Richard Sandiford wrote:
> Jeff Law <law@redhat.com> writes:
>> On 09/18/14 04:25, Richard Sandiford wrote:
>>> This is the main patch for the bug. We should treat a register as invalid
>>> for a mode change if simplify_subreg_regno cannot provide a new register
>>> number for the result. We should treat a class as invalid for a mode change
>>> if all registers in the class are invalid. This is an extension of the old
>>> CANNOT_CHANGE_MODE_CLASS-based check (simplify_subreg_regno checks C_C_C_M).
>>>
>>> I forgot to say that the patch is a prerequisite to removing aarch64's
>>> C_C_C_M. There are other prerequisites too, but removing C_C_C_M without
>>> this patch caused regressions in the existing testsuite, which is why no
>>> new tests are needed.
>>>
>>>
>>> gcc/
>>> * hard-reg-set.h: Include hash-table.h.
>>> (target_hard_regs): Add a finalize method and a x_simplifiable_subregs
>>> field.
>>> * target-globals.c (target_globals::~target_globals): Handle
>>> hard_regs->finalize.
>>> * rtl.h (subreg_shape): New structure.
>>> (shape_of_subreg): New function.
>>> (simplifiable_subregs): Declare.
>>> * reginfo.c (simplifiable_subreg): New structure.
>>> (simplifiable_subregs_hasher): Likewise.
>>> (simplifiable_subregs): New function.
>>> (invalid_mode_changes): Delete.
>>> (alid_mode_changes, valid_mode_changes_obstack): New variables.
>>> (record_subregs_of_mode): Remove subregs_of_mode parameter.
>>> Record valid mode changes in valid_mode_changes.
>>> (find_subregs_of_mode): Remove subregs_of_mode parameter.
>>> Update calls to record_subregs_of_mode.
>>> (init_subregs_of_mode): Remove invalid_mode_changes and bitmap
>>> handling. Initialize new variables. Update call to
>>> find_subregs_of_mode.
>>> (invalid_mode_change_p): Check new variables instead of
>>> invalid_mode_changes.
>>> (finish_subregs_of_mode): Finalize new variables instead of
>>> invalid_mode_changes.
>>> (target_hard_regs::finalize): New function.
>>> * ira-costs.c (print_allocno_costs): Call invalid_mode_change_p
>>> even when CLASS_CANNOT_CHANGE_MODE is undefined.
>>>
>>> Index: gcc/rtl.h
>>> ===================================================================
>>> --- gcc/rtl.h 2014-09-15 11:55:40.459855161 +0100
>>> +++ gcc/rtl.h 2014-09-15 12:26:21.249077760 +0100
>>> +/* Return the shape of a SUBREG rtx. */
>>> +
>>> +static inline subreg_shape
>>> +shape_of_subreg (const_rtx x)
>>> +{
>>> + return subreg_shape (GET_MODE (SUBREG_REG (x)),
>>> + SUBREG_BYTE (x), GET_MODE (x));
>>> +}
>>> +
>> Is there some reason you don't have a constructor that accepts a
>> const_rtx?
>
> I was worried that by allowing implicit const_rtx->subreg_shape
> conversions, it would be less obvious that the rtx has to have
> code SUBREG. I.e. a checked conversion would be hidden in the
> constructor rather than being explicit.
>
> If with David's new rtx hierarchy we end up with an rtx_subreg
> subclass then I agree we should have a constructor that takes
> one of those.
Makes sense.
I'm not sure if I was explicit, but the patch is fine, that was more a
curiosity on my part than anything.
jeff
next prev parent reply other threads:[~2014-09-22 16:29 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-18 10:07 [PATCH 0/5] Fix handling of word subregs of wide registers Richard Sandiford
2014-09-18 10:09 ` [PATCH 1/5] Allow *_HARD_REG_SET arguments to be const Richard Sandiford
2014-09-19 6:14 ` Jeff Law
2014-09-18 10:10 ` [PATCH 2/5] Tweak subreg_get_info documentation Richard Sandiford
2014-09-19 6:16 ` Jeff Law
2014-09-18 10:13 ` [PATCH 3/5] Use simplify_subreg_regno in combine.c:subst Richard Sandiford
2014-09-19 6:17 ` Jeff Law
2014-09-18 10:25 ` [PATCH 4/5] Generalise invalid_mode_change_p Richard Sandiford
2014-09-19 17:53 ` Jeff Law
2014-09-22 7:34 ` Richard Sandiford
2014-09-22 16:29 ` Jeff Law [this message]
2014-09-18 10:26 ` [PATCH 5/5] Remove CANNOT_CHANGE_MODE_CLASS workaround in i386.c Richard Sandiford
2014-09-19 17:54 ` Jeff Law
2014-09-19 6:14 ` [PATCH 0/5] Fix handling of word subregs of wide registers Jeff Law
2014-09-19 7:24 ` Richard Sandiford
2014-09-19 15:59 ` Jeff Law
2014-09-19 17:14 ` Jeff Law
2014-09-22 7:23 ` Richard Sandiford
2014-09-22 10:49 ` Ajit Kumar Agarwal
2014-09-22 11:26 ` Richard Sandiford
2014-09-22 12:07 ` Ajit Kumar Agarwal
2014-09-22 9:00 ` Andrew Pinski
2014-09-22 11:29 ` 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=54204E5E.3090406@redhat.com \
--to=law@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=richard.sandiford@arm.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).