[llvm-bugs] [Bug 39594] New: [LoopInterchange] Support memory access requiring multiple GEPs

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Nov 8 13:47:09 PST 2018


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

            Bug ID: 39594
           Summary: [LoopInterchange] Support memory access requiring
                    multiple GEPs
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Loop Optimizer
          Assignee: unassignedbugs at nondot.org
          Reporter: Florian.Hahn at arm.com
                CC: llvm-bugs at lists.llvm.org

Currently LoopInterchange does only support accesses that only require a single
GEP, e.g. because all array dimensions are known statically.

We will interchange

extern unsigned Arr[1024][1024];
unsigned no_deps_interchange(unsigned k) {
  unsigned sum = 0;
  for (int i = 0; i < 1024; ++i)
    for(int j = 0; j < 1024; ++j)
      sum += Arr[j][i] + k;
  return sum;
}

but we won't interchange 

unsigned no_deps_interchange(unsigned **Arr, unsigned k) {
  unsigned sum = 0;
  for (int i = 0; i < 1024; ++i)
    for(int j = 0; j < 1024; ++j)
      sum += Arr[j][i] + k;
  return sum;
}


because the cost model does not understand the generated address calculations.

By using SCEV for the addresses (like https://reviews.llvm.org/D35210), we can
support the second case as well.

-- 
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/20181108/6cf8493b/attachment.html>


More information about the llvm-bugs mailing list