Hi, This set of patches (for gcc-15) help improve stack/array accesses by improving constant materialization. Details are in respective patches.
The first patch is the main change which improves SPEC cactu by 10%. There is at least one more pending change with same theme (riscv_add_offset/riscv_legitimize_address) but that is tripping up and currently being debugged. Thx, -Vineet Vineet Gupta (3): RISC-V: avoid LUI based const materialization ... [part of PR/106265] RISC-V: avoid LUI based const mat: keep stack offsets aligned RISC-V: avoid LUI based const mat in prologue/epilogue expansion [PR/105733] gcc/config/riscv/constraints.md | 12 +++ gcc/config/riscv/predicates.md | 12 +++ gcc/config/riscv/riscv-protos.h | 3 + gcc/config/riscv/riscv.cc | 91 +++++++++++++++++-- gcc/config/riscv/riscv.h | 20 ++++ gcc/config/riscv/riscv.md | 65 +++++++++++++ gcc/testsuite/gcc.target/riscv/pr105733.c | 15 +++ .../riscv/rvv/autovec/vls/spill-1.c | 4 +- .../riscv/rvv/autovec/vls/spill-2.c | 4 +- .../riscv/rvv/autovec/vls/spill-3.c | 4 +- .../riscv/rvv/autovec/vls/spill-4.c | 4 +- .../riscv/rvv/autovec/vls/spill-5.c | 4 +- .../riscv/rvv/autovec/vls/spill-6.c | 4 +- .../riscv/rvv/autovec/vls/spill-7.c | 4 +- .../gcc.target/riscv/sum-of-two-s12-const-1.c | 45 +++++++++ .../gcc.target/riscv/sum-of-two-s12-const-2.c | 22 +++++ 16 files changed, 292 insertions(+), 21 deletions(-) create mode 100644 gcc/testsuite/gcc.target/riscv/pr105733.c create mode 100644 gcc/testsuite/gcc.target/riscv/sum-of-two-s12-const-1.c create mode 100644 gcc/testsuite/gcc.target/riscv/sum-of-two-s12-const-2.c -- 2.34.1