[PATCH] rtl: constm64_rtx..const64_rtx

Jeff Law jeffreyalaw@gmail.com
Thu Jun 3 19:32:54 GMT 2021



On 6/2/2021 4:43 PM, Segher Boessenkool wrote:
> Hi!
>
> On Wed, Jun 02, 2021 at 06:07:28PM +0100, Richard Sandiford wrote:
>> Segher Boessenkool <segher@kernel.crashing.org> writes:
>>> Since times immemorial there has been const_int_rtx for all values from
>>> -64 to 64, but only constm1_rtx..const2_rtx have been available for
>>> convenient use.  Change this, so that we can use all values in
>>> {-64,...,64} in RTL easily.  This matters, because then we we just say
>>>    if (XEXP (x, 1) == const16_rtx)
>>> and things like that, since all const_int in that range are unique.  We
>>> already do for -1, 0, 1, 2, but we could for everything.
>> No strong objection, but personally I'd rather not add something
>> that is very specific to VOIDmode CONST_INTs.  I realise it's very
>> unlikely that we'll ever be able to give CONST_INTs their proper mode
>> (no-one has the kind of time needed to do that), but I don't think we
>> should make the switch actively harder either.
> How does this make that harder?
>
> Having no mode for CONST_INTs makes some things significantly *easier*
> btw.  Well you know that, that is what makes any conversion away from
> this so much harder :-)
>
> We have has const0_rtx etc. since forever, this patch just increases the
> range (to those values that have had guaranteed unique RTXes since
> decades as well).
Yea, but often what you really want is CONST0_RTX (mode) instead of 
const0_rtx.   It's easily goof'd and often the cause minor missed 
optimizations.

jeff


More information about the Gcc-patches mailing list