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

C2: Reuse cmp condition codes in adjacent basic blocks

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 16
    • Fix Version/s: tbd
    • Component/s: hotspot
    • Labels:

      Description

      In the attached program Foo.java, The C2-generated x86_64 code performs the test cmpl RSI, #1 twice in adjacent blocks. The second cmpl is redundant and could be just removed.

      $ java -Xcomp -XX:-TieredCompilation -XX:CompileOnly=Foo::foo -XX:+PrintOptoAssembly -XX:LoopUnrollLimit=0 Foo.java
      (..)
      033 cmpl RSI, #1
      036 je,s B5 P=0,200000 C=1,000000

      038 B2: # out( B5 B3 ) <- in( B1 ) Freq: 0,8
      038 cmpl RSI, #1
      (..)

      The assembly-level CFG is attached for clarity.

        Attachments

        1. cfg.pdf
          32 kB
        2. Foo.java
          0.3 kB

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              rcastanedalo Roberto Castaneda Lozano
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: