<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - [InstCombine] Incorrect propagation of nsz from fneg to fdiv"
   href="https://bugs.llvm.org/show_bug.cgi?id=49654">49654</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[InstCombine] Incorrect propagation of nsz from fneg to fdiv
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Keywords</th>
          <td>miscompilation
          </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>nunoplopes@sapo.pt
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>cameron.mcinally@nyu.edu, juneyoung.lee@sf.snu.ac.kr, llvm-bugs@lists.llvm.org, spatel+llvm@rotateright.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This is from Transforms/InstCombine/fneg.ll, reduced from fast to just nsz.
The issue is that the original fdiv has no nsz but the optimized one has. In
this case, nsz can be propagated, but not added (even if fneg is nsz).


define float @fdiv_op0_constant_fneg_fmf(float %x) {
  %d = fdiv float 42.000000, %x
  %r = fneg nsz float %d
  ret float %r
}
=>
define float @fdiv_op0_constant_fneg_fmf(float %x) {
  %r = fdiv nsz float -42.000000, %x
  ret float %r
}
Transformation doesn't verify!
ERROR: Value mismatch

Example:
float %x = #x80000000 (-0.0)

Source:
float %d = #xff800000 (-oo)
float %r = #x7f800000 (+oo)

Target:
float %r = #xff800000 (-oo)
Source value: #x7f800000 (+oo)
Target value: #xff800000 (-oo)</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>