RFR: 8301033: RISC-V: Handle special cases for MinI/MaxI nodes for Zbb
Aleksey Shipilev
shade at openjdk.org
Mon Jan 30 10:28:15 UTC 2023
On Wed, 25 Jan 2023 03:40:04 GMT, Fei Yang <fyang at openjdk.org> wrote:
> The code generation for MinI/MaxI nodes for Zbb extension could be improved when one of the source operands is constant 0. We can make use of the dedicated zero register of the architecture for these special cases. This adds two match rules for those cases. The difference in -XX:+PrintOptoAssembly output looks like:
>
> Before:
>
> 048 li R7, #0 # int, #@loadConI
> 04a + max R10, R12, R7 #@maxI_reg_b
> 04e # pop frame 32
>
>
> After:
>
> 048 max R10, R12, zr #@maxI_reg_zero_b
> 04c # pop frame 32
>
>
> Before:
>
> 028 li R7, #0 # int, #@loadConI
> 02a + min R10, R11, R7 #@minI_reg_b
> 02e # pop frame 32
>
>
> After:
>
> 028 min R10, R11, zr #@minI_reg_zero_b
> 02c # pop frame 32
>
>
> Testing:
> - [x] https://github.com/openjdk/jdk/blob/master/test/hotspot/jtreg/compiler/intrinsics/math/TestMinMaxIntrinsics.java
> - [x] Tier1 tested with QEMU (Enabled support for Zbb extension)
Marked as reviewed by shade (Reviewer).
-------------
PR: https://git.openjdk.org/jdk/pull/12176
More information about the hotspot-compiler-dev
mailing list