summaryrefslogtreecommitdiff
path: root/libjava/java/sql
diff options
context:
space:
mode:
authorKito Cheng <kito.cheng@sifive.com>2025-11-05 17:55:39 +0800
committerKito Cheng <kito.cheng@sifive.com>2025-11-20 23:38:14 +0800
commitc738d4ef524e66c1aa13e949e701473a7dcc4db6 (patch)
tree1823037dd035981cd64fe679697006dab7137c78 /libjava/java/sql
parent8615c855fa5647db11c84b882f0d88aadfc28863 (diff)
RISC-V: Add RTL pass to combine cm.popret with zero return value
This patch implements a new RTL pass that combines "li a0, 0" and "cm.popret" into a single "cm.popretz" instruction for the Zcmp extension. This optimization cannot be done during prologue/epilogue expansion because it would cause shrink-wrapping to generate incorrect code as documented in PR113715. The dedicated RTL pass runs after shrink-wrap but before branch shortening, safely performing this combination. Changes since v2: - Apply Jeff's comment - Use CONST0_RTX rather than const0_rtx, this make this pass able to handle (const_double:SF 0.0) as well. - Adding test case for float/double zero return value. Changes since v1: - Tweak the testcase. gcc/ChangeLog: * config/riscv/riscv-opt-popretz.cc: New file. * config/riscv/riscv-passes.def: Insert pass_combine_popretz before pass_shorten_branches. * config/riscv/riscv-protos.h (make_pass_combine_popretz): New declaration. * config/riscv/t-riscv: Add riscv-opt-popretz.o build rule. * config.gcc (riscv*): Add riscv-opt-popretz.o to extra_objs. gcc/testsuite/ChangeLog: * gcc.target/riscv/pr113715.c: New test. * gcc.target/riscv/rv32e_zcmp.c: Update expected output for test_popretz. * gcc.target/riscv/rv32i_zcmp.c: Likewise.
Diffstat (limited to 'libjava/java/sql')
0 files changed, 0 insertions, 0 deletions