[riscv-port-jdk17u:riscv-port] RFR: 8304293: RISC-V: JDK-8276799 missed atomic intrinsic support for C1

Feilong Jiang fjiang at openjdk.org
Tue Mar 21 10:35:17 UTC 2023


On Tue, 21 Mar 2023 02:33:45 GMT, Gui Cao <gcao at openjdk.org> wrote:

> Please review this backport to riscv-port-jdk17u.
> Backport of [JDK-8304293](https://bugs.openjdk.org/browse/JDK-8304293).
> Let me show the IR changes before and after the modification:
> `java -Xcomp -XX:TieredStopAtLevel=1 -XX:+PrintIR -version > C1.log`
> 
> before:
> 
> B3 (V) [33, 49] dom B1 pred: B1
> empty stack
> inlining depth 0
> __bci__use__tid____instr____________________________________
>   33   1    a35    <instance 0x00000040c003c3b8 klass=java/util/concurrent/atomic/AtomicLong>
> . 8    0    l42    a25.invokespecial(a35, l27, l4)
>                    jdk/internal/misc/Unsafe.getAndAddLong(Ljava/lang/Object;JJ)J
>   41   1    a46    <instance 0x00000040c003c3c0 klass=java/util/concurrent/atomic/AtomicLong>
>   7    1    l53    1L
> . 8    0    l54    a25.invokespecial(a46, l27, l53)
>                    jdk/internal/misc/Unsafe.getAndAddLong(Ljava/lang/Object;JJ)J
> . 49   0    i61    ireturn i29
> 
> 
> after:
> 
> B3 (V) [33, 49] dom B1 pred: B1
> empty stack
> inlining depth 0
> __bci__use__tid____instr____________________________________
>   33   1    a35    <instance 0x00000040c003c3b8 klass=java/util/concurrent/atomic/AtomicLong>
> . 8    0    l42    UnsafeGetAndSetObject (add).(a35, l27, value l4)
>   41   1    a46    <instance 0x00000040c003c3c0 klass=java/util/concurrent/atomic/AtomicLong>
>   7    1    l53    1L
> . 8    0    l54    UnsafeGetAndSetObject (add).(a46, l27, value l53)
> . 49   0    i61    ireturn i29
> 
> 
> Testing:
> 
> Tier1 passed without new failure on unmacthed (release).

Thanks for backporting this!

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

Marked as reviewed by fjiang (no project role).

PR Review: https://git.openjdk.org/riscv-port-jdk17u/pull/19#pullrequestreview-1350128156


More information about the riscv-port-dev mailing list