[llvm-bugs] [Bug 45192] New: Clang unable to optimize away constant stores to Wi/Xi

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Mar 13 02:09:05 PDT 2020


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

            Bug ID: 45192
           Summary: Clang unable to optimize away constant stores to Wi/Xi
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: AArch64
          Assignee: unassignedbugs at nondot.org
          Reporter: glider at google.com
                CC: arnaud.degrandmaison at arm.com,
                    llvm-bugs at lists.llvm.org, ndesaulniers at google.com,
                    smithp352 at googlemail.com, Ties.Stuij at arm.com

I'm seeing a lot of occurrences of the following pattern when compiling an
Android 4.14 kernel with -ftrivial-var-auto-init=pattern:

ffffff8008f3686c:       3201f3e9        mov     w9, #0xaaaaaaaa                
// #-1431655766
ffffff8008f36870:       293327a9        stp     w9, w9, [x29, #-104]
ffffff8008f36874:       b201f3e9        mov     x9, #0xaaaaaaaaaaaaaaaa        
// #-6148914691236517206
ffffff8008f36878:       a93a27a9        stp     x9, x9, [x29, #-96]
ffffff8008f3687c:       a93b27a9        stp     x9, x9, [x29, #-80]


I suppose a more optimal code for this would be:

  mov     x9, #0xaaaaaaaaaaaaaaaa         // #-6148914691236517206
  stp     w9, w9, [x29, #-104]
  stp     x9, x9, [x29, #-96]
  stp     x9, x9, [x29, #-80]

-- 
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/20200313/71d13e8a/attachment.html>


More information about the llvm-bugs mailing list