JDK-8293849 : PrintIdealPhase in compiler directives file is ignored when used with other compile commands
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 19,20
  • Priority: P5
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-09-15
  • Updated: 2022-09-26
  • Resolved: 2022-09-19
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 20
20 b16Fixed
Related Reports
Relates :  
Description
When using a file commands.json with PrintIdealPhase:
[
  {
    match : "Test::*",
    log : true,
    PrintIdealPhase : "BEFORE_MATCHING"
  }
]

together with other compile commands specified in compilerdirectives_common_flags and/or compilerdirectives_c2_flags, then the PrintIdealPhase option is ignored.

Example:

class Test {
    public static void main(String[] args) {
        for (int i = 0; i < 10000; i++) {
            test();
        }
    }

    public static void test() {}
}

Without additional compile command - prints ideal graph of phase AFTER_PARSING:
$ java -Xcomp -XX:-TieredCompilation -XX:CompileOnly=Test -XX:CompilerDirectivesFile=commands.json Test.java

With additional compile command - only prints inlining information but no ideal graph:
$ java -Xcomp -XX:-TieredCompilation -XX:CompileOnly=Test -XX:CompilerDirectivesFile=commands.json -XX:CompileCommand=PrintInlining,Test::*,true Test.java
Comments
Changeset: d41f69f9 Author: Christian Hagedorn <chagedorn@openjdk.org> Date: 2022-09-19 10:16:21 +0000 URL: https://git.openjdk.org/jdk/commit/d41f69f9c0297fe78884b5aa2d149745215ec9d2
19-09-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/10283 Date: 2022-09-15 11:20:06 +0000
15-09-2022

ILW = Ignored directive from directives file when using together with compile command, only with directives file and compile command, no workaround = LLH = P5
15-09-2022