[PATCH] ix86: Add peephole2 for *add<mode>3_cc_overflow_1 followed by matching memory store [PR94857]
Jakub Jelinek
jakub@redhat.com
Fri May 8 08:05:26 GMT 2020
On Fri, May 08, 2020 at 09:57:31AM +0200, Uros Bizjak wrote:
> On Fri, May 8, 2020 at 9:47 AM Jakub Jelinek <jakub@redhat.com> wrote:
> > The following peephole2 changes:
> > - addl (%rdi), %esi
> > + xorl %eax, %eax
> > + addl %esi, (%rdi)
> > setc %al
> > - movl %esi, (%rdi)
> > - movzbl %al, %eax
> > ret
> > on the testcase. *add<mode>3_cc_overflow_1, being an add{l,q} insn, is
> > commutative, so if TARGET_READ_MODIFY_WRITE we can replace
> > addl (%rdi), %esi; movl %esi, (%rdi)
> > with
> > addl %esi, (%rdi)
> > if %edi is dead after those two insns.
>
> I assume you meant %esi here.
Of course, sorry. Fixed in commit log.
> OK with a small test adjustment.
Done, thanks.
Jakub
More information about the Gcc-patches
mailing list