llvm-compiler-architecture
/llvm-compiler-architecture
Wyjaśnia architekturę kompilatora LLVM: trzy fazy, IR w formie SSA i potok passów.
- Autor
- j4flmao ↗
- Repozytorium
- agent-skills ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 10.11.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 1
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 10.11.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Wyjaśnia architekturę kompilatora LLVM: trzy fazy, IR w formie SSA i potok passów.
Wyzwalacze z opisu
Oryginalny opis (EN)
Use this skill when the user says 'LLVM', 'LLVM IR', 'compiler backend', 'optimization pass', 'frontend/backend separation', 'SSA IR'. Explains LLVM's three-phase design, SSA-form IR, and the pass pipeline. Do NOT use for: eBPF bytecode specifics (use niche/low-level/ebpf-xdp-networking) or language-specific syntax.
Jak działa
- Purpose
- Agent Protocol
- Core Mechanics
Podgląd SKILL.md
---
name: llvm-compiler-architecture
description: >
Use this skill when the user says 'LLVM', 'LLVM IR', 'compiler backend', 'optimization pass', 'frontend/backend separation', 'SSA IR'. Explains LLVM's three-phase design, SSA-form IR, and the pass pipeline. Do NOT use for: eBPF bytecode specifics (use niche/low-level/ebpf-xdp-networking) or language-specific syntax.
version: "1.0.0"
author: "j4flmao"
license: "MIT"
tags: [niche, low-level, llvm, compilers, ir]
---
# LLVM Compiler Architecture
## Purpose
Explain LLVM's modular compiler architecture: the frontend/optimizer/backend three-phase split, the SSA-form LLVM IR as the common interface, and how optimization and codegen passes transform it.
## Agent Protocol
### Trigger
User phrases: "LLVM IR", "three-phase compiler", "optimization pass", "SSA form", "target backend".
### Input Context
- Source language / frontend (Clang, rustc).
- Target architecture.
### Output Artifact
Architecture explanation and pass-pipeline guidance.
### Response Format
```
Phase: {frontend | optimizer | backend}
IR: {SSA, typed}
Pass: {analysis | transform}
```
## Core Mechanics
LLVM is a collection of modular and reusable compiler and toolchain technologies. It is the backend for Rust, Swift, and modern C/C++ (Clang).
### 1. The Three-Phase Design
Unlike monolithic compilers, LLVM strictly separates concerns:
- **Frontend (e.g., Clang):** Parses source code (C++, Rust), builds an Abstract Syntax Tree (AST), and translates it into LLVM IR.
- **Optimizer:** Takes LLVM IR, applies language-independent optimizations (dead code elimination, loop unrolling), and outputs optimized IR.
- **Backend (Code Generator):** Translates optimized IR into target-specific machine code (x86, ARM, WebAssembly).
### 2. LLVM IR (Intermediate Representation)
A strongly typed, RISC-like virtual instruction set. It uses SSA (Static Single Assignment) form, meaning every variable is assigned exactly once, making data flow analysis for optimizations mathematically trivial.
### Compiler Flow Map
```mermaid
%%{init: {"theme": "default", "flowchart": {"useMaxWidth": true}}}%%
flowchart TD
subgraph Frontend ["Frontend (Language Specific)"]
A["Source Code (Rust/C)"]
B["Lexer / Parser"]
C["AST (Abstract Syntax Tree)"]
end
subgraph MiddleEnd ["Optimizer (LLVM Core)"]
D["LLVM IR (Unoptimized)"]
E["Optimization Passes"]
F["LLVM IR (Optimized)"]
end
subgraph Backend ["Backend (Hardware Specific)"]
G["Instruction Selection"]
H["Register Allocation"]
I["Machine Code (x86 / ARM)"]
end
A --> B
B --> C
C -->|"Emit IR"| D
D --> E
E --> F
F --> G
G --> H
H --> I
```
Wersje
W bazie nie ma innych skilli o nazwie llvm-compiler-architecture.
Migawka bazy z 13.11.2026 · wersja paczki e5151eb80746 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 2 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100llvm-ir-and-passes
Pomaga czytać i analizować LLVM IR, formę SSA, kolejność potoku przejść oraz uruchamiać opt na bitcode i pracować z plikami .ll. - 100llvm-ir-and-passes
Pomaga czytać LLVM IR, wyjaśnia SSA i węzły PHI, wskazuje zmiany wprowadzone przez -O2 i uruchamia opt na plikach .ll lub .bc. - 100compiler-design
Projektuje kompilatory i interpretery od początku do końca: parsowanie, AST, reprezentację pośrednią SSA, optymalizacje i generowanie kodu. - 100llvm-optimization
Pomaga w optymalizacjach LLVM: pisze własne optymalizacje, analizuje zachowanie przejść, poprawia jakość generowanego kodu i wyjaśnia potok optymalizacji LLVM. - 100llvm
Prowadzi pracę z LLVM IR: uruchamia passy opt, generuje IR przez llc i pomaga pisać własne passy kompilatora. - 100llvm-passes
Pomaga pisać optymalizacje kompilatora jako FunctionPass lub ModulePass, rejestrować PassPlugin, uruchamiać je przez opt, używać analiz takich jak DominatorTree oraz testować w llvm-lit w New Pass Manager.