[LLVMbugs] [Bug 23085] New: [AArch64] Useless register shuffling with tail-call

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Mar 31 07:10:06 PDT 2015


            Bug ID: 23085
           Summary: [AArch64] Useless register shuffling with tail-call
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: AArch64
          Assignee: unassignedbugs at nondot.org
          Reporter: james.greenhalgh at arm.com
                CC: james.molloy at arm.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 14124
  --> https://llvm.org/bugs/attachment.cgi?id=14124&action=edit

For the attached testcase, LLVM produces:

clang --target aarch64 tail-call-allocation.c -O2 -S

    mov     w8, w0         /* Poor register choice.  */
    movz    w9, #0x4e20
    cmp     w8, w9
    b.le    .LBB0_2
    mov     w0, w8
    mov     w0, wzr 
    add    w1, w8, w8, lsl #6
    b    bar

GCC produces:

    mov    w2, 20000
    cmp    w0, w2
    ble    .L4
    .p2align 3
    add    w1, w0, w0, lsl 6
    mov    w0, 0
    b    bar

In the LLVM case, the scheduling of:

    mov     w0, wzr 
    add    w1, w8, w8, lsl #6

prevents better register allocation as the live range for w0 as an outgoing
argument overlaps with that of w0 as an incoming argument.

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/20150331/1691e4fc/attachment.html>

More information about the llvm-bugs mailing list