-
Enhancement
-
Resolution: Unresolved
-
P4
-
23
By accident, I discovered that PopulateIndex does not work very well with L/F/D. I added these lines to
/oracle-work/jdk-fork2/open/test/hotspot/jtreg/compiler/vectorization/runner/ArrayIndexFillTest.java
The culprit is that we split the ConvI2L/D/F through the AddI, at least in some cases of the pack, and that confuses the packing logic. If init/limit are variable, the split cannot happen, and it vectorizes.
Not sure if this can be fixed, or is worth fixing.
@Test
@IR(applyIfCPUFeatureOr = {"sve", "true", "avx2", "true"},
counts = {IRNode.POPULATE_INDEX, "=0"})
// The ConvI2L can be split through the AddI, creating a mix of
// ConvI2L(AddI) and AddL(ConvI2L) cases, which do not vectorize.
public long[] fillLongArray() {
long[] res = new long[SIZE];
for (int i = 0; i < SIZE; i++) {
res[i] = i;
}
return res;
}
@Test
@IR(applyIfCPUFeatureOr = {"sve", "true", "avx2", "true"},
counts = {IRNode.POPULATE_INDEX, ">0"})
// The variable init/limit has the consequence that we do not split
// the ConvI2L through the AddI.
public long[] fillLongArray2() {
long[] res = new long[SIZE];
for (int i = init; i < limit; i++) {
res[i] = i;
}
return res;
}
@Test
@IR(applyIfCPUFeatureOr = {"sve", "true", "avx2", "true"},
counts = {IRNode.POPULATE_INDEX, "=0"})
public float[] fillFloatArray() {
float[] res = new float[SIZE];
for (int i = 0; i < SIZE; i++) {
res[i] = i;
}
return res;
}
@Test
@IR(applyIfCPUFeatureOr = {"sve", "true", "avx2", "true"},
counts = {IRNode.POPULATE_INDEX, ">0"})
public float[] fillFloatArray2() {
float[] res = new float[SIZE];
for (int i = init; i < limit; i++) {
res[i] = i;
}
return res;
}
@Test
@IR(applyIfCPUFeatureOr = {"sve", "true", "avx2", "true"},
counts = {IRNode.POPULATE_INDEX, "=0"})
public double[] fillDoubleArray() {
double[] res = new double[SIZE];
for (int i = 0; i < SIZE; i++) {
res[i] = i;
}
return res;
}
@Test
@IR(applyIfCPUFeatureOr = {"sve", "true", "avx2", "true"},
counts = {IRNode.POPULATE_INDEX, ">0"})
public double[] fillDoubleArray2() {
double[] res = new double[SIZE];
for (int i = init; i < limit; i++) {
res[i] = i;
}
return res;
}
/oracle-work/jdk-fork2/open/test/hotspot/jtreg/compiler/vectorization/runner/ArrayIndexFillTest.java
The culprit is that we split the ConvI2L/D/F through the AddI, at least in some cases of the pack, and that confuses the packing logic. If init/limit are variable, the split cannot happen, and it vectorizes.
Not sure if this can be fixed, or is worth fixing.
@Test
@IR(applyIfCPUFeatureOr = {"sve", "true", "avx2", "true"},
counts = {IRNode.POPULATE_INDEX, "=0"})
// The ConvI2L can be split through the AddI, creating a mix of
// ConvI2L(AddI) and AddL(ConvI2L) cases, which do not vectorize.
public long[] fillLongArray() {
long[] res = new long[SIZE];
for (int i = 0; i < SIZE; i++) {
res[i] = i;
}
return res;
}
@Test
@IR(applyIfCPUFeatureOr = {"sve", "true", "avx2", "true"},
counts = {IRNode.POPULATE_INDEX, ">0"})
// The variable init/limit has the consequence that we do not split
// the ConvI2L through the AddI.
public long[] fillLongArray2() {
long[] res = new long[SIZE];
for (int i = init; i < limit; i++) {
res[i] = i;
}
return res;
}
@Test
@IR(applyIfCPUFeatureOr = {"sve", "true", "avx2", "true"},
counts = {IRNode.POPULATE_INDEX, "=0"})
public float[] fillFloatArray() {
float[] res = new float[SIZE];
for (int i = 0; i < SIZE; i++) {
res[i] = i;
}
return res;
}
@Test
@IR(applyIfCPUFeatureOr = {"sve", "true", "avx2", "true"},
counts = {IRNode.POPULATE_INDEX, ">0"})
public float[] fillFloatArray2() {
float[] res = new float[SIZE];
for (int i = init; i < limit; i++) {
res[i] = i;
}
return res;
}
@Test
@IR(applyIfCPUFeatureOr = {"sve", "true", "avx2", "true"},
counts = {IRNode.POPULATE_INDEX, "=0"})
public double[] fillDoubleArray() {
double[] res = new double[SIZE];
for (int i = 0; i < SIZE; i++) {
res[i] = i;
}
return res;
}
@Test
@IR(applyIfCPUFeatureOr = {"sve", "true", "avx2", "true"},
counts = {IRNode.POPULATE_INDEX, ">0"})
public double[] fillDoubleArray2() {
double[] res = new double[SIZE];
for (int i = init; i < limit; i++) {
res[i] = i;
}
return res;
}
- relates to
-
JDK-8333647 C2 SuperWord: some additional PopulateIndex tests
- Resolved