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: unassignedb...@nondot.org
          Reporter: efrie...@quicinc.com
                CC: arnaud.degrandmai...@arm.com,
                    llvm-bugs@lists.llvm.org, smithp...@googlemail.com,
                    ties.st...@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to