<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 --- - When clang fails to vectorize a loop, it should be more descriptive/helpful about why not"
   href="https://llvm.org/bugs/show_bug.cgi?id=28475">28475</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>When clang fails to vectorize a loop, it should be more descriptive/helpful about why not
          </td>
        </tr>

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

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

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </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>sean@rogue-research.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>With the -Rpass=loop-vectorize -Rpass-missed=loop-vectorize
-Rpass-analysis=loop-vectorize flags, clang will output if it vectorized a
loop, or why not.

But its 'why not' diagnostics could be improved, especially for mere mortal
developers (non compiler developers).

Consider Microsoft's Visual Studio, which can also output why it failed to
vectorize:

<a href="https://blogs.msdn.microsoft.com/nativeconcurrency/2012/05/22/auto-vectorizer-in-visual-studio-2012-did-it-work/">https://blogs.msdn.microsoft.com/nativeconcurrency/2012/05/22/auto-vectorizer-in-visual-studio-2012-did-it-work/</a>

example output:

c:\source.cpp(5) : loop not vectorized due to reason ‘1200’

A numeric reason code is also not ideal, but they at least provide a nice
document explaining each code with examples:

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/04/99/3007.Auto-Vectorizer-08-Cookbook.pdf">https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/04/99/3007.Auto-Vectorizer-08-Cookbook.pdf</a>

and with a video:

<a href="http://media.ch9.ms/ch9/6b08/3e1ca59d-4ec7-461b-92d2-694bb2626b08/AutoVectorizerDidItWorkMovie_high.mp4">http://media.ch9.ms/ch9/6b08/3e1ca59d-4ec7-461b-92d2-694bb2626b08/AutoVectorizerDidItWorkMovie_high.mp4</a>

Basically, Clang is behind the competition here. :)</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>