Linux Kernel & OS

LLVM Advisor adds visualization and search for Clang optimization remarks

Key Takeaway

LLVM Advisor provides a web-based interface to visualize, search, and compare Clang optimization diagnostics to improve performance tuning.

Summary

As part of the Google Summer of Code 2026, the llvm-advisor project has introduced significant enhancements to help developers interpret Clang's optimization remarks. The tool transforms the structured diagnostics produced by the -fsave-optimization-record flag into a searchable and visual web interface. This allows developers to move beyond reading raw assembly or YAML files to understand why specific optimizations, such as loop vectorization or inlining, were or were not applied.

The updated toolset includes new features like a Code Explorer for source-level overlays, heatmaps for identifying problematic code regions, and snapshot comparison capabilities. By allowing users to import multiple optimization records, the tool can highlight exactly how code changes affect compiler decisions. This is particularly useful for managing the millions of remarks generated during large-scale production builds.

New features in llvm-advisor

  • Optimization Remarks Integration: The tool imports and processes YAML files generated by Clang using the -fsave-optimization-record flag to provide structured diagnostic data.
  • Code Explorer and Heatmaps: Users can view optimization remarks as overlays directly on the source code or via heatmaps that aggregate missed or passed optimizations by function and line number.
  • Snapshot Diffing: The software supports a comparison mode that allows developers to import two different build snapshots (Base and Candidate) to identify specific changes in compiler behavior.
  • Advanced Filtering: The interface includes tools for filtering by specific compiler passes, such as loop-vectorize, and provides PGO (Profile-Guided Optimization) hotness data to prioritize critical code paths.
  • Web-based Interface: The tool operates via a client-server model using the llvm-advisor serve command, making the data accessible through a standard web browser.

Why it matters

This tool significantly lowers the barrier for software engineers and compiler developers to perform fine-grained performance tuning. By making Clang's internal decision-making transparent and comparable, it helps prevent performance regressions during toolchain upgrades or large-scale refactors in performance-critical codebases.

Original reference: blog.llvm.org →