New optimization view in Compiler Explorer aka


I’d like to share that Jared Wyles extended the popular Compiler Explorer at to use optimization remarks from LLVM.

If you add -fsave-optimization-record to the compiler flags after selecting a recent clang, the speedometer button becomes active[1]. Clicking this, a new editor window pops up[2] similar to the source view in opt-viewer[3][4]. Here, if you hover over the marked lines you’ll see the various optimization remarks.

Jared is still planning various improvements like improving discoverability such that you wouldn’t have to manually add the command line option, C++ demangling and better strategies if you have multiple remarks on the same line. If you have other ideas or issues, you can file them at

And of course on the LLVM side, please keep adding remarks to your favorite optimizations. Contributions are also welcome to the opt-viewer.