C2: CompileCommand PrintIdealPhase should also print nodes that are not "reachable from below"

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: 27
    • Component/s: hotspot

      [~rcastanedalo] Said that [~dskantz] had encountered this issue before:

      PrintIdealPhase seems to only traverse the graph "from below". So if there are any nodes that are not reachable "from below" but only reachable "from above", then they do not show up in the printing.
      That is problematic: out TestFramework relies on that output, especially if you have some IR rule with failOn or count = 0 . The node would be in the graph, but the test tells you there is none.

      I had the idea to reproduce it with an infinite loop:

      ./java -XX:CompileCommand=PrintIdealPhase,*::*,ITER_GVN1,PHASEIDEALLOOP1 -XX:CompileCommand=compileonly,Test::test -XX:CompileCommand=printcompilation,Test::test -Xcomp -XX:-CICompileOSR Test.java

      The Test.java is attached, and also the output.txt.

      You can see that the LoadI and StoreI do NOT show up during ITER_GVN1.
      This is because at that point, the infinite loop has no exit. So the loop is not connected down to Root.
      But once we do a first loop opts round, we see the LoadI and StoreI in PHASEIDEALLOOP1.
      This is because we insert a NeverBranch, which serves as an artificial exit, that connects the loop down to Root.

        1. output.txt
          15 kB
          Emanuel Peter
        2. Test.java
          0.2 kB
          Emanuel Peter

            Assignee:
            Emanuel Peter
            Reporter:
            Emanuel Peter
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: