[Patch][LoopVectorize] Print vectorization analysis when loop hint pragma is specified

Tyler Nowicki via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 7 14:15:51 PDT 2015


Hi,

Currently, when loop hint is used but vectorization fails we generate a warning. To get the analysis the user needs to provide the command line option -Rpass-analysis=<passname> with the correct pass name. BUT we don’t tell the user which pass name they will need to get the analysis message. We should be displaying the analysis without having to request it. 

These patches print the analysis information when vectorization fails on loops with hints when the compiler option ‘-Rpass-analysis’ is provided without ‘=<passname>'. Users of loop hints can provide the compiler option with their regular debug builds to ensure they always get the analysis when vectorization fails. This approach is preferred because diagnostic printing needs line number tracking which is not enabled by normally. Specifying the option without a pass-target enables line number tracking and makes viewing the messages optional.

The LLVM patches modify the pass-name of the diagnostic to DiagnosticInfo::AlwaysPrint, which is an empty const char*. The use of DiagnosticInfo::AlwaysPrint is recognized when filtering the diagnostics allowing the message to be printed even if the filter doesn’t match. Note that the analysis of loops with hints will always be printed whenever the compiler option is provided even if ‘=<pass name>' is specified. This allows both types of analyses to be printed at the same time rather than hiding the analysis on loops with hints with an pass-target is given.

*These patches build on several previous patches still in review to add late-diagnostics for fp-commut and aliasing. See threads 'Late evaluation of vectorization requirements’ and 'Late evaluate of runtime pointer check's threshold'.

Comments and reviews are much appreciated!

Tyler

(sorry if you received this twice. I used the wrong mailing list addresses)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150807/f533b550/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Clang-When-Rpass-analysis-is-provided-print-all-analyses.patch
Type: application/octet-stream
Size: 4566 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150807/f533b550/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150807/f533b550/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LLVM-1-Simplify-processLoop.patch
Type: application/octet-stream
Size: 3672 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150807/f533b550/attachment-0001.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150807/f533b550/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LLVM-2-Moved-LoopVectorizeHints.patch
Type: application/octet-stream
Size: 20898 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150807/f533b550/attachment-0002.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150807/f533b550/attachment-0003.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LLVM-3-Modify-pass-name-when-vectorization-fails-with-loop-hints.patch
Type: application/octet-stream
Size: 11628 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150807/f533b550/attachment-0003.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150807/f533b550/attachment-0004.html>


More information about the llvm-commits mailing list