So, thanks to your instructions, I was able to find something really cool, so I decided to share with you:
With Clang ++ - 4.0, you can compile an executable file as follows:
clang++-4.0 -std=c++14 -O3 -fsave-optimization-record -foptimization-record-file=myOptfile.yaml sourceFile.cpp
This saves a record of successful and unsuccessful optimizations in myOptfile.yaml. This can be viewed with llvm-opt-report-4.0, but its true power will be displayed using llvm / utils / opt-viewer.py.
To do this, clone the llvm repository, navigate to the source directory and run the following after creating myOptFile.yaml:
python ~/myInstallDir/llvm/utils/opt-viewer/opt-viewer.py myOptFile.yaml reportsDirectory/
This will create many html files that can be moved using index.html (in the reportsDirectory folder).
The result looks amazing and looks like this:

Most things are viewable, so you can navigate html hyperlinks to other parts of the source code, including the C ++ libraries, and see what happened!
nikaza
source share