RFR: 8291809: Convert compiler/c2/cr7200264/TestSSE2IntVect.java to IR verification test [v2]
Emanuel Peter
epeter at openjdk.org
Thu Jan 18 13:36:16 UTC 2024
On Thu, 18 Jan 2024 13:06:53 GMT, Daniel Lundén <dlunden at openjdk.org> wrote:
>> And is that really necessary?
>> I don't see the flag in the IR Framework whitelist:
>> `test/hotspot/jtreg/compiler/lib/ir_framework/TestFramework.java`
>>
>> That would mean that if you do set the flag, then we would already disable the IR rules, but we could still run the tests, checking for correctness.
>>
>> TLDR: I believe we should just be able to remove this flag completely.
>
> Isn't that whitelist only for flags passed down through JTREG? For example, when I add `"-XX:LoopUnrollLimit=0"` (not in the whitelist) to the `runWithFlags` arguments, all the IR tests fail.
Ok then, let me explain IR Framework whitelists, and `runWithFlags`:
Generally, we want a test to be run from the outside with as many flag combinations as possible, since some bugs only trigger with strange combinations.
On the other hand, we need some way to say under what conditions an IR rule should be checked, because many flags might have side-effects on the IR, and disable all sorts of optimizations.
We chose the whitelist approach: those flags are expected generally not to change the IR, or change it in a way that could also happen on other machines, and therefore must be allowed to simulate those machines (e.g. UseAVX).
If you have a test that is not ok with any combination of the whitelisted flags, then the test must further restrict the IR rule with `applyIf` statements.
Sometimes, we want to make sure that IR rules are ok with flag settings that are not allowed by the whitelist, for example `OptimizeFill` (it has an effect, but maybe an effect we want to check for in a specific test). Or maybe we want to overwrite some flag setting for specific reasons (put up some node limit, etc). In those cases, it can make sense to use `runWithFlags`.
In the case of this test, I don't see why you would want to set `-XX:LoopUnrollLimit=0` via `runWithFlags`. Of course this makes all tests fail, because it messes up unrolling, and without unrolling you have no SuperWord, and without SuperWord you have no vectorization.
But if anybody were to set this flag from the outside (via JTREG), then it would disable the IR rules implicitly (because the flag is not on the whitelist), and the jtreg test would pass as a whole.
Does that make sense, and help?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17428#discussion_r1457440109
More information about the hotspot-compiler-dev
mailing list