<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 --- - reassociate multiplies with fast-math"
   href="http://llvm.org/bugs/show_bug.cgi?id=21768">21768</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>reassociate multiplies with fast-math
          </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>All
          </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>spatel+llvm@rotateright.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>define float @foo(float %f0, float %f1, float %f2, float %f3) {
  %mul0 = fmul fast float %f1, %f0
  %mul1 = fmul fast float %mul0, %f2
  %mul2 = fmul fast float %mul1, %f3
  ret float %mul2
}

This should be optimized to:

define float @foo(float %f0, float %f1, float %f2, float %f3) {
  %mul0 = fmul fast float %f0, %f1
  %mul1 = fmul fast float %f2, %f3
  %mul2 = fmul fast float %mul0, %mul1
  ret float %mul2
}

Ie, instead of 3 dependent multiplies, we should have 2 independent fmuls
followed by the fmul of those results.

This can be generalized for N fmuls to form the optimal binary tree of
independent ops.</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>