Re: [PATCH] RISC-V: Enable Hoist to GCSE simple constants

2023-08-24 Thread Jeff Law via Gcc-patches
On 8/23/23 18:42, Vineet Gupta wrote: Seriously, I detest it too, but the irony is I've now made my 2nd change in there and keep adding to ugliness :-( Happens to all of us sometimes. So I think your change makes sense.   But I think it can be refined to simplify the larger chunk of

Re: [PATCH] RISC-V: Enable Hoist to GCSE simple constants

2023-08-23 Thread Vineet Gupta
On 8/23/23 13:04, Jeff Law wrote: Thanks for your patience on this.  I needed a bit of time to gather my thoughts and review some code. No worries at all. index 8b7256108157..1802eef908fc 100644 --- a/gcc/config/riscv/riscv.cc +++ b/gcc/config/riscv/riscv.cc @@ -2464,14 +2464,9 @@ riscv_rtx

Re: [PATCH] RISC-V: Enable Hoist to GCSE simple constants

2023-08-23 Thread Jeff Law via Gcc-patches
On 8/9/23 18:30, Vineet Gupta wrote: Hoist want_to_gcse_p () calls rtx_cost () to compute max distance for hoist candidates . For a const with cost 1 backend currently returns 0, causing Hoist to bail and elide GCSE. Note that constants requiring more than 1 insns to setup were working alread

[PATCH] RISC-V: Enable Hoist to GCSE simple constants

2023-08-09 Thread Vineet Gupta
Hoist want_to_gcse_p () calls rtx_cost () to compute max distance for hoist candidates . For a const with cost 1 backend currently returns 0, causing Hoist to bail and elide GCSE. Note that constants requiring more than 1 insns to setup were working already since backend is returning 1 as well. Ar