Integrated: 8341146: RISC-V: Unnecessary fences used for load-acquire in template interpreter
Feilong Jiang
fjiang at openjdk.org
Wed Oct 2 09:17:40 UTC 2024
On Sun, 29 Sep 2024 10:52:25 GMT, Feilong Jiang <fjiang at openjdk.org> wrote:
> Hi, please consider.
>
> RISC-V does not currently have plain load and store opcodes with aq or rl annotations, load-acquire and
> store-release operations are implemented using fences instead. Initially, we followed the RISC-V spec
> and placed FENCE RW,RW fence in front of load-acquire operation when porting the template interpreter.
> The purpose is to enforce a store-release-to-load-acquire ordering (where there must be a FENCE RW,RW
> between the store-release and load-acquire). But it turns out these fences are unnecessary for our use
> cases in the template interpreter. In fact, we only need to do a single FENCE R,RW after a normal memory
> load in order to implement a load-acquire operation. We should remove those unnecessary fences for both
> performance reasons and for consistency with the rest of the port (i.e., C1 and C2 JIT).
>
> Testing:
> - [x] JCstress
> - [x] hs-tier1 - hs-tier4
> - [x] ~5% improvement on SPECJbb2005 score (-Xint -XX:+UseParallelGC)
This pull request has now been integrated.
Changeset: a4ca6267
Author: Feilong Jiang <fjiang at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/a4ca6267e17815153f8fa119db19b97b1da2bd84
Stats: 9 lines in 1 file changed: 0 ins; 9 del; 0 mod
8341146: RISC-V: Unnecessary fences used for load-acquire in template interpreter
Reviewed-by: fyang, rehn
-------------
PR: https://git.openjdk.org/jdk/pull/21248
More information about the hotspot-compiler-dev
mailing list