8377449: Strengthen vector IR validation in TestVectorAlgorithms.java for AArch64

Reviewed-by: mhaessig, epeter
This commit is contained in:
Xiaohong Gong 2026-03-05 01:57:03 +00:00
parent 1f4a7bbb9d
commit c9da76bf33

View File

@ -272,8 +272,10 @@ public class TestVectorAlgorithms {
@Test
@IR(counts = {IRNode.ADD_VI, "> 0",
IRNode.STORE_VECTOR, "> 0"},
applyIfCPUFeature = {"sse4.1", "true"})
// Note: also works with NEON/asimd, but only with TieredCompilation.
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"},
applyIf = {"TieredCompilation", "true"})
// IR check only works with TieredCompilation. Needs to make it
// work with -XX:-TieredCompilation in future (see JDK-8378640).
public Object iotaI_VectorAPI(int[] r) {
return VectorAlgorithmsImpl.iotaI_VectorAPI(r);
}
@ -360,7 +362,7 @@ public class TestVectorAlgorithms {
@IR(counts = {IRNode.LOAD_VECTOR_F, "> 0",
IRNode.ADD_REDUCTION_V, "> 0",
IRNode.MUL_VF, "> 0"},
applyIfCPUFeature = {"sse4.1", "true"},
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"},
applyIf = {"UseSuperWord", "true"})
public float dotProductF_VectorAPI_naive(float[] a, float[] b) {
return VectorAlgorithmsImpl.dotProductF_VectorAPI_naive(a, b);
@ -370,7 +372,7 @@ public class TestVectorAlgorithms {
@IR(counts = {IRNode.LOAD_VECTOR_F, "> 0",
IRNode.ADD_REDUCTION_V, "> 0",
IRNode.MUL_VF, "> 0"},
applyIfCPUFeature = {"sse4.1", "true"},
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"},
applyIf = {"UseSuperWord", "true"})
public float dotProductF_VectorAPI_reduction_after_loop(float[] a, float[] b) {
return VectorAlgorithmsImpl.dotProductF_VectorAPI_reduction_after_loop(a, b);
@ -392,7 +394,8 @@ public class TestVectorAlgorithms {
IRNode.MUL_VI, IRNode.VECTOR_SIZE_8, "> 0",
IRNode.ADD_VI, IRNode.VECTOR_SIZE_8, "> 0",
IRNode.ADD_REDUCTION_VI, "> 0"},
applyIfCPUFeature = {"avx2", "true"})
applyIfCPUFeatureOr = {"avx2", "true", "sve", "true"},
applyIf = {"MaxVectorSize", ">=32"})
public int hashCodeB_VectorAPI_v1(byte[] a) {
return VectorAlgorithmsImpl.hashCodeB_VectorAPI_v1(a);
}
@ -402,7 +405,7 @@ public class TestVectorAlgorithms {
IRNode.MUL_VI, "> 0",
IRNode.ADD_VI, "> 0",
IRNode.ADD_REDUCTION_VI, "> 0"},
applyIfCPUFeature = {"avx2", "true"})
applyIfCPUFeatureOr = {"avx2", "true", "asimd", "true"})
public int hashCodeB_VectorAPI_v2(byte[] a) {
return VectorAlgorithmsImpl.hashCodeB_VectorAPI_v2(a);
}
@ -506,7 +509,7 @@ public class TestVectorAlgorithms {
IRNode.VECTOR_TEST, "> 0",
IRNode.COMPRESS_VI, "> 0",
IRNode.STORE_VECTOR_MASKED, "> 0"},
applyIfCPUFeature = {"avx2", "true"})
applyIfCPUFeatureOr = {"avx2", "true", "sve", "true"})
public Object filterI_VectorAPI(int[] a, int[] r, int threshold) {
return VectorAlgorithmsImpl.filterI_VectorAPI(a, r, threshold);
}
@ -526,7 +529,10 @@ public class TestVectorAlgorithms {
IRNode.OR_V_MASK, "> 0",
IRNode.ADD_VI, "> 0",
IRNode.ADD_REDUCTION_VI, "> 0"},
applyIfCPUFeatureOr = {"avx512", "true", "sve", "true"})
applyIfCPUFeatureOr = {"avx512", "true", "sve", "true"},
applyIf = {"TieredCompilation", "true"})
// IR check only works with TieredCompilation. Needs to make it
// work with -XX:-TieredCompilation in future (see JDK-8378640).
public int reduceAddIFieldsX4_VectorAPI(int[] oops, int[] mem) {
return VectorAlgorithmsImpl.reduceAddIFieldsX4_VectorAPI(oops, mem);
}