Skip to content

Retire llvm-external-projects/iree-dialects dependency from IREE #24466

@hanhanW

Description

@hanhanW

The llvm-external-projects was designed for better integration for other ecosystem (like the old sandbox project in other repo). Most of dialects are either moved to IREE's main codebase (e.g., LinalgExt, VectorExt, ect) or replaced with modern dialect (e.g., iree-input dialect is deleted).

There are remaining transformations and code in the dir, and I think we should be able to remove this old and outdated dir. The remaining work is:

Softmax Matcher

It is used by production path, i.e., RaiseSpecialOps in GlobalOptimization phase. We should be able to port what we need to the local pass. The estimation from LLM is ~200 LOC.

transform_ext::MatcherContext matcherContext;
transform_ext::StructuredOpMatcher *maxReduction;
transform_ext::StructuredOpMatcher *softmaxroot;
makeSoftmaxMatcher(matcherContext, maxReduction, softmaxroot);

Unused Matchers / Transform ops

There are 7 files in compiler/src/iree/compiler/Codegen/Common/test that use transform.iree.register_match_callbacks, transform.iree.match_callback, transform.iree.take_first, and transform.iree.emit_remark. These tests primarily cover the old iree-dialects callback matcher infrastructure.

Note: for the matchers that used in ROCm kernel specialization, it uses other matchers like in-tree transform.iree.match.* ops. So it is safe to drop them.

DropSchedulePass

We can move the generic transform schedule cleanup pass from llvm-external-projects/iree-dialects/lib/Dialect/LinalgTransform/Passes/DropSchedulePass.cpp into IREE main, preferably near compiler/src/iree/compiler/Codegen/Common/TransformDialectInterpreter.cpp. Update users in Common, SPIRV, LLVMGPU, iree-opt registration, and init_iree_dialects.h to include/use the in-tree pass.

ErrorCheckingTrackingListener

Update production users in compiler/src/iree/compiler/Codegen/Common/TransformExtensions/CommonExtensions.cpp and compiler/src/iree/compiler/Codegen/LLVMGPU/TransformExtensions/LLVMGPUExtensions.cpp. This should allow removing StructuredTransformOpsExtension includes from production code that only need the listener.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions