RFR: 8275317: AArch64: Support some type conversion vectorization in SLP
Fei Gao
duke at openjdk.java.net
Thu Oct 28 03:47:29 UTC 2021
Current SLP vectorizer in C2 compiler doesn't support type conversion
operations. But AArch64 has vector type conversion instructions in
both NEON and SVE.
The type conversion involves two kinds of scenarios, conversion between
the same data sizes and conversion between different data sizes. If we
want to support casts between different data sizes, we need to amend
the code part for identifying adjacent memory references and the code
part for justifying if the combination is profitable. I suppose it
would be easier to review if we split the whole task to support type
conversion into two separate patches, one for the same data sizes and
the other one for different data sizes. The goal of this patch is just
to support conversions within the same data size, including:
int -> float
float -> int
long -> double
double -> long
A typical test case:
for (int i = start; i < limit; i++) {
b[i] = (float) a[i];
}
To implement it, the patch completed the necessary instructions and
matching rules in the backend and added implementation for SLP in
the middle end.
The percentage of performance uplift on aarch64 system:
benchmark Mode Cnt percentage change [(After-Before)/Before] Metric
VectorLoop.convertD2L avgt 15 -48.46% ns/op
VectorLoop.convertF2I avgt 15 -55.67% ns/op
VectorLoop.convertI2F avgt 15 -55.27% ns/op
VectorLoop.convertL2D avgt 15 -48.75% ns/op
-------------
Commit messages:
- 8275317: AArch64: Support some type conversion vectorization in SLP
Changes: https://git.openjdk.java.net/jdk/pull/6145/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=6145&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8275317
Stats: 229 lines in 5 files changed: 224 ins; 0 del; 5 mod
Patch: https://git.openjdk.java.net/jdk/pull/6145.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/6145/head:pull/6145
PR: https://git.openjdk.java.net/jdk/pull/6145
More information about the hotspot-compiler-dev
mailing list