How jonathan03ant/llvmviz works
LLVMViz is a web platform for inspecting LLVM’s SelectionDAG and Machine IR. Users provide LLVM IR, choose a target and compilation stage, then view or compare DAG graphs; the MIR workflow discovers passes and fetches selected pass output for browsing and comparison. The frontend coordinates API requests, while the Flask backend delegates compilation and pipeline analysis to library modules. The README documents capabilities beyond the sampled implementation; arrows are limited to relationships visible in excerpts, the SOURCE INDEX, or README statements.
Main entry points: App.tsx App coordinator · server.py Flask API · SelectionDAGViewer.tsx DAG viewer · MIRViewer.tsx MIR viewer
Components 26
Web interface
- App coordinator
frontend/src/App.tsx - Header
frontend/src/components/common/Header.tsx - IR input
frontend/src/components/common/InputPanel.tsx - Code editor
frontend/src/components/common/CodeEditor.tsx - Compiler controls
frontend/src/components/common/Footer.tsx - Option selector
frontend/src/components/common/CustomSelect.tsx - Terminal output
frontend/src/components/common/TerminalOutput.tsx
SelectionDAG
- DAG viewer
frontend/src/components/tools/SelectionDAGViewer.tsx - Graph canvas
frontend/src/components/graph/GraphCanvas.tsx - DAG layout
frontend/src/components/graph/DagLayout.ts - Node inspection
frontend/src/components/graph/NodeDetailsPanel.tsx - Graph information
frontend/src/components/graph/InfoTabs.tsx - Graph styles
frontend/src/components/graph/nodeStyles.ts
MIR pipeline
- MIR viewer
frontend/src/components/tools/MIRViewer/MIRViewer.tsx - Pass browser
frontend/src/components/tools/MIRViewer/MIRPassSidebar.tsx - MIR content and diff
frontend/src/components/tools/MIRViewer/MIRContentView.tsx - MIR highlighting
frontend/src/utils/mirSyntaxHighlight.tsx - MIR modal
frontend/src/components/common/MIRModal.tsx
API and compilation
- Flask API
backend/server.py - LLVM compilation
lib/compiler.py - DAG parser
lib/parser.py - Pass discovery and analysis
lib/mir_pipeline.py - Target discovery
lib/targets.py - Compiler utilities
lib/utils.py
Other components
- LLVM developer
- LLVM llc
Connections 27
- LLVM developer → App coordinator: uses
README.md - App coordinator → Header: renders
frontend/src/App.tsx - App coordinator → IR input: renders
frontend/src/App.tsx - App coordinator → Compiler controls: renders
frontend/src/App.tsx - App coordinator → DAG viewer: renders
frontend/src/App.tsx - App coordinator → MIR viewer: renders
frontend/src/App.tsx - App coordinator → MIR modal: renders
frontend/src/App.tsx - IR input → Code editor: uses
frontend/src/components/common/InputPanel.tsx - IR input → Terminal output: uses
frontend/src/components/common/InputPanel.tsx - Compiler controls → Option selector: uses
frontend/src/components/common/Footer.tsx - App coordinator → Flask API: requests compilation and target data
frontend/src/App.tsx - DAG viewer → Graph canvas: renders
frontend/src/components/tools/SelectionDAGViewer.tsx - DAG viewer → DAG layout: lays out graphs
frontend/src/components/tools/SelectionDAGViewer.tsx - DAG viewer → Node inspection: renders
frontend/src/components/tools/SelectionDAGViewer.tsx - DAG viewer → Graph information: renders
frontend/src/components/tools/SelectionDAGViewer.tsx - DAG layout → Graph styles: uses
frontend/src/components/graph/DagLayout.ts - Node inspection → Graph styles: uses
frontend/src/components/graph/NodeDetailsPanel.tsx - MIR viewer → Pass browser: renders
frontend/src/components/tools/MIRViewer/MIRViewer.tsx - MIR viewer → MIR content and diff: renders
frontend/src/components/tools/MIRViewer/MIRViewer.tsx - MIR viewer → Flask API: requests pass data
frontend/src/components/tools/MIRViewer/MIRViewer.tsx - MIR content and diff → MIR highlighting: highlights syntax
frontend/src/components/tools/MIRViewer/MIRContentView.tsx - Flask API → LLVM compilation: compiles DAG and MIR
backend/server.py - Flask API → Pass discovery and analysis: discovers passes
backend/server.py - Flask API → Target discovery: gets target options
backend/server.py - Flask API → Compiler utilities: uses utilities
backend/server.py - LLVM compilation → DAG parser: parses DAG output
lib/compiler.py - LLVM compilation → LLVM llc: runs llc
lib/compiler.py