Skip to content

jit: add optimized LLVM MCJIT compilation - #6410

Closed
sueszli wants to merge 1 commit into
xdslproject:mainfrom
sueszli:jit-extract-llvm-backend
Closed

sueszli wants to merge 1 commit into
xdslproject:mainfrom
sueszli:jit-extract-llvm-backend

Conversation

@sueszli

@sueszli sueszli commented Aug 30, 2026 •

Copy link
Copy Markdown
Collaborator

Adds optional host-optimized MCJIT compilation to the LLVM JIT backend, including an O3 pipeline, native target validation, entry-point preservation, focused tests, and the required llvmlite typings.

@sueszli sueszli self-assigned this Aug 30, 2026
@sueszli
sueszli force-pushed the jit-extract-llvm-backend branch from b202a7d to aa70fa8 Compare August 30, 2026 12:27
@codecov

codecov Bot commented Aug 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.95%. Comparing base (97d0b5a) to head (3dc0aab).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6410   +/-   ##
=======================================
  Coverage   86.95%   86.95%           
=======================================
  Files         439      439           
  Lines       66016    66024    +8     
  Branches     7514     7515    +1     
=======================================
+ Hits        57404    57414   +10     
+ Misses       7039     7038    -1     
+ Partials     1573     1572    -1     

☔ 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.

@sueszli sueszli added the JIT Just-In-Time compilation. label Aug 30, 2026
Comment thread xdsl/jit/llvm/backend.py

target = llvmlite.binding.Target.from_default_triple()
target_machine = target.create_target_machine()
target = llvmlite.binding.Target.from_triple(llvmlite.binding.get_process_triple())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a separate change, right?

Comment thread xdsl/jit/llvm/backend.py Outdated
Comment on lines +137 to +138
target, target_machine = _create_target_machine(optimize=optimize)
return _compile_module(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feels like this split here and below could be merged in a separate PR to the optimization change

@sueszli

sueszli commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator Author

Okidokes - Thanks for reviewing, created 3 sub-PRs :)

@sueszli
sueszli marked this pull request as draft September 2, 2026 00:04
sueszli added a commit that referenced this pull request Sep 2, 2026
Extracts target-machine creation and module compilation without changing
behavior, following feedback on [PR #6410, comment
#3889970708](#6410 (comment)).
sueszli added a commit that referenced this pull request Sep 5, 2026
Adds opt-in host O3 optimization after separating the refactoring
requested on [PR #6410, comment
#3889970708](#6410 (comment))
--- stacked on #6415.
Reject modules whose data layout is not the native one, and give the entry
point external linkage so that global DCE in the optimization pipeline cannot
drop it. Annotate the llvmlite stubs both need.
@sueszli
sueszli force-pushed the jit-extract-llvm-backend branch from aa70fa8 to 3dc0aab Compare September 5, 2026 12:00
@sueszli sueszli closed this Sep 5, 2026
@superlopuh

Copy link
Copy Markdown
Member

Why open a new one instead of keeping this? It makes it harder to keep track of conversations.

@sueszli

sueszli commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator Author

Pardon - noted for the future that the stacked PR is better for continuation of work than sub-PRs 🫡

@superlopuh

Copy link
Copy Markdown
Member

Sounds good. Just to be clear, stacked PRs are still recommended against. I would prefer one PR that has the final state that you propose, marked as draft, and then small PRs opened one-by-one to merge atomic improvements. That way we avoid GitHub's stack weirdness and have both the final state to provide context, and small changes that are reviewable in isolation.

@sueszli

sueszli commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator Author

Noted. Makes sense to me and thank you for clarifying the etiquette!

sueszli added a commit that referenced this pull request Sep 5, 2026
Uses the process triple and native data layout for MCJIT, following
feedback on [PR #6410, comment
#3889958560](#6410 (comment))
--- stacked on #6414.

Closes the stacked #6410, whose remaining work it carries, and fixes
#6426.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

JIT Just-In-Time compilation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants