<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 --- - [EarlyCSE, GVN, Missed Opt] invariant loads can be forwarded across aliasing stores"
   href="http://llvm.org/bugs/show_bug.cgi?id=20806">20806</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[EarlyCSE, GVN, Missed Opt] invariant loads can be forwarded across aliasing 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>Scalar Optimizations
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>listmail@philipreames.com
          </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=12956" name="attach_12956" title="Failing test case for EarlyCSE">attachment 12956</a> <a href="attachment.cgi?id=12956&action=edit" title="Failing test case for EarlyCSE">[details]</a></span>
Failing test case for EarlyCSE

LLVM supports the "invariant.load" metadata which indicates that the value
loaded from that location can not change during execution of the code visible
to LLVM.  This enables us to forward the values of invariant loads across
potentially aliasing stores (or even provably aliasing stores since that would
be undefined.)

We currently exploit this property in LICM to lift such loads out of loops and
forward the value to all uses in all iterations.  

We can apply the same reasoning to load value forwarding performed by EarlyCSE
and GVN.  I have attached a test case for EarlyCSE and will add another for GVN
shortly.</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>