mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-20 04:43:32 +00:00
8357694: RISC-V: Several IR verification tests fail when vlen=128
Reviewed-by: mhaessig, fyang, mli
This commit is contained in:
parent
644e400cd1
commit
15b5b54ac7
@ -296,7 +296,11 @@ public class TestIfMinMax {
|
||||
|
||||
@Test
|
||||
@IR(applyIf = { "SuperWordReductions", "true" },
|
||||
applyIfCPUFeatureOr = { "avx512", "true", "rvv", "true" },
|
||||
applyIfCPUFeature = { "avx512", "true" },
|
||||
counts = { IRNode.MAX_REDUCTION_V, "> 0" })
|
||||
@IR(applyIfPlatform = {"riscv64", "true"},
|
||||
applyIfAnd = { "SuperWordReductions", "true", "MaxVectorSize", ">=32" },
|
||||
applyIfCPUFeature = { "rvv", "true" },
|
||||
counts = { IRNode.MAX_REDUCTION_V, "> 0" })
|
||||
@Arguments(setup = "setupLongArrays")
|
||||
public Object[] testMaxLongReduction(long[] a, long[] b) {
|
||||
@ -331,7 +335,11 @@ public class TestIfMinMax {
|
||||
|
||||
@Test
|
||||
@IR(applyIf = { "SuperWordReductions", "true" },
|
||||
applyIfCPUFeatureOr = { "avx512", "true", "rvv", "true" },
|
||||
applyIfCPUFeature = { "avx512", "true" },
|
||||
counts = { IRNode.MIN_REDUCTION_V, "> 0" })
|
||||
@IR(applyIfPlatform = {"riscv64", "true"},
|
||||
applyIfAnd = { "SuperWordReductions", "true", "MaxVectorSize", ">=32" },
|
||||
applyIfCPUFeature = { "rvv", "true" },
|
||||
counts = { IRNode.MIN_REDUCTION_V, "> 0" })
|
||||
@Arguments(setup = "setupLongArrays")
|
||||
public Object[] testMinLongReduction(long[] a, long[] b) {
|
||||
|
||||
@ -140,7 +140,7 @@ public class RedTest_long {
|
||||
counts = {IRNode.ADD_REDUCTION_VL, ">= 1", IRNode.ADD_REDUCTION_VL, "<= 2"}) // one for main-loop, one for vector-post-loop
|
||||
@IR(applyIfPlatform = {"riscv64", "true"},
|
||||
applyIfCPUFeature = {"rvv", "true"},
|
||||
applyIfAnd = {"SuperWordReductions", "true", "LoopMaxUnroll", ">= 8"},
|
||||
applyIfAnd = {"SuperWordReductions", "true", "LoopMaxUnroll", ">= 8", "MaxVectorSize", ">=32"},
|
||||
counts = {IRNode.ADD_REDUCTION_VL, ">= 1", IRNode.ADD_REDUCTION_VL, "<= 2"}) // one for main-loop, one for vector-post-loop
|
||||
public static long sumReductionImplement(
|
||||
long[] a,
|
||||
@ -162,7 +162,7 @@ public class RedTest_long {
|
||||
counts = {IRNode.OR_REDUCTION_V, ">= 1", IRNode.OR_REDUCTION_V, "<= 2"}) // one for main-loop, one for vector-post-loop
|
||||
@IR(applyIfPlatform = {"riscv64", "true"},
|
||||
applyIfCPUFeature = {"rvv", "true"},
|
||||
applyIfAnd = {"SuperWordReductions", "true", "LoopMaxUnroll", ">= 8"},
|
||||
applyIfAnd = {"SuperWordReductions", "true", "LoopMaxUnroll", ">= 8", "MaxVectorSize", ">=32"},
|
||||
counts = {IRNode.OR_REDUCTION_V, ">= 1", IRNode.OR_REDUCTION_V, "<= 2"}) // one for main-loop, one for vector-post-loop
|
||||
public static long orReductionImplement(
|
||||
long[] a,
|
||||
@ -184,7 +184,7 @@ public class RedTest_long {
|
||||
counts = {IRNode.AND_REDUCTION_V, ">= 1", IRNode.AND_REDUCTION_V, "<= 2"}) // one for main-loop, one for vector-post-loop
|
||||
@IR(applyIfPlatform = {"riscv64", "true"},
|
||||
applyIfCPUFeature = {"rvv", "true"},
|
||||
applyIfAnd = {"SuperWordReductions", "true", "LoopMaxUnroll", ">= 8"},
|
||||
applyIfAnd = {"SuperWordReductions", "true", "LoopMaxUnroll", ">= 8", "MaxVectorSize", ">=32"},
|
||||
counts = {IRNode.AND_REDUCTION_V, ">= 1", IRNode.AND_REDUCTION_V, "<= 2"}) // one for main-loop, one for vector-post-loop
|
||||
public static long andReductionImplement(
|
||||
long[] a,
|
||||
@ -206,7 +206,7 @@ public class RedTest_long {
|
||||
counts = {IRNode.XOR_REDUCTION_V, ">= 1", IRNode.XOR_REDUCTION_V, "<= 2"}) // one for main-loop, one for vector-post-loop
|
||||
@IR(applyIfPlatform = {"riscv64", "true"},
|
||||
applyIfCPUFeature = {"rvv", "true"},
|
||||
applyIfAnd = {"SuperWordReductions", "true", "LoopMaxUnroll", ">= 8"},
|
||||
applyIfAnd = {"SuperWordReductions", "true", "LoopMaxUnroll", ">= 8", "MaxVectorSize", ">=32"},
|
||||
counts = {IRNode.XOR_REDUCTION_V, ">= 1", IRNode.XOR_REDUCTION_V, "<= 2"}) // one for main-loop, one for vector-post-loop
|
||||
public static long xorReductionImplement(
|
||||
long[] a,
|
||||
@ -228,7 +228,7 @@ public class RedTest_long {
|
||||
counts = {IRNode.MUL_REDUCTION_VL, ">= 1", IRNode.MUL_REDUCTION_VL, "<= 2"}) // one for main-loop, one for vector-post-loop
|
||||
@IR(applyIfPlatform = {"riscv64", "true"},
|
||||
applyIfCPUFeature = {"rvv", "true"},
|
||||
applyIfAnd = {"SuperWordReductions", "true", "LoopMaxUnroll", ">= 8"},
|
||||
applyIfAnd = {"SuperWordReductions", "true", "LoopMaxUnroll", ">= 8", "MaxVectorSize", ">=32"},
|
||||
counts = {IRNode.MUL_REDUCTION_VL, ">= 1", IRNode.MUL_REDUCTION_VL, "<= 2"}) // one for main-loop, one for vector-post-loop
|
||||
public static long mulReductionImplement(
|
||||
long[] a,
|
||||
|
||||
@ -98,7 +98,7 @@ public class SumRed_Long {
|
||||
counts = {IRNode.ADD_REDUCTION_VL, ">= 1", IRNode.ADD_REDUCTION_VL, "<= 2"}) // one for main-loop, one for vector-post-loop
|
||||
@IR(applyIfPlatform = {"riscv64", "true"},
|
||||
applyIfCPUFeature = {"rvv", "true"},
|
||||
applyIfAnd = {"SuperWordReductions", "true", "LoopMaxUnroll", ">= 8"},
|
||||
applyIfAnd = {"SuperWordReductions", "true", "LoopMaxUnroll", ">= 8", "MaxVectorSize", ">=32"},
|
||||
counts = {IRNode.ADD_REDUCTION_VL, ">= 1", IRNode.ADD_REDUCTION_VL, "<= 2"}) // one for main-loop, one for vector-post-loop
|
||||
public static long sumReductionImplement(
|
||||
long[] a,
|
||||
|
||||
@ -81,10 +81,14 @@ public class TestGeneralizedReductions {
|
||||
}
|
||||
|
||||
@Test
|
||||
@IR(applyIfCPUFeatureOr = {"avx2", "true", "rvv", "true"},
|
||||
@IR(applyIfCPUFeature = {"avx2", "true"},
|
||||
applyIf = {"SuperWordReductions", "true"},
|
||||
applyIfPlatform = {"64-bit", "true"},
|
||||
counts = {IRNode.ADD_REDUCTION_VI, ">= 1"})
|
||||
@IR(applyIfPlatform = {"riscv64", "true"},
|
||||
applyIfCPUFeature = {"rvv", "true"},
|
||||
applyIfAnd = {"SuperWordReductions", "true", "MaxVectorSize", ">=32"},
|
||||
counts = {IRNode.ADD_REDUCTION_VI, ">= 1"})
|
||||
private static long testReductionOnGlobalAccumulator(long[] array) {
|
||||
acc = 0;
|
||||
for (int i = 0; i < array.length; i++) {
|
||||
@ -94,10 +98,14 @@ public class TestGeneralizedReductions {
|
||||
}
|
||||
|
||||
@Test
|
||||
@IR(applyIfCPUFeatureOr = {"avx2", "true", "rvv", "true"},
|
||||
@IR(applyIfCPUFeature = {"avx2", "true"},
|
||||
applyIf = {"SuperWordReductions", "true"},
|
||||
applyIfPlatform = {"64-bit", "true"},
|
||||
counts = {IRNode.ADD_REDUCTION_VI, ">= 1"})
|
||||
@IR(applyIfPlatform = {"riscv64", "true"},
|
||||
applyIfCPUFeature = {"rvv", "true"},
|
||||
applyIfAnd = {"SuperWordReductions", "true", "MaxVectorSize", ">=32"},
|
||||
counts = {IRNode.ADD_REDUCTION_VI, ">= 1"})
|
||||
private static long testReductionOnPartiallyUnrolledLoop(long[] array) {
|
||||
int sum = 0;
|
||||
for (int i = 0; i < array.length / 2; i++) {
|
||||
@ -108,10 +116,14 @@ public class TestGeneralizedReductions {
|
||||
}
|
||||
|
||||
@Test
|
||||
@IR(applyIfCPUFeatureOr = {"avx2", "true", "rvv", "true"},
|
||||
@IR(applyIfCPUFeature = {"avx2", "true"},
|
||||
applyIf = {"SuperWordReductions", "true"},
|
||||
applyIfPlatform = {"64-bit", "true"},
|
||||
counts = {IRNode.ADD_REDUCTION_VI, ">= 1"})
|
||||
@IR(applyIfPlatform = {"riscv64", "true"},
|
||||
applyIfCPUFeature = {"rvv", "true"},
|
||||
applyIfAnd = {"SuperWordReductions", "true", "MaxVectorSize", ">=32"},
|
||||
counts = {IRNode.ADD_REDUCTION_VI, ">= 1"})
|
||||
private static long testReductionOnLargePartiallyUnrolledLoop(long[] array) {
|
||||
int sum = 0;
|
||||
for (int i = 0; i < array.length / 8; i++) {
|
||||
|
||||
@ -66,7 +66,19 @@ public class TestUnorderedReductionPartialVectorization {
|
||||
IRNode.OR_REDUCTION_V, "> 0",},
|
||||
applyIfOr = {"AlignVector", "false", "UseCompactObjectHeaders", "false"},
|
||||
applyIfPlatform = {"64-bit", "true"},
|
||||
applyIfCPUFeatureOr = {"avx2", "true", "rvv", "true"})
|
||||
applyIfCPUFeature = {"avx2", "true"})
|
||||
@IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE + "min(max_int, max_long)", "> 0",
|
||||
IRNode.VECTOR_CAST_I2L, IRNode.VECTOR_SIZE + "min(max_int, max_long)", "> 0",
|
||||
IRNode.OR_REDUCTION_V, "> 0",},
|
||||
applyIfAnd = {"AlignVector", "false", "MaxVectorSize", ">=32"},
|
||||
applyIfPlatform = {"riscv64", "true"},
|
||||
applyIfCPUFeature = {"rvv", "true"})
|
||||
@IR(counts = {IRNode.LOAD_VECTOR_I, IRNode.VECTOR_SIZE + "min(max_int, max_long)", "> 0",
|
||||
IRNode.VECTOR_CAST_I2L, IRNode.VECTOR_SIZE + "min(max_int, max_long)", "> 0",
|
||||
IRNode.OR_REDUCTION_V, "> 0",},
|
||||
applyIfAnd = {"UseCompactObjectHeaders", "false", "MaxVectorSize", ">=32"},
|
||||
applyIfPlatform = {"riscv64", "true"},
|
||||
applyIfCPUFeature = {"rvv", "true"})
|
||||
static long test1(int[] data, long sum) {
|
||||
for (int i = 0; i < data.length; i+=2) {
|
||||
// Mixing int and long ops means we only end up allowing half of the int
|
||||
|
||||
@ -177,7 +177,11 @@ public class LoopReductionOpTest extends VectorizationTestRunner {
|
||||
@Test
|
||||
@IR(applyIfCPUFeatureOr = {"asimd", "true", "sse2", "true", "rvv", "true"},
|
||||
counts = {IRNode.STORE_VECTOR, ">0"})
|
||||
@IR(applyIfCPUFeatureOr = {"avx2", "true", "rvv", "true"},
|
||||
@IR(applyIfCPUFeature = {"avx2", "true"},
|
||||
counts = {IRNode.ADD_REDUCTION_V, ">0"})
|
||||
@IR(applyIfPlatform = {"riscv64", "true"},
|
||||
applyIfCPUFeature = {"rvv", "true"},
|
||||
applyIf = {"MaxVectorSize", ">=32" },
|
||||
counts = {IRNode.ADD_REDUCTION_V, ">0"})
|
||||
public long reductionWithNonReductionDifferentSizes() {
|
||||
long res = 0L;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user