Skip to content

Commit b0dddf9

Browse files
committed
feat: Add GSoC LLVM Advisor post
This commit introduces a new blog post about the GSoC LLVM Advisor project. The post includes: - A detailed description of the project. - A gallery with images showcasing the dashboard and performance metrics.
1 parent 98af07b commit b0dddf9

File tree

3 files changed

+132
-0
lines changed

3 files changed

+132
-0
lines changed
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
---
2+
author: "Miguel Cárdenas"
3+
date: "2025-08-31"
4+
tags: ["GSoC", "optimization", "visualization", "tooling", "offloading"]
5+
title: "Making LLVM Compilation Data Accessible: A Unified Visualization Tool for Compiler Artifacts"
6+
---
7+
8+
This summer, I had the incredible opportunity to work on an LLVM project through Google Summer of Code 2025. As an undergraduate student passionate about compilers, I set out to tackle a problem that many LLVM developers face daily: the overwhelming nature of compilation data scattered across different flags, output formats, and locations.
9+
10+
## The Problem: Information Overload
11+
12+
LLVM generates a wealth of valuable data during compilation—optimization remarks, profiling information, timing data, and more. However, this information is often difficult to process and analyze, especially for developers new to LLVM or those working with offloading toolchains. The typical workflow involves:
13+
14+
- Searching through thousands of remarks using grep
15+
- Manually correlating data across compilation units
16+
- Trial-and-error debugging without data-driven insights
17+
- Wrestling with different output formats and flags
18+
19+
This fragmented approach makes it particularly challenging for newcomers to understand what's happening during compilation and how to optimize their code effectively.
20+
21+
## Project Goals
22+
23+
The goal was to create a unified infrastructure that organizes, visualizes, and analyzes compilation data for the LLVM toolchain. Specifically, I aimed to:
24+
25+
- Make compiler data accessible to everyone, not just experts
26+
- Reduce the frustration of searching through compilation artifacts
27+
- Enable data-driven optimization decisions
28+
- Create a foundation for advanced analysis tools
29+
- Make offloading development more approachable
30+
31+
## What I Built
32+
33+
Over the 12-week program, I developed a working prototype called **LLVM Advisor** that addresses these challenges through several key components:
34+
35+
### Compiler Wrapper Tool
36+
I created an easy-to-use wrapper (similar to ccache) that automatically collects all relevant compilation artifacts without requiring users to modify their build systems. The wrapper intelligently parses and organizes data into a structured format.
37+
38+
### Storage Layer
39+
The tool uses a JSON-based storage format that supports:
40+
- Project-wide linking of related files
41+
- Incremental updates and differential views
42+
- Cross-compilation unit correlation
43+
44+
### Web-Based Visualization Interface
45+
The heart of the project is an intuitive dashboard that provides:
46+
- **Overview Dashboard**: Key metrics, summaries, and aggregated findings at a glance
47+
- **Source Code Viewer**: Interactive code browser with inline remarks and diagnostics
48+
- **Performance Timeline**: Detailed analysis of compilation phases and bottlenecks
49+
50+
### Analysis Capabilities
51+
The tool offers several analysis features:
52+
- Cross-unit analysis views
53+
- Performance tracking across builds
54+
- Optimization effectiveness monitoring
55+
- Pattern recognition in compilation issues
56+
57+
## Key Achievements
58+
59+
Throughout the program, I made steady progress on both the technical implementation and community engagement:
60+
61+
**Weeks 1-2**: Fixed a critical issue in the NVLINK wrapper that prevented collecting remarks for NVIDIA targets (submitted as PR [#145365](https://github.com/llvm/llvm-project/pull/145365)) and implemented the initial wrapper.
62+
63+
**Weeks 3-4**: Developed the remarks parser and created the first version of the web interface with source viewing capabilities.
64+
65+
**Weeks 5-6**: Designed the compiler wrapper architecture and storage layer, with extensive discussions with mentors about effective data presentation.
66+
67+
**Weeks 7-8**: Presented the project to the LLVM community and improved the web server foundation.
68+
69+
**Weeks 9-12**: Completed the source viewer, implemented the performance timeline, and expanded parsing support for various file types.
70+
71+
**Final Week**: Deployed a live demo and completed documentation.
72+
73+
## Technical Highlights
74+
75+
One of the most challenging aspects was designing a flexible data pipeline that could correlate scattered information from various compiler outputs **without any dependency**. The solution involved:
76+
77+
- **Smart Parsing**: Robust regex patterns and parsers for different LLVM output formats
78+
- **Data Correlation**: Algorithms to link remarks, timing data, and source locations across compilation units
79+
- **Incremental Processing**: Efficient handling of large codebases with differential updates
80+
- **Intuitive UI**: A clean interface that presents complex multi-layered data without overwhelming users
81+
82+
## Community Impact
83+
84+
This project represents more than just a tool—it's a step toward making LLVM more accessible. As someone from Latin America, where compiler topics aren't commonly discussed, I'm passionate about lowering barriers to entry in the LLVM community.
85+
86+
The tool could be valuable for:
87+
- **New Contributors**: Providing visual guidance for understanding optimization behavior
88+
- **Experienced Developers**: Offering data-driven insights for performance tuning
89+
- **Educational Use**: Helping students visualize what compilers actually do
90+
91+
## Try It Yourself
92+
93+
You can explore a live demo of LLVM Advisor at: https://llvm-advisor.onrender.com/
94+
95+
The complete implementation is available in PR [#147451](https://github.com/llvm/llvm-project/pull/147451), and you can see the development timeline at: https://time.graphics/line/999689/
96+
97+
## Looking Forward
98+
99+
This project lays a strong foundation with many exciting opportunities ahead:
100+
101+
- **LLM Integration**: Leveraging Large Language Models to provide automated insights and recommendations
102+
- **Enhanced Analytics**: More sophisticated performance heuristics and pattern detection
103+
- **Community Features**: Sharing optimization patterns and best practices across the community
104+
- **Extended Platform Support**: Broader coverage of LLVM's diverse target architectures
105+
106+
## Personal Reflections
107+
108+
Working on this project through GSoC has been transformative. I've gained deep technical knowledge in LLVM's remark system, full-stack development, and build system integration. More importantly, it's confirmed my passion for making compilers accessible to everyone.
109+
110+
My goal is to continue as a maintainer and help grow the LLVM community, particularly in underrepresented regions. I believe that by making compiler technology more approachable, we can unlock innovation from developers around the world.
111+
112+
## Acknowledgments
113+
114+
I want to thank the LLVM community and my mentors for their guidance throughout this journey. The collaborative spirit and technical excellence of the LLVM project continues to inspire me, and I look forward to contributing to this amazing ecosystem for years to come.
115+
116+
As we often say in the compiler community: LLVM is the place for hackers, nerds, and anyone who likes what they're doing—because no one with common sense takes a glance at compilers at first, but once you get in, you're always willing to learn more and experiment more. We are the alchemists of new days, and projects like this help ensure that alchemy remains accessible to all.
117+
118+
## Gallery
119+
120+
<div class="figure">
121+
<img src="/img/2025-08-31-gsoc-llvm-advisor-figure1.png"
122+
alt="dashboard"
123+
style="width:100%">
124+
<p>Figure 1: dashboard</p>
125+
</div>
126+
127+
<div class="figure">
128+
<img src="/img/2025-08-31-gsoc-llvm-advisor-figure2.png"
129+
alt="performance"
130+
style="width:100%">
131+
<p>Figure 2: performance</p>
132+
</div>
338 KB
Loading
164 KB
Loading

0 commit comments

Comments
 (0)