<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 --- - gather/maskload intrinsics are not handled by GVN and DSE (missing aliasing info?)"
   href="http://llvm.org/bugs/show_bug.cgi?id=18573">18573</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>gather/maskload intrinsics are not handled by GVN and DSE (missing aliasing info?)
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>tools
          </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>opt
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>ili.filippov@gmail.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=11916" name="attach_11916" title="Reproducer">attachment 11916</a> <a href="attachment.cgi?id=11916&action=edit" title="Reproducer">[details]</a></span>
Reproducer

The problem is reproducible with LLVM trunk. (I'm using Linux).

Reproducer is attached.
To reproduce:
opt -O2 reproducer.ll > opt_rep.bc

The issue is that the following is not optimized:
1. Redundant gather call is not eliminated (I assume that GVN should handle
this).
2. Redundant store instruction between gathers is not eliminated (DSE should
handle this).

It seems that it happens because opt can't handle intrinsics' calls
effectively.
If we change "gather" instructions to normal loads OR change "maskload"
instruction to normal load then the transformations do happen.</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>