RISC-V: Describe correct USEs for gpr_save pattern [PR95252]
- Verified on rv32emc/rv32gc/rv64gc bare-metal target and rv32gc/rv64gc
linux target with qemu.
gcc/ChangeLog:
* config/riscv/predicates.md (gpr_save_operation): New.
* config/riscv/riscv-protos.h (riscv_gen_gpr_save_insn): New.
(riscv_gpr_save_operation_p): Ditto.
* config/riscv/riscv-sr.c (riscv_remove_unneeded_save_restore_calls):
Ignore USEs for gpr_save patter.
* config/riscv/riscv.c (gpr_save_reg_order): New.
(riscv_expand_prologue): Use riscv_gen_gpr_save_insn to gen gpr_save.
(riscv_gen_gpr_save_insn): New.
(riscv_gpr_save_operation_p): Ditto.
* config/riscv/riscv.md (S3_REGNUM): New.
(S4_REGNUM): Ditto.
(S5_REGNUM): Ditto.
(S6_REGNUM): Ditto.
(S7_REGNUM): Ditto.
(S8_REGNUM): Ditto.
(S9_REGNUM): Ditto.
(S10_REGNUM): Ditto.
(S11_REGNUM): Ditto.
(gpr_save): Model USEs correctly.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/pr95252.c: New.