<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </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 --- - Delinearization fails when loop indexes are in reverse order"
   href="http://llvm.org/bugs/show_bug.cgi?id=19336">19336</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Delinearization fails when loop indexes are in reverse order
          </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>normal
          </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>tobias@grosser.es
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=12342" name="attach_12342" title="Reduced test case">attachment 12342</a> <a href="attachment.cgi?id=12342&action=edit" title="Reduced test case">[details]</a></span>
Reduced test case

We can sucessfully delinearize this piece of code:

A[][dim_size];

for (i = 0; i < n; i++)_
  for (j = 0; j < n; j++)
    A[i][j]

AddRec: {{%A,+,(4 * %dim_size)}<%loop.i>,+,4}<%loop.j>
Base offset: %A
ArrayDecl[UnknownSize][%dim_size] with elements of 4 bytes.
ArrayRef[{0,+,1}<%loop.i>][{0,+,1}<%loop.j>]

but fail for:

A[][dim_size];

for (i = 0; i < n; i++)_
  for (j = 0; j < n; j++)
    A[j][i]

AddRec: {{%A,+,4}<%loop.i>,+,(4 * %dim_size)}<%loop.j>
Base offset: %A
ArrayDecl[UnknownSize][1] with elements of 4 bytes.
ArrayRef[{0,+,1}<%loop.i>][{0,+,%dim_size}<%loop.j>]</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>