<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [LoopInterchange] Support memory access requiring multiple GEPs"
   href="https://bugs.llvm.org/show_bug.cgi?id=39594">39594</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[LoopInterchange] Support memory access requiring multiple GEPs
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Loop Optimizer
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>Florian.Hahn@arm.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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 <a href="https://reviews.llvm.org/D35210">https://reviews.llvm.org/D35210</a>), we can
support the second case as well.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>