<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 --- - [AArch64] Second LoopUnrollPass may cause compile-time regression with chained stores"
   href="http://llvm.org/bugs/show_bug.cgi?id=21759">21759</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[AArch64] Second LoopUnrollPass may cause compile-time regression with chained stores
          </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>Backend: AArch64
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>mcrosier@codeaurora.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>apazos@codeaurora.org, chandlerc@gmail.com, james.molloy@arm.com, liujiangning1@gmail.com, llvmbugs@cs.uiuc.edu, t.p.northover@gmail.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=13437" name="attach_13437" title="Bad IR">attachment 13437</a> <a href="attachment.cgi?id=13437&action=edit" title="Bad IR">[details]</a></span>
Bad IR

Unfortunately, I can only reproduce this on our internal branch, but the
problem exists on mainline as well.

Given the following loop:

void foo (int a[])
{
  int *ptr = a;
  for (int i = 0; i <= 127; i++)
    *ptr++ = 0xff;
}

Our internal branch will completely unroll the loop during the second call to
the LoopUnrollPass.  The resulting IR (see attached bad.ll) causes a severe
compile-time regression when instruction selection begins recursively calling
WalkChainUsers in SelectionDAGISel.cpp.

If unrolling occurs during the first call to the LoopUnrollPass a later call to
InstCombine removes the chain by having all the gep use base + offset (see
attached bad.instcombine.ll).

I imagine the simplest solution would be to run InstCombine after the second
loop unrolling pass, but I'd like to get feedback before moving forward.</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>