<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 - Slow handling of vectorized loop epilogue"
   href="https://bugs.llvm.org/show_bug.cgi?id=46119">46119</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Slow handling of vectorized loop epilogue
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </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>enhancement
          </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>elrodc@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I have benchmarks here:
<a href="https://chriselrod.github.io/LoopVectorization.jl/latest/examples/dot_product/">https://chriselrod.github.io/LoopVectorization.jl/latest/examples/dot_product/</a>

Showing poor performance of Julia and Clang-compiled functions whenever the
epilogue is long.

Optimized by LLVM:
<a href="https://godbolt.org/z/kfzhK2">https://godbolt.org/z/kfzhK2</a>

Faster version:
<a href="https://godbolt.org/z/C5f7by">https://godbolt.org/z/C5f7by</a>

Benchmarks on a 10980xe, summing dot products of 4096 vectors with random
lengths uniformly distributed between 1 and...
32:
Default: 50.925 microseconds
Fast: 30.677 microseconds

64:
Default: 64.971 microseconds
Fast: 40.321 microseconds

96:
Default: 70.463 microseconds
Fast: 48.614 microseconds

128:
Default: 78.189 microseconds
Fast: 52.912 microseconds

LLVM's current behavior takes about 50% longer than using masks + SIMD
instructions on the epilogue for randomly sized vectors of length 1,...N where
N is 32, 64, 96, or 128 on this architecture.</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>