RFR: 8365926: RISC-V: Performance regression in renaissance (chi-square)

Fei Yang fyang at openjdk.org
Mon Sep 1 07:40:43 UTC 2025


On Tue, 26 Aug 2025 14:43:05 GMT, Robbin Ehn <rehn at openjdk.org> wrote:

> Hey, please consider!
> 
> A bunch of info in JBS entry, please read that also.
> 
> I narrowed this issue down to the old jal optimization, making direct calls when in reach.
> This patch restores them and removes this regression.
> 
> In essence we turn "jalr ra,0(t1)" into a "jal ra,<dest>" if reachable, and restore the jalr if a new destination is not reachable.
> 
> Please test on your hardware!
> 
> 
> Chi Square (100 runs each, 10 fastest iterations of each run, P550)
> JDK-23 (last version with trampoline calls)
> Mean: 3189.5827
> Standard Deviation: 284.6478
> 
> JDK-25
> Mean: 3424.8905
> Standard Deviation: 222.2208
> 
> Patch:
> Mean: 3144.8535
> Standard Deviation: 229.2577
> 
> 
> No issues found in t1, running t2 also. Stress tested on vf2, bpi-f3, p550.

That looks fine to me. I don't have other concerns modulo two minor typos.
FYI: My local hs:tier1-hs:tier3 test with fastdebug build is good.

src/hotspot/cpu/riscv/nativeInst_riscv.cpp line 125:

> 123:   set_stub_address_destination_at(stub_addr, dest);
> 124: 
> 125:   // patches jalr -> jal/jal -> jalr depeding on dest

Suggestion: s/depeding/depending/

src/hotspot/cpu/riscv/nativeInst_riscv.cpp line 146:

> 144: 
> 145:     address dest = stub_address_destination_at(stub_addr);
> 146:     optimize_call(dest, false); // patches jalr -> jal/jal -> jalr depeding on dest

Suggestion: s/depeding/depending/

-------------

Marked as reviewed by fyang (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/26944#pullrequestreview-3172332378
PR Review Comment: https://git.openjdk.org/jdk/pull/26944#discussion_r2313065100
PR Review Comment: https://git.openjdk.org/jdk/pull/26944#discussion_r2313095316


More information about the hotspot-compiler-dev mailing list