[llvm-bugs] [Bug 26084] New: [AArch64] Missed CCMP opportunity

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jan 8 12:09:27 PST 2016


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: unassignedbugs at nondot.org
          Reporter: mcrosier at codeaurora.org
                CC: bmakam at codeaurora.org, llvm-bugs at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160108/fa3c3b15/attachment.html>


More information about the llvm-bugs mailing list