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

aarch64: elide DecodeN when followed by CmpP 0

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 9
    • hotspot
    • None
    • aarch64 development board

    • b89
    • aarch64
    • linux

        C2 currently generates code like

          0x000003ff9d3e8920: ldr w11, [x1,#16]
          0x000003ff9d3e8924: lsl x10, x11, #3
          0x000003ff9d3e8928: cbnz x10, 0x000003ff9d3e8950

        when doing a pointer comparison against 0

        The lsl instruction is generated by a DecodeN node which can be elided in this case.

        The following is a simple test case

        public class decode {
            public static void main(String[] args) {
                if (args[0] != null) {
        System.out.println("not null");
        }
            }
        }

        run as follows

        /home/ed/jdk9-dev/hs-comp/build/linux-aarch64-normal-server-fastdebug/images/jdk/bin/java -XX:-TieredCompilation -Xcomp -XX:CompileOnly=decode::main -XX:+UnlockDiagnosticVMOptions -XX:+PrintAssembly -XX:+PrintOptoAssembly -XX:+PrintIdeal decode

              enevill Ed Nevill
              enevill Ed Nevill
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Estimated:
                  Original Estimate - 1 day
                  1d
                  Remaining:
                  Remaining Estimate - 1 day
                  1d
                  Logged:
                  Time Spent - Not Specified
                  Not Specified