Re: PATCH: PR target/50603: [x32] Unnecessary lea

2011-10-07 Thread Uros Bizjak
On Thu, Oct 6, 2011 at 11:33 PM, H.J. Lu wrote: >>> OTOH, x86_64 and i686 targets can also benefit from this change. If >>> combine can't create more complex address (covered by lea), then it >>> will simply propagate memory operand back into the add insn. It looks >>> to me that

Re: PATCH: PR target/50603: [x32] Unnecessary lea

2011-10-06 Thread H.J. Lu
On Tue, Oct 4, 2011 at 11:58 AM, H.J. Lu wrote: > On Tue, Oct 4, 2011 at 11:51 AM, Uros Bizjak wrote: >> On Tue, Oct 4, 2011 at 8:37 PM, H.J. Lu wrote: >> >> OTOH, x86_64 and i686 targets can also benefit from this change. If >> combine can't create more complex address (covered by lea),

Re: PATCH: PR target/50603: [x32] Unnecessary lea

2011-10-04 Thread H.J. Lu
On Tue, Oct 4, 2011 at 11:51 AM, Uros Bizjak wrote: > On Tue, Oct 4, 2011 at 8:37 PM, H.J. Lu wrote: > > OTOH, x86_64 and i686 targets can also benefit from this change. If > combine can't create more complex address (covered by lea), then it > will simply propagate memory operand bac

Re: PATCH: PR target/50603: [x32] Unnecessary lea

2011-10-04 Thread Uros Bizjak
On Tue, Oct 4, 2011 at 8:37 PM, H.J. Lu wrote: OTOH, x86_64 and i686 targets can also benefit from this change. If combine can't create more complex address (covered by lea), then it will simply propagate memory operand back into the add insn. It looks to me that we can't loos

Re: PATCH: PR target/50603: [x32] Unnecessary lea

2011-10-04 Thread H.J. Lu
On Tue, Oct 4, 2011 at 10:32 AM, Uros Bizjak wrote: > On Tue, Oct 4, 2011 at 6:06 PM, H.J. Lu wrote: > >>> OTOH, x86_64 and i686 targets can also benefit from this change. If >>> combine can't create more complex address (covered by lea), then it >>> will simply propagate memory operand back into

Re: PATCH: PR target/50603: [x32] Unnecessary lea

2011-10-04 Thread Uros Bizjak
On Tue, Oct 4, 2011 at 6:06 PM, H.J. Lu wrote: >> OTOH, x86_64 and i686 targets can also benefit from this change. If >> combine can't create more complex address (covered by lea), then it >> will simply propagate memory operand back into the add insn. It looks >> to me that we can't loose here,

Re: PATCH: PR target/50603: [x32] Unnecessary lea

2011-10-04 Thread H.J. Lu
On Tue, Oct 4, 2011 at 1:19 AM, Uros Bizjak wrote: > On Tue, Oct 4, 2011 at 10:06 AM, Uros Bizjak wrote: This patch improves address combine for x32 by forcing the memory memory operand of PLUS operation into register.  Tested on Linux/x86-64 with -mx32.  OK for trunk? >>> >>> Does

Re: PATCH: PR target/50603: [x32] Unnecessary lea

2011-10-04 Thread H.J. Lu
On Tue, Oct 4, 2011 at 1:19 AM, Uros Bizjak wrote: > On Tue, Oct 4, 2011 at 10:06 AM, Uros Bizjak wrote: This patch improves address combine for x32 by forcing the memory memory operand of PLUS operation into register.  Tested on Linux/x86-64 with -mx32.  OK for trunk? >>> >>> Does

Re: PATCH: PR target/50603: [x32] Unnecessary lea

2011-10-04 Thread Uros Bizjak
On Tue, Oct 4, 2011 at 10:06 AM, Uros Bizjak wrote: >>> This patch improves address combine for x32 by forcing the memory memory >>> operand of PLUS operation into register.  Tested on Linux/x86-64 with >>> -mx32.  OK for trunk? >> >> Does the patch fix >> >> FAIL: gcc.target/i386/pr45670.c scan-a

Re: PATCH: PR target/50603: [x32] Unnecessary lea

2011-10-04 Thread Uros Bizjak
On Tue, Oct 4, 2011 at 8:17 AM, Uros Bizjak wrote: > On Tue, Oct 4, 2011 at 1:00 AM, H.J. Lu wrote: >> This patch improves address combine for x32 by forcing the memory memory >> operand of PLUS operation into register.  Tested on Linux/x86-64 with >> -mx32.  OK for trunk? > > Does the patch fix

Re: PATCH: PR target/50603: [x32] Unnecessary lea

2011-10-04 Thread Paolo Bonzini
On 10/04/2011 01:00 AM, H.J. Lu wrote: + else +{ + /* Improve address combine in x32 mode. */ + if (TARGET_X32 + && code == PLUS + && !MEM_P (dst) + && !MEM_P (src1) + && MEM_P (src2) ) + src2 = force_reg (mode, src2); +} Perhaps this is wor

Re: PATCH: PR target/50603: [x32] Unnecessary lea

2011-10-03 Thread Uros Bizjak
On Tue, Oct 4, 2011 at 1:00 AM, H.J. Lu wrote: > This patch improves address combine for x32 by forcing the memory memory > operand of PLUS operation into register.  Tested on Linux/x86-64 with > -mx32.  OK for trunk? Does the patch fix FAIL: gcc.target/i386/pr45670.c scan-assembler-not lea[lq]

PATCH: PR target/50603: [x32] Unnecessary lea

2011-10-03 Thread H.J. Lu
This patch improves address combine for x32 by forcing the memory memory operand of PLUS operation into register. Tested on Linux/x86-64 with -mx32. OK for trunk? Thanks. H.J. --- 2011-10-03 H.J. Lu PR target/50603 * config/i386/i386.c (ix86_fixup_binary_operands): Force th