[llvm-bugs] [Bug 48141] New: LICM cannot sink stores out of loops when address calculation is a bit complicated

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Nov 10 12:12:35 PST 2020


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

            Bug ID: 48141
           Summary: LICM cannot sink stores out of loops when address
                    calculation is a bit complicated
           Product: libraries
           Version: 11.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: roy.yan.luo at gmail.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 24145
  --> https://bugs.llvm.org/attachment.cgi?id=24145&action=edit
testcase

For the stores *(float *restrict)(&c_Re[(i+n)*(608)+j+m]) = ..., the compiler
should be able to sink these stores out of the loop indexed by k. Since the
loop indexed by m and n are completely unrolled, the address calculation is
reduced to i*608+j+CONSTANT. If we add #pragma unroll(3) to the loop indexed by
i, these stores are sunk, my guess here is that i becomes a constant, thus now
the address is j+CONSTANT', which is easy to be analyzed in alias analysis.

-- 
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/20201110/5ed6048c/attachment.html>


More information about the llvm-bugs mailing list