Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1445fcb
exp: Phase 0 spike crate for in-process LLVM backend
Aug 2, 2026
2a808b9
exp: Phase 0 spike passes — demo, A/B harness, corpus batch script
Aug 2, 2026
afca6b8
exp: feature-gated in-process LLVM backend behind PERRY_LLVM_INPROCESS
Aug 2, 2026
28f0821
exp: validate integrated backend; write up the experiment
Aug 2, 2026
36dc1c2
exp: link tracking issue #7241 in the write-up
Aug 2, 2026
2420a87
exp: Phase 2 scaffolding — native module construction modes
Aug 2, 2026
055793a
exp: dialect reader — native function construction passes both corpora
Aug 2, 2026
c5339b2
exp: object-byte diff verdict, callsite attrs, textual block order
Aug 2, 2026
ca4800f
exp: native mode handles multi-module compiles
Aug 2, 2026
b752536
exp: document Phase 2 native construction in the experiment write-up
Aug 2, 2026
6327383
exp: correct perry-codegen line-count claim (audit-measured 189k, not…
Aug 2, 2026
2f2e17e
exp: typed instruction storage (LlInst) behind the emit choke point
Aug 2, 2026
8d27a6c
exp: stream finalized lines into the native builder — per-function te…
Aug 2, 2026
7364692
exp: fix forward-ref placeholder — select-of-undef folds to undef
Aug 2, 2026
869cb60
exp: auto-declare llvm.* intrinsics at callsites; surface full error …
Aug 2, 2026
8680039
exp: commit corpus .ll files; make A/B harness Linux-portable
Aug 3, 2026
cbe26ec
exp: diff arms share one module identifier (ELF records it in STT_FILE)
Aug 3, 2026
934bbdf
exp: Linux bring-up — portable A/B harness, resumable, no vacuous cor…
Aug 3, 2026
2c951e8
exp: migrate all 68 LlBlock semantic methods to typed LlInst variants
Aug 3, 2026
1d6af8f
exp: typed dispatch — typed instructions construct with zero text
Aug 3, 2026
f877397
exp: wire the debug view under native construction
Aug 3, 2026
ec26e95
exp: native construction for codegen-unit splits
Aug 3, 2026
4b0b09b
exp: pin layer-2 readiness — RS4GC schedules in-process
Aug 3, 2026
ba0c1cd
exp: Linux results — 459/466 A/B, math-errno question closed
Aug 3, 2026
440ed8d
exp: ship the llvm-sys shim generator instead of describing it
Aug 3, 2026
2c6ff43
exp: changelog fragment + status update for landing
Aug 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions changelog.d/7241-inprocess-llvm-native-construction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Opt-in in-process LLVM backend (#7241, engine-plan layer 0): with the
`llvm-inprocess` cargo feature built in and `PERRY_LLVM_INPROCESS=native`,
Perry constructs LLVM modules through the C API against pinned LLVM 22 — no
module-scale IR text, no `.ll` on disk, no `clang` subprocess, no dependence
on the user's toolchain. All 68 `LlBlock` semantic methods emit typed
instructions that build directly (`inst.rs`/`dialect.rs`); codegen-unit
splits build per-unit native modules and partial-link as before; `=diff`
mode byte-compares the two backends' objects (both corpora byte-identical);
`PERRY_SAVE_LL`/`--trace llvm`/`PERRY_LLVM_KEEP_IR` print the constructed
module as the debug view. `=1` selects the transport-only mode (whole-module
text parsed in-process). The flag participates in the build- and
object-cache keys; a build without the feature fails loudly if the flag is
set. The default build is unchanged: no LLVM link dependency, and emitted
IR is byte-identical to the merge-base (verified over a 12-file corpus; the
only divergence class is a pre-existing run-to-run closure-name
registration ordering coin that flips within a single binary).
`RewriteStatepointsForGC` scheduling in-process is pinned by test —
the layer-2 (#7174) unblock this branch exists for.
12 changes: 12 additions & 0 deletions crates/perry-codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ description = "LLVM code generation backend for Perry"
[lints]
workspace = true

[features]
# exp/llvm-inprocess: compile `.ll -> .o` through the LLVM C API inside this
# process instead of shelling out to a user-supplied `clang -c`. Off by
# default — the default build has no LLVM link dependency and the text path
# is byte-for-byte untouched. Building with this feature requires LLVM 22
# (`brew install llvm`; set LLVM_SYS_221_PREFIX if llvm-config is not on
# PATH). The backend still only runs when PERRY_LLVM_INPROCESS=1 at runtime.
llvm-inprocess = ["dep:inkwell", "dep:llvm-sys"]

[dependencies]
perry-hir.workspace = true
perry-dispatch.workspace = true
Expand All @@ -18,3 +27,6 @@ thiserror.workspace = true
log.workspace = true
serde.workspace = true
serde_json.workspace = true

inkwell = { version = "0.9.0", features = ["llvm22-1"], optional = true }
llvm-sys = { version = "221", optional = true }
Loading
Loading