[llvm-bugs] [Bug 50414] New: Missing optimization for sibling address

via llvm-bugs llvm-bugs at lists.llvm.org
Thu May 20 02:57:58 PDT 2021


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

            Bug ID: 50414
           Summary: Missing optimization for sibling address
           Product: libraries
           Version: 12.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: AArch64
          Assignee: unassignedbugs at nondot.org
          Reporter: zhongyunde at tom.com
                CC: arnaud.degrandmaison at arm.com,
                    llvm-bugs at lists.llvm.org, smithp352 at googlemail.com,
                    Ties.Stuij at arm.com

cat test.c

extern double top[100];

int foo (long long j, double a) {
  top[j] += a;
  return 0;
}

clang12 test.c -O3 -Wall --std c89 -S -o clang.s
foo:                                    // @foo
        .cfi_startproc
// %bb.0:                               // %entry
        adrp    x9, top
        lsl     x8, x0, #3              -- redundant  
        add     x9, x9, :lo12:top
        ldr     d1, [x9, x8]    --> ldr d1, [x9, x0, lsl 3]
        mov     w0, wzr
        fadd    d0, d1, d0  
        str     d0, [x9, x8]    --> str d0, [x9, x0, lsl 3]
        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/20210520/706e637e/attachment.html>


More information about the llvm-bugs mailing list