Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8359121

C2: Region added by vectorizedMismatch intrinsic can survive as a dead node after IGVN

XMLWordPrintable

    • master

      vectorizedMismatch intrinsic creates a Region node that can have a single input, it can then be simplified away. During IGVN, a situation such as
      ```
      Proj -> Region -> If -> ...
      ```
      becomes
      ```
      Proj -> Region (dead)
             -> If -> ...
      ```
      Yet, the Region node stays in the graph until the end of IGVN, despite being dead.

      This makes an upcoming check of JDK-8350864 fail: control nodes must have one control successor (except for If, and similar). The node is dropped before the next round of loop optimization, as we then remove dead nodes.

      Reproducer can be run with
      ```
      java -Xcomp --add-exports java.base/jdk.internal.util=ALL-UNNAMED -XX:CompileCommand=compileonly,"Test::test*" Test.java
      ```
      possibly with `-XX:PrintIdealGraphLevel=6` to see something, as it doesn't crash yet.

        1. 1-AfterParsing.png
          1-AfterParsing.png
          17 kB
        2. 2-AfterIGVN1.png
          2-AfterIGVN1.png
          24 kB
        3. 3-AfterIGVN1.after-fix.png
          3-AfterIGVN1.after-fix.png
          14 kB
        4. Test.java
          0.4 kB

            mchevalier Marc Chevalier
            mchevalier Marc Chevalier
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: