Repository navigation
Improve compiler driver functionality in the frontend [3/3] - #3406
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3406 +/- ##
=======================================
Coverage 96.23% 96.24%
=======================================
Files 177 177
Lines 21630 21634 +4
Branches 2164 2162 -2
=======================================
+ Hits 20816 20821 +5
Misses 629 629
+ Partials 185 184 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
dime10
force-pushed
the
improve-compiler-driver-stages-2
branch
from
October 28, 2026 17:53
4b429c8 to
1871751
Compare
dime10
force-pushed
the
improve-compiler-driver-stages-3
branch
from
October 28, 2026 17:57
5e076ba to
1d5ccb8
Compare
jaumevillasante
approved these changes
Oct 28, 2026
jaumevillasante
left a comment
Contributor
There was a problem hiding this comment.
Thank you very much @dime10 !
mehrdad2m
approved these changes
Oct 28, 2026
Now that the CLI exposes core compiler stages individually, we can update the `target` selection for AOT compilation to expose these stages to the user. The new stages include: - llvmir_opt (stop after llvm passes are run) - object (stop after object code is generated) Additionally, the "llvmir" target now stops after mlir is first translated to llvm ir, rather than compiling to object code anyway. `link` is preserved as an internal compile option. `lower_to_llvm` is replaced with `compiler_tool` in order to be able to cover all options.
The llvm_ir result was already deprecated by prior commits, this is a cleanup such that the Compiler class always produces precisely one result: The final output of the compilation, regardless of whether it was partial or complete. The result value is the path to the output artifact.
... since it may not represent the current compilation state. This brings the `.llvmir` member inline with `.mlir` and `.mlir_opt` which always generate their output from the current mlir_module. Proper caching and overhaul of these accessors is thus left to future work.
This is inline with the .mlir / .mlir_opt split. .llvmir_opt could be added in the future if desired.
dime10
force-pushed
the
improve-compiler-driver-stages-3
branch
from
October 28, 2026 20:40
447537c to
ebe4025
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is PR 3 of 3 to improve and fix the Catalyst CLI interface pertaining to stage selection and output production. It also builds on PR #3391 to provide an accessible way of running compilation to a particular stage for testing and benchmarking.
In this PR, the
targetselection feature for AOT compilation is fixed to properly select the appropriate stage, even when that stage is not controlled from the frontend (like jaxpr/mlir generation or linking is). In particular:target="llvmir"now correctly stops after the translation step from MLIR to LLVM IR, which previously wasn't possible (see follow up recorded here: Add target=mlir_opt and stop target=llvmir before linking #3391 (comment))Additional, some cleanup on previous changes in the series is performed:
.llvmiraccessor, the cache attribute.llvm_iris removed from the class. While this means the textual llvm ir needs to be regenerated upon each inspection, this is inline with the other IR accessors (.mlirand.mlir_opt) and leaves the door open to overhaul these together in future work.assisted by Astra