Re: [x86 PATCH] PR target/47949: Use xchg to move from/to AX_REG with -Oz.

2022-08-02 Thread Uros Bizjak via Gcc-patches
On Tue, Aug 2, 2022 at 4:59 PM Roger Sayle wrote: > > > This patch adds a peephole2 to i386.md to implement the suggestion in > PR target/47949, of using xchg instead of mov for moving values to/from > the %rax/%eax register, controlled by -Oz, as the xchg instruction is > one byte shorter than th

[x86 PATCH] PR target/47949: Use xchg to move from/to AX_REG with -Oz.

2022-08-02 Thread Roger Sayle
This patch adds a peephole2 to i386.md to implement the suggestion in PR target/47949, of using xchg instead of mov for moving values to/from the %rax/%eax register, controlled by -Oz, as the xchg instruction is one byte shorter than the move it is replacing. The new test case is taken from the P