RFR: 8254129: IR Test Framework to support regex-based matching on the IR in JTreg compiler tests [v6]

Christian Hagedorn chagedorn at openjdk.java.net
Tue Apr 27 15:25:43 UTC 2021

On Mon, 26 Apr 2021 23:54:44 GMT, John Tortugo <github.com+2249648+JohnTortugo at openjdk.org> wrote:

>> Christian Hagedorn has updated the pull request incrementally with one additional commit since the last revision:
>>   Review comments by Tobias: Formatting fields, spacing, README.md typos and cleanup
> test/lib/jdk/test/lib/hotspot/ir_framework/TestFrameworkExecution.java line 308:
>> 306: 
>> 307:     private void processControlAnnotations(Class<?> clazz) {
>> 308:         if (!XCOMP) {
> Perhaps transform this condition on an early return, i.e., "if (XCOMP) return ;", instead of nesting the whole method under the if.

This handling with `XCOMP` (and other related ones) seem to be wrong and only worked like that in the old Valhalla framework. I don't think it is correct like that anymore. I discussed it with @TobiHartmann and thus added a new debug flag `-DIgnoreCompilerControls` to achieve the same functionality as in the old framework. I will push this update in a separate commit.

> test/lib/jdk/test/lib/hotspot/ir_framework/TestFrameworkExecution.java line 373:
>> 371:         boolean exclude = random.nextBoolean();
>> 372:         CompLevel level = CompLevel.ANY;
>> 373:         if (exclude) {
> Transform to early return?

I refactored the code relating to `ExcludeRandom`.

> test/lib/jdk/test/lib/hotspot/ir_framework/TestFrameworkExecution.java line 378:
>> 376:                 case 1 -> {
>> 377:                     level = CompLevel.C1;
>> 378:                     WHITE_BOX.makeMethodNotCompilable(ex, CompLevel.C2.getValue(), false);
> I'm curious why two calls (with different values for the last parameter) are needed for these?

The parameter is for [osr](https://github.com/openjdk/jdk/blob/dc323a933401e4e540cdc416de5260923f42ba7f/src/hotspot/share/prims/whitebox.cpp#L928-L937): We need to exclude the method for osr and for normal compilations.


PR: https://git.openjdk.java.net/jdk/pull/3508

More information about the hotspot-compiler-dev mailing list