RFR: 8309697: [TESTBUG] Remove "@requires vm.flagless" from jtreg vectorization tests [v2]
Vladimir Kozlov
kvn at openjdk.org
Thu Aug 3 19:29:30 UTC 2023
On Wed, 2 Aug 2023 08:51:19 GMT, Pengfei Li <pli at openjdk.org> wrote:
>> This patch removes `@require vm.flagless` annotations from HotSpot jtreg tests in `compiler/vectorization/runner`. All jtreg cases in this folder are invoked by test driver `VectorizationTestRunner.java` which checks both correctness and vectorizability (IR) for each test method. We added flagless requirement before because extra flags may mess with compiler control in the test driver for correctness check. But `flagless` has a side effect that it makes tests with extra flags skipped. So we propose to get rid of it now.
>>
>> To adapt the removal of `@require vm.flagless`, a few checks are added in the test driver to skip the correctness check if extra flags make the compiler control not work. This patch also moves previously hard-coded flag `-XX:-OptimizeFill` in the test driver to conditions in IR checks.
>>
>> Tested various of compiler control related VM flags on x86 and AArch64.
>
> Pengfei Li has updated the pull request incrementally with one additional commit since the last revision:
>
> Re-work correctness check to allow "-Xbatch"
Thank you for addressing the test issue.
About your change to allow -Xbatch. Let me clarify, if you exclude `-Xcomp` mode (which I agree with) by checking `UseInterpreter` flag for `true`, then a method could be always executed in Interpeter to get reference result (even with -XX:CompileThreshold=100) by calling method once first (we do that in other tests).
You don't need to limit test to `Tiered` mode when Interpreter is available and original test code should work.
>For -Xbatch we need check BackgroundCompilation. As we lock the compilation before running the test method in the interpreter to get reference result, the VM will hang if both background compilation is disabled and the compilation is locked by WhiteBox.
You don't need to call `WB.lockCompilation()` if you exclude `-Xcomp` mode. There will be no compilation requests for called method when you call the method first time because compilation threshold will not be reached - it is guarantee that method will be executed in Interpreter. And you have the assert to verify that.
Note, this work with and without BackgroundCompilation enabled. If you called a method once it will be executed in Interpreter if `-Xcomp` is excluded.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/15011#issuecomment-1664513886
More information about the hotspot-compiler-dev
mailing list