Integrated: 8254872: Optimize Rotate on AArch64

Eric Liu github.com+10482586+erik1iu at openjdk.java.net
Tue Nov 17 01:59:07 UTC 2020


On Fri, 13 Nov 2020 10:33:41 GMT, Eric Liu <github.com+10482586+erik1iu at openjdk.org> wrote:

> This patch is a supplement for
> https://bugs.openjdk.java.net/browse/JDK-8248830.
> 
> With the implementation of rotate node in IR, this patch:
> 
> 1. canonicalizes RotateLeft into RotateRight when shift is a constant,
>    so that GVN could identify the pre-existing node better.
> 2. implements scalar rotate match rules and removes the original
>    combinations of Or and Shifts on AArch64.
> 
> This patch doesn't implement vector rotate due to the lack of
> corresponding vector instructions on AArch64.
> 
> Test case below is an explanation for this patch.
> 
>         public static int test(int i) {
>             int a =  (i >>> 29) | (i << -29);
>             int b = i << 3;
>             int c = i >>> -3;
>             int d = b | c;
>             return a ^ d;
>         }
> 
> Before:
> 
>         lsl     w12, w1, #3
>         lsr     w10, w1, #29
>         add     w11, w10, w12
>         orr     w12, w12, w10
>         eor     w0, w11, w12
> 
> After:
> 
>         ror     w10, w1, #29
>         eor     w0, w10, w10
> 
> Tested jtreg TestRotate.java, hotspot::hotspot_all_no_apps,
> jdk::jdk_core, langtools::tier1.

This pull request has now been integrated.

Changeset: 30a2ad55
Author:    Eric Liu <eric.c.liu at arm.com>
Committer: Nick Gasson <ngasson at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/30a2ad55
Stats:     199 lines in 4 files changed: 29 ins; 119 del; 51 mod

8254872: Optimize Rotate on AArch64

Reviewed-by: aph, kvn

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

PR: https://git.openjdk.java.net/jdk/pull/1199


More information about the hotspot-compiler-dev mailing list