Integrated: 8301033: RISC-V: Handle special cases for MinI/MaxI nodes for Zbb

Fei Yang fyang at openjdk.org
Mon Jan 30 12:19:25 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)

This pull request has now been integrated.

Changeset: 61a5f114
Author:    Fei Yang <fyang at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/61a5f114eee3a90cfff9ab8b815bacca8985c211
Stats:     38 lines in 1 file changed: 34 ins; 0 del; 4 mod

8301033: RISC-V: Handle special cases for MinI/MaxI nodes for Zbb

Reviewed-by: fjiang, luhenry, shade

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

PR: https://git.openjdk.org/jdk/pull/12176


More information about the hotspot-compiler-dev mailing list