<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 - cbrt() function cannot be vectorized through OpenMP"
   href="https://bugs.llvm.org/show_bug.cgi?id=36518">36518</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>cbrt() function cannot be vectorized through OpenMP
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>OpenMP
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>FreeBSD
          </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>Clang Compiler Support
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>jmd@freebsd.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=19962" name="attach_19962" title="reproduction of issue">attachment 19962</a> <a href="attachment.cgi?id=19962&action=edit" title="reproduction of issue">[details]</a></span>
reproduction of issue

A trivial loop using cbrt() from cmath in its body cannot be vectorized.
Compiling attached gives the following (on FreeBSD with LLVM devel as of
beginning of February):

$ clang++-devel -O3 -Rpass=loop-vectorize -Rpass-missed=loop-vectorize
-Rpass-analysis=loop-vectorize -fsave-optimization-record -fopenmp -o cbrt
cbrt.cpp 
cbrt.cpp:13:12: remark: loop not vectorized: call instruction cannot be
      vectorized [-Rpass-analysis]
                res[x] = cbrt((double) x);
                         ^
cbrt.cpp:11:10: remark: loop not vectorized (Force=true)
      [-Rpass-missed=loop-vectorize]
        #pragma omp simd
                ^
cbrt.cpp:11:10: warning: loop not vectorized: failed explicitly specified loop
      vectorization [-Wpass-failed=loop-vectorize]
1 warning generated.

What is necessary to have cbrt() vectorizable? This works with recent Intel
compilers on Linux and GCC seems to also be capable to do this properly.</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>