<html>
    <head>
      <base href="https://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 --- - Apparent miscompilation with BBVectorize and sqrt" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D23845&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=zyCMXAvTI6r0UnNDpkx4dZH0uAEzP4jm0tVF4eFPrzM&s=JdhkdygmoNfMJj-wlUX1S4SOAHPgvC493noErzmjQhs&e=">23845</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Apparent miscompilation with BBVectorize and sqrt
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.6
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Windows NT
          </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>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>nick@indigorenderer.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=14470" name="attach_14470" title="unoptimised IR">attachment 14470</a> <a href="attachment.cgi?id=14470&action=edit" title="unoptimised IR">[details]</a></span>
unoptimised IR

In the unoptimised IR there are two calls to wombat326, each of which does a
sqrt. (see wobble211)

In the optimised code there is only one sqrt call.
One sqrt call seems to have been erroneously removed.

Disabling BBVectorize seems to remove the miscompilation.

Optimisation passes are basically the standard -03, with vectorisation passes
enabled.

Platform: LLVM 3.6, windows 64-bit.  Using LLVM for jitting.

Unoptimised IR:
<a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__gist.github.com_anonymous_55f29c2b165efd66f0a3-23file-2Dgistfile1-2Dll-2DL98&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=zyCMXAvTI6r0UnNDpkx4dZH0uAEzP4jm0tVF4eFPrzM&s=nCPzcBc-_ohWNOO-q6wiCKNV8WUEbgqBIOEsC6hTQG8&e=">https://gist.github.com/anonymous/55f29c2b165efd66f0a3#file-gistfile1-ll-L98</a>

Optimised IR: <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__gist.github.com_anonymous_5029a142fcc946d708a8&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=zyCMXAvTI6r0UnNDpkx4dZH0uAEzP4jm0tVF4eFPrzM&s=FygT4AvbYRzyS5g41CJl9vlzQluFajo7c4vgkJuqP7E&e=">https://gist.github.com/anonymous/5029a142fcc946d708a8</a></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>