[llvm-dev] -Rpass-missed vs -Rpass-analysis

Vladimir Miloserdov via llvm-dev llvm-dev at lists.llvm.org
Tue Aug 15 06:43:45 PDT 2017


Hello,

I am currently working on optimization remarks enhancement (e.g. in loop-vectorize pass). There are 3 options to enable such diagnostics: -Rpass, -Rpass-missed and -Rpass-analysis.

>From help:
-Rpass-analysis=<value> Report transformation analysis from optimization passes whose name matches the given POSIX regular expression
-Rpass-missed=<value>   Report missed transformations by optimization passes whose name matches the given POSIX regular expression
-Rpass=<value>          Report transformations performed by optimization passes whose name matches the given POSIX regular expression

The question is when to generate "missed" remark and when an "analysis" one? In my opinion we should generate "missed" remarks with a short explanation why optimization did not succeed and "analysis" with additional data on optimization process (e.g. "cost of vector instructions here is X, cost of scalar version is Y" and so on).

Also, this is taken from https://reviews.llvm.org/D3683:
-Rpass-missed is used by optimizers to inform the user when they tried
to apply an optimization but couldn't (or wouldn't).
-Rpass-analysis is used by optimizers to report analysis results back
to the user (e.g., why the transformation could not be applied).

Now consider loop vectorization pass. We can't vectorize a loop with a switching statement, so it will be informative to give a message like "loop not vectorized: loop contains switching statement". But should this message refer to -Rpass-missed or -Rpass-analysis? In current version it goes to "analysis", and if user is using -Rpass-missed instead it gives only "loop not vectorized". What's the point of doing it in that way? "Missed" remark becomes nearly useless for users.

In the end, should we consider replacing -Rpass-missed and -Rpass-analysis (and maybe -Rpass also) with a single option?

BR,
- Vladimir Miloserdov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170815/5383b880/attachment.html>


More information about the llvm-dev mailing list