LLVM-FLOW is an open-source project that provides interactive visualization of LLVM IR Control Flow Graphs (CFG). With LLVM-FLOW , users can easily compare the CFG before and after optimization.
The tool can be accessed either through the LLVM-FLOW website or by running it directly on your local environment via Docker.
👉 visit https://llvmflow.kc-ml2.com/
To run this project with Docker, first, you'll need to install Docker and Docker Compose on your machine. Once you've installed Docker, follow these steps:
- Clone the repository:
git clone https://github.com/kc-ml2/llvm-flow.git
- Build the Docker image:
docker-compose build
- Run the Docker container:
docker-compose up
This will start the application on http://localhost:3000
- Fixed an intermittent CFG rendering bug where only one node was shown after uploading files.
- Root cause: multiple function
.dotfiles were generated, but a single JSON output (before.json/after.json) sometimes reflected only one function graph. - Fix: CFG generation now prefers
mainusing-cfg-func-name=mainfor stable comparisons, and falls back to the first defined function whenmainis not present.
- Root cause: multiple function
- Updated Docker LLVM setup for bookworm compatibility.
- LLVM
15~20is installed viaapt.llvm.org. - LLVM
14is installed through a separate Debian package path becausellvm-toolchain-bookworm-14is not available onapt.llvm.org.
- LLVM
- Consider replacing the current fixed-function strategy (
mainfirst, then fallback to first defined function) with a function-selection workflow so users can choose exactly which function CFG to render.
- Detect the same Basic Block between IR modules
- Switch the mode of CFG
- Switch modes only for certain nodes
- Move the node
- Find the target&source node of the edge
- Resize the
div - Change the direction of CFG
- Zoom in / Zoom out
- Download
.llfiles - Query uploaded history from board page
┌── llvm-flow-api
│ ├── backend
| └ llvm.sh
| └ app # api, services
|
├── llvm-flow-frontend
│ ├── src
| └ components
| └ modules # common components
| └ pages # page components
|
└── docker-compose.yaml
This repository is the single source of truth. Both services live here as a monorepo and are developed and reviewed only in this repo:
llvm-flow-api/— FastAPI backendllvm-flow-frontend/— React frontend
The hosted demo is deployed per service from its subdirectory — the monorepo layout does not change the hosting method:
| Service | Platform | How it deploys | Config / secrets |
|---|---|---|---|
| Frontend | Vercel | Project Root Directory = llvm-flow-frontend/; craco build runs unchanged |
REACT_APP_* set in Vercel env settings (client-side vars, not committed) |
| Backend | AWS EC2 | Build/run from the llvm-flow-api/ subdirectory (Docker) |
env.yaml / stage secrets provided on the host, not committed |
Application code is pushed to the deploy repositories by the
Sync to deploy repos workflow, which
opens a pull request for review rather than deploying directly.
Deployment-only files (Dockerfile, docker-compose*, .env*, .gitignore) are
excluded from the sync and stay owned by each deploy repository. Contributors
never touch a deploy repo — everything lands here first.
See CONTRIBUTING.md for the full guide (dev setup, formatting, and how passes are added).
- Open pull requests against
mainin this repository. - Use a feature branch instead of committing to
maindirectly. - Run the formatters (
rufffor the API,prettier/eslintfor the frontend) before committing. - If review leaves comments, push follow-ups and use Re-request review.
This project was presented at the EuroLLVM Developers' Meeting 2023, with the talk titled “Spot the Difference with LLVM-FLOW: an open-source interactive visualization tool for comparing IR CFGs”.

