This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][RFA][LRA] Don't try to break down subreg expressions if insn already matches
- From: Maxim Kuvyrkov <maxim dot kuvyrkov at linaro dot org>
- To: Kyrill Tkachov <kyrylo dot tkachov at arm dot com>
- Cc: Andrew Pinski <pinskia at gmail dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Vladimir Makarov <vmakarov at redhat dot com>
- Date: Sat, 14 Feb 2015 14:23:36 +0300
- Subject: Re: [PATCH][RFA][LRA] Don't try to break down subreg expressions if insn already matches
- Authentication-results: sourceware.org; auth=none
- References: <54DDC859 dot 3010805 at arm dot com> <41018A63-9F81-4798-9E72-ADAA723D75FD at gmail dot com> <54DDD624 dot 50406 at arm dot com>
On Feb 13, 2015, at 1:47 PM, Kyrill Tkachov <kyrylo.tkachov@arm.com> wrote:
>
> On 13/02/15 10:10, pinskia@gmail.com wrote:
>>
>>
>>
>>> On Feb 13, 2015, at 1:48 AM, Kyrill Tkachov <kyrylo.tkachov@arm.com> wrote:
>>>
>>> Hi all,
>>>
>>> In my tree added a pattern to the arm backend that's supposed to match:
>>> (set (reg:SI r0)
>>> (subreg:SI
>>> (plus:DI
>>> (mult:DI (sign_extend:DI (reg:SI r1))
>>> (sign_extend:DI (reg:SI r2)))
>>> (const_int 2147483648 [0x80000000])) 4))
>>>
>>> That is, take two SImode regs, sign-extend to DImode, multiply in DImode,
>>> add a const_int and take the most significant SImode subreg.
>> Seems better to use shifts for the most significant simode and low part subreg after that. Isn't that what other targets do?
>
> I thought about that, but combine tries to match:
> (set (reg/i:SI 0 r0)
> (subreg:SI (plus:DI (mult:DI (sign_extend:DI (reg:SI 0 r0 [ a ]))
> (sign_extend:DI (reg:SI 1 r1 [ b ])))
> (const_int 2147483648 [0x80000000])) 4))
>
>
> Looking at the RTL dumps all shifts are gone by the time combine is reached (in this case cse1 removes the shifts)
FYI, (and not related to the core issue of this patch)
The use of mult vs shift by combine is a problem that Venkat is working on, see "[RFC] Tighten memory type assumption in RTL combiner pass" . The combiner uses MULTs instead of SHIFTs for rtx'es that look like addresses, even when they are, in fact, mere logic/arithmetic operations.
--
Maxim Kuvyrkov
www.linaro.org