-
Enhancement
-
Resolution: Not an Issue
-
P4
-
20
We'd like to support multiple @IR annotations targeting different platforms in IR Framework tests. For instance, consider the following annotations:
@Test
@IR(applyIfCPUFeature = {"sse", "true"},
applyIfAnd = {"SuperWordReductions", "true", "UseSSE", ">= 1",
"LoopMaxUnroll", ">= 8"},
counts = {IRNode.MUL_REDUCTION_VF, ">= 1"})
@IR(applyIfCPUFeature = {"sve", "true"},
applyIfAnd = {"SuperWordReductions", "true", "UseSVE", ">= 1", "LoopMaxUnroll", ">= 8"},
counts = {IRNode.MUL_REDUCTION_VF, ">= 1"})
To co-locate tests from different platforms, we can use applyIfCPUFeature. To guard against failure when the user selects a non-default value for UseSVE/UseSSE, we check the corresponding flag as well in applyIfAnd. But UseSVE does not exist on x64, so the test will fail.
One solution could be to re-arrange the order of checks in IREncodingPrinter.java, placing applyIf{and,or}CPUFeature before applyIf{,and,or}.
@Test
@IR(applyIfCPUFeature = {"sse", "true"},
applyIfAnd = {"SuperWordReductions", "true", "UseSSE", ">= 1",
"LoopMaxUnroll", ">= 8"},
counts = {IRNode.MUL_REDUCTION_VF, ">= 1"})
@IR(applyIfCPUFeature = {"sve", "true"},
applyIfAnd = {"SuperWordReductions", "true", "UseSVE", ">= 1", "LoopMaxUnroll", ">= 8"},
counts = {IRNode.MUL_REDUCTION_VF, ">= 1"})
To co-locate tests from different platforms, we can use applyIfCPUFeature. To guard against failure when the user selects a non-default value for UseSVE/UseSSE, we check the corresponding flag as well in applyIfAnd. But UseSVE does not exist on x64, so the test will fail.
One solution could be to re-arrange the order of checks in IREncodingPrinter.java, placing applyIf{and,or}CPUFeature before applyIf{,and,or}.