[llvm-bugs] [Bug 46151] New: AArch64 missed optimization involving "or(frameindex, n)"

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jun 1 00:23:58 PDT 2020


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

            Bug ID: 46151
           Summary: AArch64 missed optimization involving "or(frameindex,
                    n)"
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: AArch64
          Assignee: unassignedbugs at nondot.org
          Reporter: efriedma at quicinc.com
                CC: arnaud.degrandmaison at arm.com,
                    llvm-bugs at lists.llvm.org, smithp352 at googlemail.com,
                    Ties.Stuij at arm.com

Consider the following testcase:

int test(long n, void test2(int*)) {
  int a[4] __attribute((aligned(16)));
  test2(a);
  return a[n & 3];
}

(Similar patterns can come up with variable-index extractelement.)

Currently, we generate something like the following:

  mov x20, sp
  and x8, x19, #0x3
  bfi x20, x8, #2, #2
  ldr w0, [x20]

If the "aligned" attribute is removed, we instead generate:

  mov x20, sp
  and x8, x19, #0x3
  ldr w0, [x20, x8, lsl #2]

-- 
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/20200601/43155e16/attachment.html>


More information about the llvm-bugs mailing list