Re: [PATCH v6] Implement new RTL optimizations pass: fold-mem-offsets.

2023-10-16 Thread Manolis Tsamis
On Tue, Oct 10, 2023 at 5:15 PM Jeff Law wrote: > > > > On 10/10/23 05:59, Manolis Tsamis wrote: > > >> It's a code quality issue as long as we don't transform the code into > >> movl $0, -18874240, at which point it would become a correctness issue. > >> > > Ok, thanks for pointing that out as I

Re: [PATCH v6] Implement new RTL optimizations pass: fold-mem-offsets.

2023-10-10 Thread Jeff Law
On 10/10/23 05:59, Manolis Tsamis wrote: It's a code quality issue as long as we don't transform the code into movl $0, -18874240, at which point it would become a correctness issue. Ok, thanks for pointing that out as I thought that movl $0, -18874240 and movl $0, -18874240(eax) with eax

Re: [PATCH v6] Implement new RTL optimizations pass: fold-mem-offsets.

2023-10-10 Thread Manolis Tsamis
On Fri, Oct 6, 2023 at 8:57 PM Jeff Law wrote: > > > > On 10/6/23 08:17, Manolis Tsamis wrote: > SNIP > >> So I was ready to ACK, but realized there weren't any testresults for a > >> primary platform mentioned. So I ran this on x86. > >> > >> It's triggering one regression (code quality). > >>

Re: [PATCH v6] Implement new RTL optimizations pass: fold-mem-offsets.

2023-10-06 Thread Jeff Law
On 10/6/23 08:17, Manolis Tsamis wrote: SNIP So I was ready to ACK, but realized there weren't any testresults for a primary platform mentioned. So I ran this on x86. It's triggering one regression (code quality). Specifically gcc.target/i386/pr52146.c The f-m-o code is slightly worse

Re: [PATCH v6] Implement new RTL optimizations pass: fold-mem-offsets.

2023-10-06 Thread Manolis Tsamis
On Thu, Oct 5, 2023 at 1:05 AM Jeff Law wrote: > > > > On 10/3/23 05:45, Manolis Tsamis wrote: > > This is a new RTL pass that tries to optimize memory offset calculations > > by moving them from add immediate instructions to the memory loads/stores. > > For example it can transform this: > > > >

Re: [PATCH v6] Implement new RTL optimizations pass: fold-mem-offsets.

2023-10-06 Thread Manolis Tsamis
On Thu, Oct 5, 2023 at 5:54 PM Jeff Law wrote: > > > > On 10/3/23 05:45, Manolis Tsamis wrote: > > This is a new RTL pass that tries to optimize memory offset calculations > > > + > > +/* If INSN is a root memory instruction then compute a potentially new > > offset > > + for it and test if

Re: [PATCH v6] Implement new RTL optimizations pass: fold-mem-offsets.

2023-10-05 Thread Jeff Law
On 10/3/23 05:45, Manolis Tsamis wrote: This is a new RTL pass that tries to optimize memory offset calculations + +/* If INSN is a root memory instruction then compute a potentially new offset + for it and test if the resulting instruction is valid. */ +static void +do_check_validity

Re: [PATCH v6] Implement new RTL optimizations pass: fold-mem-offsets.

2023-10-04 Thread Jeff Law
On 10/3/23 05:45, Manolis Tsamis wrote: This is a new RTL pass that tries to optimize memory offset calculations by moving them from add immediate instructions to the memory loads/stores. For example it can transform this: addi t4,sp,16 add t2,a6,t4 shl t3,t2,1 ld a2,0(t3)

[PATCH v6] Implement new RTL optimizations pass: fold-mem-offsets.

2023-10-03 Thread Manolis Tsamis
This is a new RTL pass that tries to optimize memory offset calculations by moving them from add immediate instructions to the memory loads/stores. For example it can transform this: addi t4,sp,16 add t2,a6,t4 shl t3,t2,1 ld a2,0(t3) addi a2,1 sd a2,8(t2) into the following