Skip to content

Commit

Permalink
[LLVMExternalProjects] Drop the IREE LinalgTransformDialect (#15067)
Browse files Browse the repository at this point in the history
The LinalgTransformDialect has become a maintenance burden without any
users. This drops the dialect and cleans up some surrounding linalg ext
code that has since been upstreamed.

- Transform ops equivalent to lower_to_llvm now exist upstream
- The linalg ext variant of the TransformDialectInterpreter pass has
since been moved to IREE core

take_first, emit_remark, and the matcher infra + ops are still load
bearing and transitioning to upstream is left as TODO.
  • Loading branch information
qedawkins authored Oct 2, 2023
1 parent ada5473 commit fee7f6a
Show file tree
Hide file tree
Showing 44 changed files with 7 additions and 1,030 deletions.
2 changes: 0 additions & 2 deletions compiler/src/iree/compiler/API/api_exports.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,6 @@ extern void mlirFunctionTypeGetResult();
extern void mlirFunctionTypeGetTypeID();
extern void mlirGetDialectHandle__iree_input__();
extern void mlirGetDialectHandle__iree_linalg_ext__();
extern void mlirGetDialectHandle__iree_linalg_transform__();
extern void mlirGetDialectHandle__transform__();
extern void mlirIREELinalgTransformRegisterPasses();
extern void mlirIREETransformRegisterPasses();
Expand Down Expand Up @@ -997,7 +996,6 @@ uintptr_t __iree_compiler_hidden_force_extern() {
x += (uintptr_t)&mlirFunctionTypeGetTypeID;
x += (uintptr_t)&mlirGetDialectHandle__iree_input__;
x += (uintptr_t)&mlirGetDialectHandle__iree_linalg_ext__;
x += (uintptr_t)&mlirGetDialectHandle__iree_linalg_transform__;
x += (uintptr_t)&mlirGetDialectHandle__transform__;
x += (uintptr_t)&mlirIREELinalgTransformRegisterPasses;
x += (uintptr_t)&mlirIREETransformRegisterPasses;
Expand Down
1 change: 0 additions & 1 deletion compiler/src/iree/compiler/API/api_exports.def
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,6 @@ EXPORTS
mlirFunctionTypeGetTypeID
mlirGetDialectHandle__iree_input__
mlirGetDialectHandle__iree_linalg_ext__
mlirGetDialectHandle__iree_linalg_transform__
mlirGetDialectHandle__transform__
mlirIREELinalgTransformRegisterPasses
mlirIREETransformRegisterPasses
Expand Down
1 change: 0 additions & 1 deletion compiler/src/iree/compiler/API/api_exports.ld
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,6 @@ VER_0 {
mlirFunctionTypeGetTypeID;
mlirGetDialectHandle__iree_input__;
mlirGetDialectHandle__iree_linalg_ext__;
mlirGetDialectHandle__iree_linalg_transform__;
mlirGetDialectHandle__transform__;
mlirIREELinalgTransformRegisterPasses;
mlirIREETransformRegisterPasses;
Expand Down
1 change: 0 additions & 1 deletion compiler/src/iree/compiler/API/api_exports.macos.lst
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@ _mlirFunctionTypeGetResult
_mlirFunctionTypeGetTypeID
_mlirGetDialectHandle__iree_input__
_mlirGetDialectHandle__iree_linalg_ext__
_mlirGetDialectHandle__iree_linalg_transform__
_mlirGetDialectHandle__transform__
_mlirIREELinalgTransformRegisterPasses
_mlirIREETransformRegisterPasses
Expand Down
1 change: 0 additions & 1 deletion compiler/src/iree/compiler/API/generate_exports.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
"mlirRegisterLinalgPasses",
"mlirGetDialectHandle__iree_input__",
"mlirGetDialectHandle__iree_linalg_ext__",
"mlirGetDialectHandle__iree_linalg_transform__",
"mlirGetDialectHandle__transform__",
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include "iree-dialects/Dialect/LinalgExt/IR/LinalgExtDialect.h"
#include "iree-dialects/Dialect/LinalgExt/TransformOps/LinalgExtTransformOps.h"
#include "iree-dialects/Dialect/LinalgTransform/LinalgTransformOps.h"
#include "iree-dialects/Dialect/LinalgTransform/StructuredTransformOpsExt.h"
#include "iree/compiler/Codegen/Common/PassDetail.h"
#include "iree/compiler/Codegen/Common/TransformExtensions/CommonExtensions.h"
Expand Down Expand Up @@ -74,16 +73,15 @@ class TransformDialectInterpreterPass
func::FuncDialect,
gpu::GPUDialect,
linalg::LinalgDialect,
linalg::transform::LinalgTransformDialect,
LLVM::LLVMDialect,
pdl::PDLDialect,
pdl_interp::PDLInterpDialect,
scf::SCFDialect,
tensor::TensorDialect,
transform::TransformDialect,
vector::VectorDialect
// clang-format on
>();
// clang-format on
>();

// TODO: these should be registered by the extension instead, but there is
// no support for it in core currently.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#include "iree-dialects/Dialect/LinalgExt/IR/LinalgExtDialect.h"
#include "iree-dialects/Dialect/LinalgTransform/LinalgTransformOps.h"
#include "iree/compiler/Codegen/Common/TileSizeSelection.h"
#include "iree/compiler/Codegen/Dialect/IREECodegenAttrs.h"
#include "iree/compiler/Codegen/Dialect/IREECodegenDialect.h"
Expand Down Expand Up @@ -51,7 +50,6 @@ class LLVMCPULowerExecutableTargetPass
IREE::LinalgExt::IREELinalgExtDialect,
bufferization::BufferizationDialect,
linalg::LinalgDialect,
linalg::transform::LinalgTransformDialect,
LLVM::LLVMDialect,
pdl::PDLDialect,
pdl_interp::PDLInterpDialect,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#include "iree-dialects/Dialect/LinalgExt/IR/LinalgExtDialect.h"
#include "iree-dialects/Dialect/LinalgTransform/LinalgTransformOps.h"
#include "iree/compiler/Codegen/Dialect/IREECodegenAttrs.h"
#include "iree/compiler/Codegen/Dialect/IREECodegenDialect.h"
#include "iree/compiler/Codegen/LLVMGPU/KernelConfig.h"
Expand Down Expand Up @@ -47,7 +46,6 @@ class LLVMGPULowerExecutableTargetPass
IREE::HAL::HALDialect,
IREE::LinalgExt::IREELinalgExtDialect,
linalg::LinalgDialect,
linalg::transform::LinalgTransformDialect,
gpu::GPUDialect,
nvgpu::NVGPUDialect,
pdl::PDLDialect,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <unordered_set>

#include "iree-dialects/Dialect/LinalgExt/IR/LinalgExtDialect.h"
#include "iree-dialects/Dialect/LinalgTransform/LinalgTransformOps.h"
#include "iree/compiler/Codegen/Dialect/IREECodegenDialect.h"
#include "iree/compiler/Codegen/LLVMCPU/Passes.h"
#include "iree/compiler/Codegen/Utils/Utils.h"
Expand Down Expand Up @@ -179,7 +178,6 @@ class LLVMCPUTargetBackend final : public TargetBackend {
// clang-format off
registry.insert<IREE::Codegen::IREECodegenDialect,
IREE::LinalgExt::IREELinalgExtDialect,
linalg::transform::LinalgTransformDialect,
mlir::transform::TransformDialect,
pdl::PDLDialect,
pdl_interp::PDLInterpDialect,
Expand Down
2 changes: 0 additions & 2 deletions compiler/src/iree/compiler/Tools/init_iree_dialects.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "iree-dialects/Dialect/Input/InputDialect.h"
#include "iree-dialects/Dialect/LinalgExt/IR/LinalgExtDialect.h"
#include "iree-dialects/Dialect/LinalgExt/Passes/Passes.h"
#include "iree-dialects/Dialect/LinalgTransform/LinalgTransformOps.h"
#include "iree-dialects/Dialect/LinalgTransform/Passes.h"
#include "iree/compiler/Codegen/Dialect/IREECodegenDialect.h"
#include "iree/compiler/Codegen/Interfaces/Interfaces.h"
Expand Down Expand Up @@ -43,7 +42,6 @@ inline void registerIreeDialects(DialectRegistry &registry) {
IREE::HAL::Inline::HALInlineDialect,
IREE::HAL::Loader::HALLoaderDialect,
IREE::LinalgExt::IREELinalgExtDialect,
mlir::linalg::transform::LinalgTransformDialect,
IREE::Stream::StreamDialect,
IREE::Util::UtilDialect,
IREE::VM::VMDialect,
Expand Down
2 changes: 0 additions & 2 deletions docs/website/generate_extra_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ cp -r "${BUILD_DOCS_DIALECTS_ORIGINAL_DIR}/." "${BUILD_DOCS_PROCESSED_DIR}"
# Delete any dialect docs we don't want to publish (yet?).
rm "${BUILD_DOCS_PROCESSED_DIR}/SimpleIODialect.md" # Sample dialect, just ignore
rm "${BUILD_DOCS_PROCESSED_DIR}/StructuredTransformOpsExt.md" # Dialect extensions
rm "${BUILD_DOCS_PROCESSED_DIR}/LinalgTransformOps.md" # Small dialect, unknown state

# Trim "Dialect" suffix from file names, e.g. FlowDialect.md -> Flow.md.
for f in ${BUILD_DOCS_PROCESSED_DIR}/*Dialect.md; do
Expand All @@ -58,7 +57,6 @@ done
# Rename iree-dialect files.
mv "${BUILD_DOCS_PROCESSED_DIR}/InputOps.md" "${BUILD_DOCS_PROCESSED_DIR}/IREEInput.md"
mv "${BUILD_DOCS_PROCESSED_DIR}/LinalgExtOps.md" "${BUILD_DOCS_PROCESSED_DIR}/IREELinalgExt.md"
# mv "${BUILD_DOCS_PROCESSED_DIR}/LinalgTransformOps.md" "${BUILD_DOCS_PROCESSED_DIR}/IREELinalgTransform.md"
# mv "${BUILD_DOCS_PROCESSED_DIR}/StructuredTransformOpsExt.md" "${BUILD_DOCS_PROCESSED_DIR}/IREEStructuredTransformExt.md"

# Postprocess the dialect docs (e.g. making tweaks to the markdown source).
Expand Down
36 changes: 0 additions & 36 deletions llvm-external-projects/iree-dialects/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -494,41 +494,6 @@ cc_library(
# IREELinalgTransform Dialect
################################################################################

gentbl_cc_library(
name = "IREELinalgTransformIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"--dialect=iree_linalg_transform",
"--gen-dialect-decls",
],
"include/iree-dialects/Dialect/LinalgTransform/LinalgTransformDialect.h.inc",
),
(
[
"--dialect=iree_linalg_transform",
"--gen-dialect-defs",
],
"include/iree-dialects/Dialect/LinalgTransform/LinalgTransformDialect.cpp.inc",
),
(
["--gen-op-decls"],
"include/iree-dialects/Dialect/LinalgTransform/LinalgTransformOps.h.inc",
),
(
["--gen-op-defs"],
"include/iree-dialects/Dialect/LinalgTransform/LinalgTransformOps.cpp.inc",
),
],
tblgen = "@llvm-project//mlir:mlir-tblgen",
td_file = "include/iree-dialects/Dialect/LinalgTransform/LinalgTransformOps.td",
deps = [
":TdFiles",
"@llvm-project//mlir:ControlFlowInterfacesTdFiles",
],
)

gentbl_cc_library(
name = "IREELinalgTransformStructuredIncGen",
strip_include_prefix = "include",
Expand Down Expand Up @@ -564,7 +529,6 @@ cc_library(
":IREELinalgExtDialect",
":IREELinalgExtPasses",
":IREELinalgExtTransforms",
":IREELinalgTransformIncGen",
":IREELinalgTransformStructuredIncGen",
"@llvm-project//llvm:Support",

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(IREELinalgExt, iree_linalg_ext);
// LinalgTransform
//===--------------------------------------------------------------------===//

MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(LinalgTransform, iree_linalg_transform);

/// Register all passes for LinalgTransform.
MLIR_CAPI_EXPORTED void mlirIREELinalgTransformRegisterPasses();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
function(_add_dialect)
set(LLVM_TARGET_DEFINITIONS LinalgTransformOps.td)
mlir_tablegen(LinalgTransformOps.h.inc -gen-op-decls)
mlir_tablegen(LinalgTransformOps.cpp.inc -gen-op-defs)
mlir_tablegen(LinalgTransformDialect.h.inc --gen-dialect-decls --dialect=iree_linalg_transform)
mlir_tablegen(LinalgTransformDialect.cpp.inc --gen-dialect-defs --dialect=iree_linalg_transform)
add_public_tablegen_target(IREELinalgTransformIncGen)
add_dependencies(mlir-headers IREELinalgTransformIncGen)
endfunction()

function(_add_transform_dialect_extension)
set(LLVM_TARGET_DEFINITIONS StructuredTransformOpsExt.td)
mlir_tablegen(StructuredTransformOpsExt.h.inc -gen-op-decls)
Expand All @@ -16,20 +6,6 @@ function(_add_transform_dialect_extension)
add_dependencies(mlir-headers IREELinalgTransformExtIncGen)
endfunction()

function(_add_transform_doc)
set(LLVM_TARGET_DEFINITIONS LinalgTransformOps.td)
mlir_tablegen(LinalgTransformOps.md -gen-dialect-doc)
set(GEN_DOC_FILE ${IREE_DIALECTS_BINARY_DIR}/docs/Dialects/LinalgTransformOps.md)
add_custom_command(
OUTPUT ${GEN_DOC_FILE}
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_BINARY_DIR}/LinalgTransformOps.md
${GEN_DOC_FILE}
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/LinalgTransformOps.md)
add_custom_target(LinalgTransformOpsDocGen DEPENDS ${GEN_DOC_FILE})
add_dependencies(iree-dialects-doc LinalgTransformOpsDocGen)
endfunction()

function(_add_structured_transform_doc)
set(LLVM_TARGET_DEFINITIONS StructuredTransformOpsExt.td)
mlir_tablegen(StructuredTransformOpsExt.md -gen-dialect-doc)
Expand All @@ -44,7 +20,5 @@ function(_add_structured_transform_doc)
add_dependencies(iree-dialects-doc StructuredTransformOpsExtDocGen)
endfunction()

_add_dialect()
_add_transform_dialect_extension()
_add_transform_doc()
_add_structured_transform_doc()

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ namespace linalg {
namespace transform {

void registerTransformDialectInterpreterPass();
void registerLinalgTransformExpertExpansionPass();
void registerDropSchedulePass();

} // namespace transform
Expand Down

This file was deleted.

Loading

0 comments on commit fee7f6a

Please sign in to comment.