How kaist-cp/kecc-public works
Main Components (Top Level)
• Rectangle (Blue): Frontend (C Parser)
• Rectangle (Green): IR Generation & Optimization Pipeline
• Rectangle (Orange): Backend (Assembly Generation)
• Rectangle (Gray): Support Systems (Testing/Fuzzing)
Pipeline Stages (Left to Right Flow)
• [C Source] -> [Parser] -> [IR Gen] -> [Optimization Passes] -> [ASM Gen] -> [RISC-V Binary]
IR Transformation Stages (Detail View)
Different IR levels (IR0 through IR4) as intermediate steps:
• IR0 -> IR1 -> IR2 -> IR3 -> IR4
Optimization Components (Subcomponents)
• Dead Code Elimination
• Global Value Numbering (GVN)
• Memory to Register Promotion (mem2reg)
• CFG Simplification
Testing/Support Infrastructure
Parallel systems that support the main pipeline:
• Fuzzing Framework
• Test Suite
• Benchmark System
Key Elements to Include:
Special Features
• IR Interpreter
• IR Visualizer
• Debug Information Flow
□ Processing Stage
○ Data Format
◇ Optimization Pass
∆ Testing Component
Lines:
→ Direct Data Flow
⟶ Control Flow
⟵⟶ Bidirectional Interaction
🔵 Core Components
🟢 Optimization
🟡 Input/Output
⚪ Support Tools
Level of Detail:
• Keep the top-level view focused on the main compilation pipeline
1. IR Transformation Pipeline
2. Optimization Framework
3. Testing Infrastructure
4. Build System
The separation between core compiler components and support infrastructure
This structure reflects the project's organization as seen in the src/ directory and matches the compilation stages described in the README's usage instructions.