[llvm-dev] Next steps for optimization remarks?

Hal Finkel via llvm-dev llvm-dev at lists.llvm.org
Mon Jun 19 16:28:23 PDT 2017

On 06/19/2017 06:13 PM, Brian Gesiak via llvm-dev wrote:
> Hello all,
> In https://www.youtube.com/watch?v=qq0q1hfzidg, Adam Nemet (cc'ed) 
> describes optimization remarks and some future plans for the project. 
> I had a few follow-up questions:
> 1. As an example of future work to be done, the talk mentions 
> expanding the set of optimization passes that emit remarks. However, 
> the Clang User Manual mentions that "optimization remarks do not 
> really make sense outside of the major transformations (e.g.: 
> inlining, vectorization, loop optimizations)." [1] I am wondering: 
> which passes exist today that are most in need of supporting 
> optimization remarks? Should all passes emit optimization remarks, or 
> are there indeed passes for which optimization remarks "do not make 
> sense"?

Obviously there is a continuous spectrum of transformation effects 
between "major" and "minor", and moreover, we have different consumers 
of the remarks. Remarks that would be too noisy if directly viewed by a 
human (because Clang prints them all, for example), might make perfect 
sense if interpreted by some tool. llvm-opt-report, for example, 
demonstrates how a tool can collect many remarks and aggregate them into 
a more succinct form.

If you're looking for an area to contribute, I'd recommend looking at 
how to better output (and display) the "why not" of transformations that 
didn't fire. Memory dependencies that block vectorization and 
loop-invariant code motion, for example, would be really useful if 
mapped back to source-level constructs for presentation to the user.


> 2. I tried running llvm/utils/opt-viewer/opt-viewer.py to produce an 
> HTML dashboard for the optimization remark YAML generated from a large 
> C++ program. Unfortunately, the Python script does not finish, even 
> after over an hour of processing. It appears performance has been 
> brought up before by Bob Haarman (cc'ed), and some optimizations have 
> been made since. [2] I wonder if I'm passing in bad input (6,000+ YAML 
> files -- too many?), or if there's still some room to speed up the 
> opt-viewer.py script? I tried the C++ implementation as well, but that 
> never completed either. [3]
> Overall I'm excited to make greater use of optimization remarks, and 
> to contribute in any way I can. Please let me know if you have any 
> thoughts on my questions above!
> [1] 
> https://clang.llvm.org/docs/UsersManual.html#options-to-emit-optimization-reports
> [2] http://lists.llvm.org/pipermail/llvm-dev/2016-November/107039.html
> [3] https://reviews.llvm.org/D26723
> - Brian Gesiak
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170619/9b94b8c7/attachment-0001.html>

More information about the llvm-dev mailing list