[llvm-bugs] [Bug 33549] New: Performance regression(with D33136) due to a conservative assumption in BasicAA.

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jun 21 13:31:29 PDT 2017


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

            Bug ID: 33549
           Summary: Performance regression(with D33136) due to a
                    conservative assumption in BasicAA.
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: farhana.aleen at gmail.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 18685
  --> https://bugs.llvm.org/attachment.cgi?id=18685&action=edit
a small reproducer

D33136 causes performance regression on a eembc benchmark. The regression was
also reported by David Green with a small reproducer which I attached here.

This issue is:
D33136 prevents isAddOfNonZero() from looking at Phi nodes during basic alias
analysis. It does that because it cannot prove that the values(/indices) are
not from the same iteration(or even they are from the different iterations it
does not know the distance between the two loop iteration). So, conservatively
it always assumes that indices are from different iterations.

As a result "%2 = load %arrayidx4" does not get pre'd since it alias analysis
finds store i32 %sub, i32* %arrayidx, align 4, !tbaa !3 as a clobbering store.

Here is the code snippet from the test:

%arrayidx = getelementptr inbounds [32 x i32], [32 x i32]* @Data, i32 0, i32
%add
%arrayidx4 = getelementptr inbounds [32 x i32], [32 x i32]* @Data, i32 0, i32
%i.030
%0 = load i32, i32* %arrayidx, align 4, !tbaa !3
%1 = load i32, i32* %arrayidx4, align 4, !tbaa !3
%sub = sub nsw i32 %1, %0
store i32 %sub, i32* %arrayidx, align 4, !tbaa !3
%2 = load i32, i32* %arrayidx4, align 4, !tbaa !3

-- 
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/20170621/df50b81e/attachment.html>


More information about the llvm-bugs mailing list