This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add peephole2s to improve pr49095.c f{char,short,int,long}minus on ia32 (PR rtl-optimization/89865)
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: Jakub Jelinek <jakub at redhat dot com>, gcc-patches at gcc dot gnu dot org, Vladimir Makarov <vmakarov at redhat dot com>
- Date: Sat, 30 Mar 2019 11:21:33 +0100
- Subject: Re: [PATCH] Add peephole2s to improve pr49095.c f{char,short,int,long}minus on ia32 (PR rtl-optimization/89865)
- References: <20190329194402.GB7611@tucnak> <651692d6-bcec-8e38-d9bf-2a2438a821fa@redhat.com>
On 3/29/19, Jeff Law <law@redhat.com> wrote:
> On 3/29/19 1:44 PM, Jakub Jelinek wrote:
>> Hi!
>>
>> f{char,short,int,long}minus use a RMW instead of direct memory operation
>> (regression from 8.3) on ia32. The problem is an extra register copy,
>> which
>> regcprop would fix up, but unfortunately peephole2 runs before regcprop.
>> Also, in one of the existing peephole2s I've renumbered the operands so
>> that
>> we don't overwrite existing operands.
>>
>> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
>>
>> 2019-03-29 Jakub Jelinek <jakub@redhat.com>
>>
>> PR rtl-optimization/89865
>> * config/i386/i386.md
>> (SWI12 peephole for mem {+,-,&,|,^}= x; mem != 0): Fix up operand
>> numbers not to clash with the additional operands[4].
>> (peepholes for mem {+,-,&,|,^}= x; mem != 0): New peephole2s
>> with extra register copy in the middle.
>>
>> * gcc.target/i386/pr49095.c: Adjust number of expected RMW spots
>> on ia32.
> OK. One might ask if there's a way to share a bit of code here since
> there's a fair amount of duplication. But I'll trust that you've
> pondered that and decided it wasn't really worth the effort.
I think that Vladimir n is looking into the PR. So, if RA can avoid
register copies by itself, then these extra peepholes won't be needed.
Let's ask Vladimir for his opinion.
Uros.