RFR: 8342014: RISC-V: ZStoreBarrierStubC2 clobbers rflags

Hamlin Li mli at openjdk.org
Mon Oct 14 09:37:13 UTC 2024


On Mon, 14 Oct 2024 02:45:35 GMT, Fei Yang <fyang at openjdk.org> wrote:

> `ZStoreBarrierStubC2` (`ZBarriersetAssembler::generate_c2_store_barrier_stub`) clobbers rflags (the `t1` register) on riscv [1].
> And `ZStoreBarrierStubC2` is used by `z_store_barrier` in file gc/z/z_riscv.ad. But the calling instructs in the same ad file
> didn't list the rflags as being killed. As the call chain is not simple, this kind of problem could go silently unnoticed.
> I would suggest we add clobbering of rflags for all gc-related C2 instructs. No obvious impact witnessed on performance.
> This would help reduce the risk of another PR: https://github.com/openjdk/jdk/pull/21406 which touches g1/x/z prefering `t1` for performance reasons. Tagging @robehn 
> 
> [1] https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/riscv/gc/z/zBarrierSetAssembler_riscv.cpp#L746
> 
> Testing on linux-riscv64:
> - [x] hs-tier1 - hs-tier3

Marked as reviewed by mli (Reviewer).

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

PR Review: https://git.openjdk.org/jdk/pull/21485#pullrequestreview-2365947967


More information about the hotspot-dev mailing list