RFR: 8287525: Extend IR annotation with new options to test specific target feature. [v3]
Christian Hagedorn
chagedorn at openjdk.java.net
Thu Jun 9 11:28:37 UTC 2022
On Thu, 9 Jun 2022 11:03:54 GMT, Swati Sharma <duke at openjdk.java.net> wrote:
>> test/hotspot/jtreg/compiler/lib/ir_framework/test/IREncodingPrinter.java line 201:
>>
>>> 199: applyRules++;
>>> 200: TestFormat.checkNoThrow((irAnno.applyIfCPUFeatureOr().length % 2) == 0,
>>> 201: "Argument count for applyIfCPUFeatureOr should be multiple of two" + failAt());
>>
>> The format check on L208 cannot be used like that anymore (I can somehow not comment on lines that are hidden):
>>
>> TestFormat.checkNoThrow(applyRules <= 1,
>> "Can only specify one apply constraint " + failAt());
>>
>> We should be allowed to specify one `applyIf*` flag constraint together with one `applyIfCPUFeature*` constraint while not being allowed to specify multiple `applyIf*` flag constraints and/or multiple `applyIfCPUFeature*` constraints.
>
> Do you suggest commenting out check on L208 to enable application of multiple applyIf* constraints OR should that be handled in a separate RFE.
I think we should keep it as specifying multiple constraint attributes of the same kind (flag or CPU feature) should not be allowed. But we need separate the count (`applyRules`) for the flag based constraints and the CPU feature based constraints. You could rename `applyRules` -> `flagConstraints` and change the ones belonging to the new CPU features to `cpuFeatureConstraints`. Then you can have these checks here, for example:
TestFormat.checkNoThrow(flagConstraints <= 1, "Can only specify one flag constraint" + failAt());
TestFormat.checkNoThrow(cpuFeatureConstraints <= 1, "Can only specify one CPU feature constraint" + failAt());
-------------
PR: https://git.openjdk.java.net/jdk/pull/8999
More information about the hotspot-compiler-dev
mailing list