Skip to content

feat: migrate codegen to LLVM 22 - #608

Draft
baszalmstra wants to merge 3 commits into
bas/typed-callablesfrom
bas/opaque-pointers
Draft

feat: migrate codegen to LLVM 22#608
baszalmstra wants to merge 3 commits into
bas/typed-callablesfrom
bas/opaque-pointers

Conversation

@baszalmstra

@baszalmstra baszalmstra commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

Why

LLVM 14's typed pointers encode pointee meaning in pointer types. LLVM 22 is the newest release supported by Inkwell 0.10 and uses opaque pointers, so Mun must carry load, GEP, and indirect-call types explicitly in its own codegen model.

What

  • move the Pixi toolchain to LLVM/LLD 22 and Inkwell 0.10
  • provide explicit types for loads, projections, and indirect calls
  • use LLVM's module pass pipeline
  • refresh IR snapshots for opaque ptr and LLVM 22 GEP flags

Depends on mun-lang/lld-rs#10.

Testing

  • pixi run check with RUSTFLAGS=-Dwarnings
  • pixi run clippy with RUSTFLAGS=-Dwarnings
  • pixi run cargo test -p mun_codegen --lib
  • pixi run cargo test -p mun_codegen --test abi
  • targeted runtime dispatch, array, and hot-reload tests

@baszalmstra
baszalmstra marked this pull request as draft September 6, 2026 13:54
@codecov

codecov Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.17629% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.56%. Comparing base (55f1c13) to head (c0d86a3).

Files with missing lines Patch % Lines
crates/mun_codegen/src/ir.rs 66.66% 2 Missing ⚠️
crates/mun_codegen/src/ir/body.rs 98.99% 2 Missing ⚠️
crates/mun_codegen/src/code_gen.rs 92.30% 1 Missing ⚠️
crates/mun_codegen/src/ir/types.rs 93.75% 1 Missing ⚠️
Additional details and impacted files
@@                   Coverage Diff                   @@
##           bas/typed-callables     #608      +/-   ##
=======================================================
+ Coverage                87.46%   87.56%   +0.10%     
=======================================================
  Files                      254      254              
  Lines                    26946    27050     +104     
=======================================================
+ Hits                     23567    23687     +120     
+ Misses                    3379     3363      -16     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@baszalmstra baszalmstra changed the title feat: migrate codegen to LLVM 18 feat: migrate codegen to LLVM 22 Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant