RFR: 8309697: [TESTBUG] Remove "@requires vm.flagless" from jtreg vectorization tests

Pengfei Li pli at openjdk.org
Mon Jul 31 07:46:53 UTC 2023


On Wed, 26 Jul 2023 18:18:16 GMT, Vladimir Kozlov <kvn 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.
>
> test/hotspot/jtreg/compiler/vectorization/runner/VectorizationTestRunner.java line 69:
> 
>> 67:         boolean use_comp = WB.getBooleanVMFlag("UseCompiler");
>> 68:         boolean bg_comp = WB.getBooleanVMFlag("BackgroundCompilation");
>> 69:         if (use_intp && use_comp && bg_comp) {
> 
> Why you check `BackgroundCompilation`?
> For `-Xcomp` you need only check `UseInterpreter`.
> Xor `-Xint` you need only check `UseCompiler`.

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.

I just experimented an alternative approach that running reference result with C1 execution instead of interpretation. In this way we can run with background compilation off. What do you think of this new approach?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/15011#discussion_r1278905480


More information about the hotspot-compiler-dev mailing list