Integrated: 8263058: Optimize vector shift with zero shift count
Eric Liu
github.com+10482586+therealeliu at openjdk.java.net
Wed Mar 17 02:48:11 UTC 2021
On Wed, 10 Mar 2021 10:45:05 GMT, Eric Liu <github.com+10482586+theRealELiu at openjdk.org> wrote:
> Like scalar shift, vector shift could do nothing when shift count is
> zero.
>
> This patch implements the 'Identity' method for all kinds of vector
> shift nodes to optimize out 'ShiftVCntNode 0', which is typically a
> redundant 'mov' in final generated code like below:
>
> add x17, x12, x14
> ldr q16, [x17, #16]
> mov v16.16b, v16.16b
> add x14, x13, x14
> str q16, [x14, #16]
>
> With this patch, the code above could be optimized as below:
>
> add x17, x12, x14
> ldr q16, [x17, #16]
> add x14, x13, x14
> str q16, [x14, #16]
>
> [TESTS]
> compiler/vectorapi/TestVectorShiftImm.java, jdk/incubator/vector,
> hotspot::tier1 passed without new failure.
This pull request has now been integrated.
Changeset: d2144a5b
Author: Eric Liu <eric.c.liu at arm.com>
Committer: Ningsheng Jian <njian at openjdk.org>
URL: https://git.openjdk.java.net/jdk/commit/d2144a5b
Stats: 72 lines in 4 files changed: 20 ins; 26 del; 26 mod
8263058: Optimize vector shift with zero shift count
Reviewed-by: thartmann, kvn
-------------
PR: https://git.openjdk.java.net/jdk/pull/2911
More information about the hotspot-compiler-dev
mailing list