Repository navigation
[Codegen][NFC] Move DropSchedulePass into Codegen/Common - #24501
Merged
AGindinson merged 5 commits intoMay 27, 2026
Merged
AGindinson merged 5 commits into
AGindinson merged 5 commits into
Conversation
sub-task) Relocates the `transform-dialect-drop-schedule` pass from the soon-to-be retired `iree-dialects` project into the in-tree `iree::compiler::Codegen::Common` library, alongside the transform-dialect interpreter pass that always follows it in the pipeline. This is a pure refactor; the pass argument string is preserved so existing lit tests continue to work. * The pass implementation is moved verbatim (PassWrapper-style) into `compiler/src/iree/compiler/Codegen/Common/DropSchedulePass.cpp`, with the namespace changed from `mlir::linalg::transform` to `mlir::iree_compiler` to match the surrounding codegen pass code. * Registration is now performed by `registerCodegenCommonPasses` rather than by an explicit call in `IREEOptToolEntryPoint`, so the pass becomes available everywhere the codegen common passes are registered. * All four production caller sites (Codegen/Common, Codegen/SPIRV, Codegen/LLVMGPU, API/Internal IREEOptToolEntryPoint) drop their include of `iree-dialects/Dialect/LinalgTransform/Passes.h`. Two additional callers (Codegen/LLVMCPU/Passes.cpp, Codegen/SPIRV/Passes.cpp) had stale includes of the same header that were no longer referencing any symbol; those are dropped as well. * `Tools/init_iree_dialects.h` drops the include too. * The corresponding `IREELinalgTransformDialectPasses` Bazel/CMake library is deleted, along with all link-deps that pointed at it from the IREE compiler tree. * The CAPI entry points `mlirIREELinalgTransformRegisterPasses` and `mlirIREETransformRegisterPasses` are kept as no-ops to preserve ABI for downstream Python bindings; comments explain the new registration path. * The old in-tree lit test `llvm-external-projects/iree-dialects/test/Dialect/linalg_transform/drop-schedule.mlir` is removed; its coverage is provided by the existing in-tree `iree-opt --transform-dialect-drop-schedule` lit tests under `compiler/src/iree/compiler/Codegen/...`. This is sub-task iree-org#3 of issue iree-org#24466 (retire `transform.iree.match_callback` and the broader `iree-dialects` project). Continues the cleanup started in iree-org#24500. Verified locally with a Release `cmake -G Ninja` build of `iree-opt` on macOS arm64; `iree-opt --help-list` shows the pass registered with the preserved `--transform-dialect-drop-schedule` argument and the original description string. Signed-off-by: Alex-Wengg <[email protected]>
Alex-Wengg
marked this pull request as ready for review
May 16, 2026 03:03
Alex-Wengg
requested review from
Groverkss,
IanWood1,
MaheshRavishankar,
Max191,
benvanik,
hanhanW,
krzysz00,
kuhar,
nirvedhmeshram and
qedawkins
as code owners
May 16, 2026 03:03
hanhanW
reviewed
May 19, 2026
Comment on lines
44
to
48
| void mlirIREETransformRegisterPasses() { | ||
| mlir::linalg::transform::registerDropSchedulePass(); | ||
| // DropSchedulePass moved into the IREE codegen common pass library and is | ||
| // registered via `registerCodegenCommonPasses`. This entry point is kept for | ||
| // ABI compatibility with existing CAPI / Python consumers. | ||
| } |
Contributor
There was a problem hiding this comment.
This is redundant comment, because people don't need to understand this in codebase. If they are interested in it, they should find a corresponding commit.
And we can delete this function.
Comment on lines
26
to
30
| void mlirIREELinalgTransformRegisterPasses() { | ||
| mlir::linalg::transform::registerDropSchedulePass(); | ||
| // DropSchedulePass moved into the IREE codegen common pass library and is | ||
| // registered via `registerCodegenCommonPasses`. This entry point is kept for | ||
| // ABI compatibility with existing CAPI / Python consumers. | ||
| } |
Comment on lines
+100
to
+109
| /// Creates a pass that drops the transform dialect schedule (and any empty | ||
| /// modules) from the operation it is run on. Used after the transform | ||
| /// interpreter has applied its sequence. | ||
| std::unique_ptr<Pass> createDropSchedulePass(); | ||
|
|
||
| /// Registers the drop-schedule pass with the global pass registry. Called from | ||
| /// `iree-opt` tool setup so that `-transform-dialect-drop-schedule` is | ||
| /// available on the command line and in lit RUN lines. | ||
| void registerDropSchedulePass(); | ||
|
|
Contributor
There was a problem hiding this comment.
They are not needed in modernized pass infrastracture. Please check how other passes are doing here. E.g., 3483893
The pass should be registered in Passes.td.
Contributor
There was a problem hiding this comment.
Since you are here, it is better to follow the naming convention. We don't have Pass suffix in filename.
hanhanW
approved these changes
May 26, 2026
Contributor
|
LGTM, can you fix the DCO issue? Thanks |
- Delete now-empty mlirIREELinalgTransformRegisterPasses and mlirIREETransformRegisterPasses CAPI entry points, their declarations in iree-dialects-c/Dialects.h, the no-op call in IREEDialectsModule.cpp, and the matching entries in the api_exports.* artifacts. - Rename Codegen/Common/DropSchedulePass.cpp to DropSchedule.cpp to match the directory's naming convention (no Pass suffix on filenames). Tablegen-ification of the pass registration is deferred to a follow-up. Signed-off-by: Alex-Wengg <[email protected]>
Declare the pass in Passes.td and switch the .cpp to inherit from the generated impl::DropSchedulePassBase, dropping the hand-written createDropSchedulePass / registerDropSchedulePass declarations in Passes.h and the manual register call in Passes.cpp. The pass argument name, description, factory, and registration are now produced by the existing GEN_PASS_DECL / GEN_PASS_REGISTRATION machinery. Pass logic (runOnOperation, canScheduleOn) is unchanged, and the public flag remains `--transform-dialect-drop-schedule` so existing lit tests and downstream consumers are unaffected. Signed-off-by: Alex-Wengg <[email protected]>
…op-schedule The pass argument is renamed from `transform-dialect-drop-schedule` to `iree-transform-dialect-drop-schedule` so it matches the convention used by the rest of Codegen/Common/Passes.td. Before this change it was the only entry in the file (out of ~100) with no `iree*` prefix at all. The new name aligns with the companion pass `iree-transform-dialect-interpreter`, which is always invoked immediately before drop-schedule in lit RUN lines. Updates the Passes.td def and all 28 lit tests that reference the old flag. No behavior change. Signed-off-by: Alex-Wengg <[email protected]>
…edule Fixes a Bazel strict-deps failure in the linux_x64_bazel CI job: error: module //compiler/src/iree/compiler/Codegen/Common:Common does not depend on a module exporting 'mlir/Dialect/Transform/Interfaces/TransformInterfaces.h' DropSchedule.cpp includes that header to use TransformOpInterface, but the move into Codegen/Common didn't carry the matching dep over from the previous IREELinalgTransformDialectPasses target. CMake didn't flag this because it doesn't enforce header->dep correspondence; Bazel does. Adding the same dep to the CMake side keeps both build systems in sync. Signed-off-by: Alex-Wengg <[email protected]>
Alex-Wengg
force-pushed
the
alex-wengg/24466-move-drop-schedule-pass
branch
from
May 26, 2026 01:14
44f3598 to
7c5313f
Compare
Contributor
Author
|
@hanhanW i have updated the DCO, i suspect the jobs: Test AMD MI355, windows_x64_msvc and ci_summary might not be related to my change here |
AGindinson
enabled auto-merge (squash)
May 26, 2026 16:23
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.
Summary
Relocate
DropSchedulePassfrom the soon-to-be retiredllvm-external-projects/iree-dialects/subproject into the in-treeiree::compiler::Codegen::Commonlibrary, alongside the transform-dialect interpreter pass that always pairs with it.this is Sub-task #3 of #24466 (retire
transform.iree.match_callbackand the broaderiree-dialectsproject.Tested in a M2 Mac
bazel_to_cmakeregeneration reports 0 updates needed across all modified directories (Bazel↔CMake parity).IREELinalgTransformDialectPasses,mlir::linalg::transform::registerDropSchedulePass, andiree-dialects/Dialect/LinalgTransform/Passes.h.iree-opton macOS arm64 (cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ...→ninja iree-opt) succeeded; 5136/5136 edges, exit 0.iree-opt --help-listshows the pass registered with the preserved--transform-dialect-drop-scheduleargument and original description"Drop the schedule from the operation".