https://llvm.org/bugs/show_bug.cgi?id=26084

            Bug ID: 26084
           Summary: [AArch64] Missed CCMP opportunity
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: AArch64
          Assignee: unassignedb...@nondot.org
          Reporter: mcros...@codeaurora.org
                CC: bma...@codeaurora.org, llvm-bugs@lists.llvm.org
    Classification: Unclassified

Test case:
int test(int A, int B) {
  return !(A > 0 && B > 0);
}

When targeting AArch64 at -O3 we currently generate the following assembly:
test:
        cmp      w0, #1
        cset     w8, lt
        cmp      w1, #1
        cset     w9, lt
        orr      w0, w8, w9
        ret

We should be able to generate something like this:
test:
        cmp     w0, wzr
        ccmp    w1, wzr, 4, gt
        cset    w0, le
        ret

which removes 1 cset and 1 orr.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to