[llvm-bugs] [Bug 52141] New: [AArch64] Generate stp for complex repeating constansts

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Oct 11 13:27:06 PDT 2021


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

            Bug ID: 52141
           Summary: [AArch64] Generate stp for complex repeating
                    constansts
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Keywords: beginner
          Severity: enhancement
          Priority: P
         Component: Backend: AArch64
          Assignee: unassignedbugs at nondot.org
          Reporter: pavel.iliin at arm.com
                CC: arnaud.degrandmaison at arm.com,
                    llvm-bugs at lists.llvm.org, smithp352 at googlemail.com,
                    Ties.Stuij at arm.com

For complex repeating constants like:
void
foo (unsigned long long *a)
{
  a[0] = 0x0140c0da0140c0daULL;
}
aarch64 clang generates
foo(unsigned long long*):                               // @foo(unsigned long
long*)
        mov     x8, #49370
        movk    x8, #320, lsl #16
        movk    x8, #49370, lsl #32
        movk    x8, #320, lsl #48
        str     x8, [x0]
        ret
but for constants where the top half is the same as the bottom half we can
construct just one half and use a store pair to duplicate it:
foo(unsigned long long*):
        mov     w1, 49370
        movk    w1, 0x140, lsl 16
        stp     w1, w1, [x0]
        ret

-- 
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/20211011/35b4d7c8/attachment.html>


More information about the llvm-bugs mailing list