[PATCH] Generate warning when explicitly specified vectorization fails

Tyler Nowicki tnowicki at apple.com
Wed Jul 2 19:17:51 PDT 2014


Hi,

Here are a pair of patches to clang and llvm that cause llvm to generate a warning when vectorization is explicitly enabled but fails to occur. For example, if the programmer wants vectorization and has specified #pragma clang loop vectorize(enable) before a loop and the loop fails to vectorize a warning will be generated.

This will improve the usefulness of the #pragma clang loop vectorize/interleave directives because it gives users feedback without having to check the Rpass diagnostics to verify vectorization has occurred.

The implementation is similar to the way remarks are generated. Clang installs a diagnostic handler into llvm to catch the warnings so it can print the line of code and carrot where vectorization failed. Also works with interleaving. We should probably also add this to unrolling for symmetry.

Let me know what you think.

Tyler

LLVM
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm_vectorization_warn-svn.patch
Type: application/octet-stream
Size: 18614 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140702/0fc25ea6/attachment.obj>
-------------- next part --------------


Clang
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang_pragma_warn-svn.patch
Type: application/octet-stream
Size: 5744 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140702/0fc25ea6/attachment-0001.obj>


More information about the cfe-commits mailing list