On Fri, May 08, 2020 at 09:57:31AM +0200, Uros Bizjak wrote: > On Fri, May 8, 2020 at 9:47 AM Jakub Jelinek <ja...@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