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

2023-08-10 Thread Jeff Law via Gcc-patches
On 8/10/23 03:28, Manolis Tsamis wrote: Hi Jeff, Thanks a lot for providing all this information and testcase! I have been able to reproduce the issue with it. I have investigated the cause of the issue and it's not what you mention, the uses of all intermediate calculations are properly tak

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

2023-08-10 Thread Manolis Tsamis
Hi Jeff, Thanks a lot for providing all this information and testcase! I have been able to reproduce the issue with it. I have investigated the cause of the issue and it's not what you mention, the uses of all intermediate calculations are properly taken into account. In this case it would be fin

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

2023-08-09 Thread Jeff Law via Gcc-patches
On 8/7/23 08:33, 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) a

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

2023-08-07 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 (one