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

aarch64: elide DecodeN when followed by CmpP 0

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
      None
    • Environment:

      aarch64 development board

    • Subcomponent:
    • Resolved In Build:
      b89
    • CPU:
      aarch64
    • OS:
      linux

      Backports

        Description

        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

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Due:
                    Created:
                    Updated:
                    Resolved:

                    Time Tracking

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