From 3fa9fbd7dd1c1ab01dd5da120ea885cae719cd83 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Wed, 3 Apr 2024 12:30:20 -0400 Subject: [PATCH] Integrate LLVM at llvm/llvm-project@a6d932bca8875198fbf34564cda8a8d1640cdcbc (#16944) IREE-side changes to adapt to MLIR changes: 1. `initializeOptions` changes to adapt to https://github.com/llvm/llvm-project/pull/87289 2. `enableFastMathMode` removal: https://github.com/llvm/llvm-project/pull/86578. 3. Bazel changes to adapt to https://github.com/llvm/llvm-project/pull/86819 IREE-side fixes for preexisting bugs revealed by a MLIR change: 1. `mlp_tosa` test fix: the shapes were inconsistent, used to accidentally work, until MLIR started catching it since https://github.com/llvm/llvm-project/pull/85798. See diagnostic in [87396](https://github.com/llvm/llvm-project/issues/87396#issuecomment-2032929368). FYI @MaheshRavishankar. IREE-side fixes accidentally lumped into this: 1. The `iree_copts.cmake` change: It just happens that my bleeding-edge Clang was updated and started diagnosing some code relying on C++20 semantics. Filed https://github.com/openxla/iree/issues/16946 as TODO. --------- Co-authored-by: Scott Todd --- build_tools/cmake/iree_copts.cmake | 4 ++- .../input/StableHLO/Conversion/BUILD.bazel | 1 + .../input/StableHLO/Conversion/CMakeLists.txt | 1 + .../Conversion/Preprocessing/BUILD.bazel | 1 + .../Conversion/Preprocessing/CMakeLists.txt | 1 + .../input/TOSA/InputConversion/BUILD.bazel | 2 ++ .../input/TOSA/InputConversion/CMakeLists.txt | 2 ++ .../target/MetalSPIRV/MetalSPIRVTarget.cpp | 2 +- .../target/VulkanSPIRV/VulkanSPIRVTarget.cpp | 2 +- .../target/WebGPUSPIRV/WebGPUSPIRVTarget.cpp | 25 +++++++------------ .../iree/compiler/API/Internal/BUILD.bazel | 1 + .../iree/compiler/API/Internal/CMakeLists.txt | 1 + .../iree/compiler/Codegen/Common/BUILD.bazel | 3 +++ .../compiler/Codegen/Common/CMakeLists.txt | 3 +++ .../compiler/Codegen/Common/CPU/BUILD.bazel | 1 + .../Codegen/Common/CPU/CMakeLists.txt | 1 + .../Codegen/Common/CPU/CPULowerToUKernels.cpp | 6 +++-- .../compiler/Codegen/Common/GPU/BUILD.bazel | 2 ++ .../Codegen/Common/GPU/CMakeLists.txt | 2 ++ .../Common/GPU/WorkgroupReordering.cpp | 6 +++-- .../Common/OptimizeVectorTransferPass.cpp | 6 +++-- .../Common/TransformExtensions/BUILD.bazel | 1 + .../Common/TransformExtensions/CMakeLists.txt | 1 + .../iree/compiler/Codegen/LLVMCPU/BUILD.bazel | 2 ++ .../compiler/Codegen/LLVMCPU/CMakeLists.txt | 2 ++ .../iree/compiler/Codegen/LLVMGPU/BUILD.bazel | 1 + .../compiler/Codegen/LLVMGPU/CMakeLists.txt | 1 + .../LLVMGPU/TransformExtensions/BUILD.bazel | 2 ++ .../TransformExtensions/CMakeLists.txt | 2 ++ .../iree/compiler/Codegen/SPIRV/BUILD.bazel | 2 ++ .../compiler/Codegen/SPIRV/CMakeLists.txt | 2 ++ .../Codegen/SPIRV/ConvertToSPIRVPass.cpp | 19 ++++++-------- .../iree/compiler/Codegen/SPIRV/Passes.cpp | 10 ++++---- .../src/iree/compiler/Codegen/SPIRV/Passes.h | 4 +-- .../src/iree/compiler/Codegen/SPIRV/Passes.td | 2 -- .../Codegen/SPIRV/SPIRVTileAndPromote.cpp | 6 +++-- .../compiler/Codegen/Transforms/BUILD.bazel | 1 + .../Codegen/Transforms/CMakeLists.txt | 1 + .../iree/compiler/Codegen/VMVX/BUILD.bazel | 2 ++ .../iree/compiler/Codegen/VMVX/CMakeLists.txt | 2 ++ .../Flow/Conversion/MeshToFlow/BUILD.bazel | 1 + .../Flow/Conversion/MeshToFlow/CMakeLists.txt | 1 + .../Flow/TransformExtensions/BUILD.bazel | 1 + .../Flow/TransformExtensions/CMakeLists.txt | 1 + .../TensorPadToTensorInsertSlice.cpp | 6 +++-- .../Dialect/HAL/Conversion/BUILD.bazel | 1 + .../Dialect/HAL/Conversion/CMakeLists.txt | 1 + .../HAL/Conversion/HALToHAL/BUILD.bazel | 1 + .../HAL/Conversion/HALToHAL/CMakeLists.txt | 1 + .../HAL/Conversion/HALToVM/BUILD.bazel | 1 + .../HAL/Conversion/HALToVM/CMakeLists.txt | 1 + .../HAL/Conversion/StandardToHAL/BUILD.bazel | 1 + .../Conversion/StandardToHAL/CMakeLists.txt | 1 + .../HAL/Conversion/StreamToHAL/BUILD.bazel | 1 + .../HAL/Conversion/StreamToHAL/CMakeLists.txt | 1 + .../HAL/Conversion/UtilToHAL/BUILD.bazel | 1 + .../HAL/Conversion/UtilToHAL/CMakeLists.txt | 1 + .../Dialect/HAL/Transforms/BUILD.bazel | 1 + .../Dialect/HAL/Transforms/CMakeLists.txt | 1 + .../Dialect/Stream/Conversion/BUILD.bazel | 1 + .../Dialect/Stream/Conversion/CMakeLists.txt | 1 + .../Conversion/FlowToStream/BUILD.bazel | 1 + .../Conversion/FlowToStream/CMakeLists.txt | 1 + .../Stream/Conversion/HALToStream/BUILD.bazel | 1 + .../Conversion/HALToStream/CMakeLists.txt | 1 + .../Conversion/StandardToStream/BUILD.bazel | 1 + .../StandardToStream/CMakeLists.txt | 1 + .../Conversion/UtilToStream/BUILD.bazel | 1 + .../Conversion/UtilToStream/CMakeLists.txt | 1 + .../Dialect/Util/Conversion/BUILD.bazel | 1 + .../Dialect/Util/Conversion/CMakeLists.txt | 1 + .../iree/compiler/Dialect/Util/IR/BUILD.bazel | 2 ++ .../compiler/Dialect/Util/IR/CMakeLists.txt | 1 + .../Dialect/Util/Transforms/BUILD.bazel | 1 + .../Dialect/Util/Transforms/CMakeLists.txt | 1 + .../Util/Transforms/FixedPointIterator.cpp | 10 +++++--- .../Dialect/VM/Conversion/BUILD.bazel | 1 + .../Dialect/VM/Conversion/CMakeLists.txt | 1 + .../VM/Conversion/VMToEmitC/BUILD.bazel | 1 + .../VM/Conversion/VMToEmitC/CMakeLists.txt | 1 + .../Dialect/VM/Target/Bytecode/BUILD.bazel | 1 + .../Dialect/VM/Target/Bytecode/CMakeLists.txt | 1 + .../Dialect/VM/Transforms/BUILD.bazel | 1 + .../VMVX/Conversion/HALToVMVX/BUILD.bazel | 1 + .../VMVX/Conversion/HALToVMVX/CMakeLists.txt | 1 + .../Conversion/StandardToVMVX/BUILD.bazel | 1 + .../Conversion/StandardToVMVX/CMakeLists.txt | 1 + .../VMVX/Conversion/VMVXToVM/BUILD.bazel | 1 + .../VMVX/Conversion/VMVXToVM/CMakeLists.txt | 1 + .../Dialect/VMVX/Transforms/BUILD.bazel | 2 ++ .../Dialect/VMVX/Transforms/CMakeLists.txt | 2 ++ .../compiler/GlobalOptimization/BUILD.bazel | 2 ++ .../GlobalOptimization/CMakeLists.txt | 2 ++ .../InputConversion/Common/BUILD.bazel | 3 +++ .../InputConversion/Common/CMakeLists.txt | 3 +++ .../Modules/Check/Conversion/BUILD.bazel | 1 + .../Modules/Check/Conversion/CMakeLists.txt | 1 + .../compiler/Modules/Check/IR/BUILD.bazel | 1 + .../compiler/Modules/Check/IR/CMakeLists.txt | 1 + .../Conversion/HALInlineToVM/BUILD.bazel | 1 + .../Conversion/HALInlineToVM/CMakeLists.txt | 1 + .../Conversion/HALToHALInline/BUILD.bazel | 1 + .../Conversion/HALToHALInline/CMakeLists.txt | 1 + .../Conversion/StreamToHALInline/BUILD.bazel | 1 + .../StreamToHALInline/CMakeLists.txt | 1 + .../Modules/HAL/Inline/Transforms/BUILD.bazel | 1 + .../HAL/Inline/Transforms/CMakeLists.txt | 1 + .../Conversion/HALLoaderToVM/BUILD.bazel | 1 + .../Conversion/HALLoaderToVM/CMakeLists.txt | 1 + .../Conversion/StreamToHALLoader/BUILD.bazel | 1 + .../StreamToHALLoader/CMakeLists.txt | 1 + .../Modules/HAL/Loader/Transforms/BUILD.bazel | 1 + .../HAL/Loader/Transforms/CMakeLists.txt | 1 + .../Conversion/ParamsToVM/BUILD.bazel | 1 + .../Conversion/ParamsToVM/CMakeLists.txt | 1 + .../Conversion/StreamToParams/BUILD.bazel | 1 + .../Conversion/StreamToParams/CMakeLists.txt | 1 + .../compiler/Preprocessing/Common/BUILD.bazel | 1 + .../Preprocessing/Common/CMakeLists.txt | 1 + .../Common/ConvertConvToChannelsLast.cpp | 6 +++-- .../PreprocessingExtensions.h | 2 +- .../PreprocessingExtensionsOps.td | 2 +- .../compiler/Reducer/Framework/BUILD.bazel | 1 + .../compiler/Reducer/Framework/CMakeLists.txt | 1 + .../iree-dialects/BUILD.bazel | 4 +++ .../cpu/mlp_plugin/mlp_tosa.mlir | 6 ++--- third_party/llvm-project | 2 +- 127 files changed, 201 insertions(+), 61 deletions(-) diff --git a/build_tools/cmake/iree_copts.cmake b/build_tools/cmake/iree_copts.cmake index 0f792e1bf7a2..e6e858d9ff52 100644 --- a/build_tools/cmake/iree_copts.cmake +++ b/build_tools/cmake/iree_copts.cmake @@ -189,7 +189,9 @@ iree_select_compiler_opts(IREE_DEFAULT_COPTS # Explicitly enable some additional warnings. # Some of these aren't on by default, or under -Wall, or are subsets of # warnings turned off above. - "-Wc++20-extensions" # Enable until we use C++20 across all compilers + # + # TODO(#16946): reenable -Wc++20-extensions. + # "-Wc++20-extensions" # Enable until we use C++20 across all compilers "-Wctad-maybe-unsupported" "-Wfloat-overflow-conversion" "-Wfloat-zero-conversion" diff --git a/compiler/plugins/input/StableHLO/Conversion/BUILD.bazel b/compiler/plugins/input/StableHLO/Conversion/BUILD.bazel index 30d19e6bff21..13581c51d7d5 100644 --- a/compiler/plugins/input/StableHLO/Conversion/BUILD.bazel +++ b/compiler/plugins/input/StableHLO/Conversion/BUILD.bazel @@ -115,6 +115,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:Support", "@llvm-project//mlir:TensorDialect", "@llvm-project//mlir:TensorUtils", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", "@llvm-project//mlir:VectorDialect", "@stablehlo//:broadcast_utils", diff --git a/compiler/plugins/input/StableHLO/Conversion/CMakeLists.txt b/compiler/plugins/input/StableHLO/Conversion/CMakeLists.txt index c7506925537c..6635859d30fb 100644 --- a/compiler/plugins/input/StableHLO/Conversion/CMakeLists.txt +++ b/compiler/plugins/input/StableHLO/Conversion/CMakeLists.txt @@ -94,6 +94,7 @@ iree_cc_library( MLIRSupport MLIRTensorDialect MLIRTensorUtils + MLIRTransformUtils MLIRTransforms MLIRVectorDialect StablehloBroadcastUtils diff --git a/compiler/plugins/input/StableHLO/Conversion/Preprocessing/BUILD.bazel b/compiler/plugins/input/StableHLO/Conversion/Preprocessing/BUILD.bazel index 5a195743c8c2..1b08fb73d8ab 100644 --- a/compiler/plugins/input/StableHLO/Conversion/Preprocessing/BUILD.bazel +++ b/compiler/plugins/input/StableHLO/Conversion/Preprocessing/BUILD.bazel @@ -92,6 +92,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:SparseTensorDialect", "@llvm-project//mlir:Support", "@llvm-project//mlir:TensorDialect", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", "@stablehlo//:chlo_ops", "@stablehlo//:stablehlo_ops", diff --git a/compiler/plugins/input/StableHLO/Conversion/Preprocessing/CMakeLists.txt b/compiler/plugins/input/StableHLO/Conversion/Preprocessing/CMakeLists.txt index dbaf38dc8d60..bc428e317f37 100644 --- a/compiler/plugins/input/StableHLO/Conversion/Preprocessing/CMakeLists.txt +++ b/compiler/plugins/input/StableHLO/Conversion/Preprocessing/CMakeLists.txt @@ -76,6 +76,7 @@ iree_cc_library( MLIRSparseTensorDialect MLIRSupport MLIRTensorDialect + MLIRTransformUtils MLIRTransforms StablehloOps PUBLIC diff --git a/compiler/plugins/input/TOSA/InputConversion/BUILD.bazel b/compiler/plugins/input/TOSA/InputConversion/BUILD.bazel index d0f0117ca4c0..1f91a8f6ef0f 100644 --- a/compiler/plugins/input/TOSA/InputConversion/BUILD.bazel +++ b/compiler/plugins/input/TOSA/InputConversion/BUILD.bazel @@ -43,6 +43,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:LinalgDialect", "@llvm-project//mlir:Pass", "@llvm-project//mlir:TensorDialect", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) @@ -78,6 +79,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:TosaToMLProgram", "@llvm-project//mlir:TosaToSCF", "@llvm-project//mlir:TosaToTensor", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) diff --git a/compiler/plugins/input/TOSA/InputConversion/CMakeLists.txt b/compiler/plugins/input/TOSA/InputConversion/CMakeLists.txt index a1dc1ea6eeab..b73fad01586d 100644 --- a/compiler/plugins/input/TOSA/InputConversion/CMakeLists.txt +++ b/compiler/plugins/input/TOSA/InputConversion/CMakeLists.txt @@ -34,6 +34,7 @@ iree_cc_library( MLIRLinalgDialect MLIRPass MLIRTensorDialect + MLIRTransformUtils MLIRTransforms iree::compiler::Dialect::LinalgExt::IR PUBLIC @@ -67,6 +68,7 @@ iree_cc_library( MLIRTosaToMLProgram MLIRTosaToSCF MLIRTosaToTensor + MLIRTransformUtils MLIRTransforms iree::compiler::Dialect::LinalgExt::IR iree::compiler::InputConversion::Common diff --git a/compiler/plugins/target/MetalSPIRV/MetalSPIRVTarget.cpp b/compiler/plugins/target/MetalSPIRV/MetalSPIRVTarget.cpp index 3d5faf15a8b4..190f79b8f4b9 100644 --- a/compiler/plugins/target/MetalSPIRV/MetalSPIRVTarget.cpp +++ b/compiler/plugins/target/MetalSPIRV/MetalSPIRVTarget.cpp @@ -187,7 +187,7 @@ class MetalSPIRVTargetBackend : public TargetBackend { if (variantOp.isExternal()) return; - buildSPIRVCodegenPassPipeline(passManager, /*enableFastMath=*/false); + buildSPIRVCodegenPassPipeline(passManager); } LogicalResult serializeExecutable(const SerializationOptions &serOptions, diff --git a/compiler/plugins/target/VulkanSPIRV/VulkanSPIRVTarget.cpp b/compiler/plugins/target/VulkanSPIRV/VulkanSPIRVTarget.cpp index 73810f63e359..4d7a01369f11 100644 --- a/compiler/plugins/target/VulkanSPIRV/VulkanSPIRVTarget.cpp +++ b/compiler/plugins/target/VulkanSPIRV/VulkanSPIRVTarget.cpp @@ -179,7 +179,7 @@ class VulkanSPIRVTargetBackend : public TargetBackend { if (variantOp.isExternal()) return; - buildSPIRVCodegenPassPipeline(passManager, /*enableFastMath=*/false); + buildSPIRVCodegenPassPipeline(passManager); } void buildLinkingPassPipeline(OpPassManager &passManager) override { diff --git a/compiler/plugins/target/WebGPUSPIRV/WebGPUSPIRVTarget.cpp b/compiler/plugins/target/WebGPUSPIRV/WebGPUSPIRVTarget.cpp index 9293fd2f78cf..c8d6901efb46 100644 --- a/compiler/plugins/target/WebGPUSPIRV/WebGPUSPIRVTarget.cpp +++ b/compiler/plugins/target/WebGPUSPIRV/WebGPUSPIRVTarget.cpp @@ -145,22 +145,15 @@ class WebGPUSPIRVTargetBackend : public TargetBackend { passManager.nest().nest().addPass( createWGSLReplacePushConstantsPass()); - // From WGSL spec, "Floating Point Evaluation" - // (https://www.w3.org/TR/WGSL/#floating-point-evaluation): - // - Implementations may assume that NaNs and infinities are not present at - // runtime. - // - In such an implementation, when an evaluation would produce an - // infinity or a NaN, an undefined value of the target type is produced - // instead. - // So WebGPU effectively assumes fast math mode. We also don't have reliable - // ways to check whether a floating point number is NaN or infinity. - // Therefore, just let the SPIR-V CodeGen to avoid generating guards w.r.t. - // NaN and infinity. - buildSPIRVCodegenPassPipeline(passManager, /*enableFastMath=*/true); - - // WGSL does not support extended multiplication: - // https://github.com/gpuweb/gpuweb/issues/1565. Make sure to lower it to - // regular multiplication before we convert SPIR-V to WGSL. + buildSPIRVCodegenPassPipeline(passManager); + + // Prepare SPIR-V for WebGPU by expanding or removing unsupported ops. + // For example, + // * WGSL does not support extended multiplication: + // https://github.com/gpuweb/gpuweb/issues/1565, so we lower to + // regular multiplication + // * WGSL does not support NaN or infinities: + // https://www.w3.org/TR/WGSL/#floating-point-evaluation passManager.nest().nest().addPass( spirv::createSPIRVWebGPUPreparePass()); } diff --git a/compiler/src/iree/compiler/API/Internal/BUILD.bazel b/compiler/src/iree/compiler/API/Internal/BUILD.bazel index 8c34f0eb32ee..4f98de9f45cb 100644 --- a/compiler/src/iree/compiler/API/Internal/BUILD.bazel +++ b/compiler/src/iree/compiler/API/Internal/BUILD.bazel @@ -118,6 +118,7 @@ iree_compiler_cc_library( "//compiler/src/iree/compiler/Reducer:iree_reduce_lib", "//compiler/src/iree/compiler/Tools:init_passes_and_dialects", "@llvm-project//llvm:Support", + "@llvm-project//mlir:BytecodeWriter", "@llvm-project//mlir:IR", "@llvm-project//mlir:Parser", "@llvm-project//mlir:Pass", diff --git a/compiler/src/iree/compiler/API/Internal/CMakeLists.txt b/compiler/src/iree/compiler/API/Internal/CMakeLists.txt index 8989c6576103..c25dcb310f42 100644 --- a/compiler/src/iree/compiler/API/Internal/CMakeLists.txt +++ b/compiler/src/iree/compiler/API/Internal/CMakeLists.txt @@ -92,6 +92,7 @@ iree_cc_library( "IREEReduceToolEntryPoint.cpp" DEPS LLVMSupport + MLIRBytecodeWriter MLIRIR MLIRParser MLIRPass diff --git a/compiler/src/iree/compiler/Codegen/Common/BUILD.bazel b/compiler/src/iree/compiler/Codegen/Common/BUILD.bazel index f6a49385516d..8d651b656e76 100644 --- a/compiler/src/iree/compiler/Codegen/Common/BUILD.bazel +++ b/compiler/src/iree/compiler/Codegen/Common/BUILD.bazel @@ -40,6 +40,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:LinalgTransforms", "@llvm-project//mlir:MemRefDialect", "@llvm-project//mlir:Pass", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) @@ -190,6 +191,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:TensorUtils", "@llvm-project//mlir:TilingInterface", "@llvm-project//mlir:TransformDialect", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", "@llvm-project//mlir:ValueBoundsOpInterface", "@llvm-project//mlir:VectorDialect", @@ -259,6 +261,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:SCFTransforms", "@llvm-project//mlir:TensorTransforms", "@llvm-project//mlir:Transforms", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:VectorTransforms", # Other Stuff "//compiler/src/iree/compiler/Utils", diff --git a/compiler/src/iree/compiler/Codegen/Common/CMakeLists.txt b/compiler/src/iree/compiler/Codegen/Common/CMakeLists.txt index fc63660424ab..c91f42ba0445 100644 --- a/compiler/src/iree/compiler/Codegen/Common/CMakeLists.txt +++ b/compiler/src/iree/compiler/Codegen/Common/CMakeLists.txt @@ -31,6 +31,7 @@ iree_cc_library( MLIRLinalgTransforms MLIRMemRefDialect MLIRPass + MLIRTransformUtils MLIRTransforms iree::compiler::Codegen::Dialect::Codegen::IR::IREECodegenDialect iree::compiler::Dialect::HAL::IR @@ -157,6 +158,7 @@ iree_cc_library( MLIRTensorUtils MLIRTilingInterface MLIRTransformDialect + MLIRTransformUtils MLIRTransforms MLIRValueBoundsOpInterface MLIRVectorDialect @@ -230,6 +232,7 @@ iree_cc_library( MLIRTransformDialect MLIRTransformDialectTransforms MLIRTransformLoopExtension + MLIRTransformUtils MLIRTransforms MLIRVectorDialect MLIRVectorTransformOps diff --git a/compiler/src/iree/compiler/Codegen/Common/CPU/BUILD.bazel b/compiler/src/iree/compiler/Codegen/Common/CPU/BUILD.bazel index ffd2fc2a1d8f..e7113898c469 100644 --- a/compiler/src/iree/compiler/Codegen/Common/CPU/BUILD.bazel +++ b/compiler/src/iree/compiler/Codegen/Common/CPU/BUILD.bazel @@ -87,6 +87,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:Support", "@llvm-project//mlir:TensorDialect", "@llvm-project//mlir:TensorTransforms", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", "@llvm-project//mlir:VectorDialect", "@llvm-project//mlir:VectorToSCF", diff --git a/compiler/src/iree/compiler/Codegen/Common/CPU/CMakeLists.txt b/compiler/src/iree/compiler/Codegen/Common/CPU/CMakeLists.txt index 6f219ac44db5..680313889edb 100644 --- a/compiler/src/iree/compiler/Codegen/Common/CPU/CMakeLists.txt +++ b/compiler/src/iree/compiler/Codegen/Common/CPU/CMakeLists.txt @@ -70,6 +70,7 @@ iree_cc_library( MLIRSupport MLIRTensorDialect MLIRTensorTransforms + MLIRTransformUtils MLIRTransforms MLIRVectorDialect MLIRVectorToSCF diff --git a/compiler/src/iree/compiler/Codegen/Common/CPU/CPULowerToUKernels.cpp b/compiler/src/iree/compiler/Codegen/Common/CPU/CPULowerToUKernels.cpp index 52487774d598..e82d066aabf7 100644 --- a/compiler/src/iree/compiler/Codegen/Common/CPU/CPULowerToUKernels.cpp +++ b/compiler/src/iree/compiler/Codegen/Common/CPU/CPULowerToUKernels.cpp @@ -65,8 +65,10 @@ class CPULowerToUKernelsPass void runOnOperation() override; - LogicalResult initializeOptions(StringRef options) override { - if (failed(Pass::initializeOptions(options))) { + LogicalResult initializeOptions( + StringRef options, + function_ref errorHandler) override { + if (failed(Pass::initializeOptions(options, errorHandler))) { return failure(); } // This option defaults to `true` both in Passes.td and in C++ code. diff --git a/compiler/src/iree/compiler/Codegen/Common/GPU/BUILD.bazel b/compiler/src/iree/compiler/Codegen/Common/GPU/BUILD.bazel index cdd6b0fa7583..ebbf7b3a2ba4 100644 --- a/compiler/src/iree/compiler/Codegen/Common/GPU/BUILD.bazel +++ b/compiler/src/iree/compiler/Codegen/Common/GPU/BUILD.bazel @@ -42,6 +42,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:MemRefDialect", "@llvm-project//mlir:NVGPUDialect", "@llvm-project//mlir:Pass", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) @@ -122,6 +123,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:Support", "@llvm-project//mlir:TensorDialect", "@llvm-project//mlir:TensorTransforms", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", "@llvm-project//mlir:VectorDialect", "@llvm-project//mlir:VectorToSCF", diff --git a/compiler/src/iree/compiler/Codegen/Common/GPU/CMakeLists.txt b/compiler/src/iree/compiler/Codegen/Common/GPU/CMakeLists.txt index 754e6c4a51d6..ebb98a1268e0 100644 --- a/compiler/src/iree/compiler/Codegen/Common/GPU/CMakeLists.txt +++ b/compiler/src/iree/compiler/Codegen/Common/GPU/CMakeLists.txt @@ -32,6 +32,7 @@ iree_cc_library( MLIRMemRefDialect MLIRNVGPUDialect MLIRPass + MLIRTransformUtils MLIRTransforms iree::compiler::Codegen::Dialect::Codegen::IR::IREECodegenDialect iree::compiler::Dialect::HAL::IR @@ -106,6 +107,7 @@ iree_cc_library( MLIRSupport MLIRTensorDialect MLIRTensorTransforms + MLIRTransformUtils MLIRTransforms MLIRVectorDialect MLIRVectorToSCF diff --git a/compiler/src/iree/compiler/Codegen/Common/GPU/WorkgroupReordering.cpp b/compiler/src/iree/compiler/Codegen/Common/GPU/WorkgroupReordering.cpp index 67ff056be40b..8edbd5cb067d 100644 --- a/compiler/src/iree/compiler/Codegen/Common/GPU/WorkgroupReordering.cpp +++ b/compiler/src/iree/compiler/Codegen/Common/GPU/WorkgroupReordering.cpp @@ -187,8 +187,10 @@ struct ReorderWorkgroupsPass final void getDependentDialects(DialectRegistry ®istry) const override { registry.insert(); } - LogicalResult initializeOptions(StringRef options) override { - if (failed(Pass::initializeOptions(options))) { + LogicalResult initializeOptions( + StringRef options, + function_ref errorHandler) override { + if (failed(Pass::initializeOptions(options, errorHandler))) { return failure(); } logSwizzleTile = logTile; diff --git a/compiler/src/iree/compiler/Codegen/Common/OptimizeVectorTransferPass.cpp b/compiler/src/iree/compiler/Codegen/Common/OptimizeVectorTransferPass.cpp index 2a03b446e592..331e39885fef 100644 --- a/compiler/src/iree/compiler/Codegen/Common/OptimizeVectorTransferPass.cpp +++ b/compiler/src/iree/compiler/Codegen/Common/OptimizeVectorTransferPass.cpp @@ -134,8 +134,10 @@ struct OptimizeVectorTransferPass LDBG("after erasing unused allocs and stores\n" << funcOp); } - LogicalResult initializeOptions(StringRef options) override { - if (failed(Pass::initializeOptions(options))) { + LogicalResult initializeOptions( + StringRef options, + function_ref errorHandler) override { + if (failed(Pass::initializeOptions(options, errorHandler))) { return failure(); } // `flatten` may have been set to `true` in the constructor already. diff --git a/compiler/src/iree/compiler/Codegen/Common/TransformExtensions/BUILD.bazel b/compiler/src/iree/compiler/Codegen/Common/TransformExtensions/BUILD.bazel index 8d985ac051f9..76f01b5c6332 100644 --- a/compiler/src/iree/compiler/Codegen/Common/TransformExtensions/BUILD.bazel +++ b/compiler/src/iree/compiler/Codegen/Common/TransformExtensions/BUILD.bazel @@ -100,6 +100,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:TensorTransforms", "@llvm-project//mlir:TransformDialect", "@llvm-project//mlir:TransformDialectInterfaces", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", "@llvm-project//mlir:VectorDialect", "@llvm-project//mlir:VectorToGPU", diff --git a/compiler/src/iree/compiler/Codegen/Common/TransformExtensions/CMakeLists.txt b/compiler/src/iree/compiler/Codegen/Common/TransformExtensions/CMakeLists.txt index c53c099485b5..b3f4a08006f4 100644 --- a/compiler/src/iree/compiler/Codegen/Common/TransformExtensions/CMakeLists.txt +++ b/compiler/src/iree/compiler/Codegen/Common/TransformExtensions/CMakeLists.txt @@ -60,6 +60,7 @@ iree_cc_library( MLIRTensorTransforms MLIRTransformDialect MLIRTransformDialectInterfaces + MLIRTransformUtils MLIRTransforms MLIRVectorDialect MLIRVectorToGPU diff --git a/compiler/src/iree/compiler/Codegen/LLVMCPU/BUILD.bazel b/compiler/src/iree/compiler/Codegen/LLVMCPU/BUILD.bazel index da9677bee5e0..d0302949eb8e 100644 --- a/compiler/src/iree/compiler/Codegen/LLVMCPU/BUILD.bazel +++ b/compiler/src/iree/compiler/Codegen/LLVMCPU/BUILD.bazel @@ -40,6 +40,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:LinalgTransforms", "@llvm-project//mlir:MemRefDialect", "@llvm-project//mlir:Pass", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) @@ -158,6 +159,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:TosaDialect", "@llvm-project//mlir:TosaToArith", "@llvm-project//mlir:TransformDialect", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", "@llvm-project//mlir:ValueBoundsOpInterface", "@llvm-project//mlir:VectorDialect", diff --git a/compiler/src/iree/compiler/Codegen/LLVMCPU/CMakeLists.txt b/compiler/src/iree/compiler/Codegen/LLVMCPU/CMakeLists.txt index d003960df727..f794896e9dc9 100644 --- a/compiler/src/iree/compiler/Codegen/LLVMCPU/CMakeLists.txt +++ b/compiler/src/iree/compiler/Codegen/LLVMCPU/CMakeLists.txt @@ -31,6 +31,7 @@ iree_cc_library( MLIRLinalgTransforms MLIRMemRefDialect MLIRPass + MLIRTransformUtils MLIRTransforms iree::compiler::Codegen::Dialect::Codegen::IR::IREECodegenDialect iree::compiler::Dialect::HAL::IR @@ -131,6 +132,7 @@ iree_cc_library( MLIRTosaDialect MLIRTosaToArith MLIRTransformDialect + MLIRTransformUtils MLIRTransforms MLIRValueBoundsOpInterface MLIRVectorDialect diff --git a/compiler/src/iree/compiler/Codegen/LLVMGPU/BUILD.bazel b/compiler/src/iree/compiler/Codegen/LLVMGPU/BUILD.bazel index 81bf50613d54..1e6e4eb4950d 100644 --- a/compiler/src/iree/compiler/Codegen/LLVMGPU/BUILD.bazel +++ b/compiler/src/iree/compiler/Codegen/LLVMGPU/BUILD.bazel @@ -200,6 +200,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:Support", "@llvm-project//mlir:TensorDialect", "@llvm-project//mlir:TransformDialect", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", "@llvm-project//mlir:ValueBoundsOpInterface", "@llvm-project//mlir:VectorDialect", diff --git a/compiler/src/iree/compiler/Codegen/LLVMGPU/CMakeLists.txt b/compiler/src/iree/compiler/Codegen/LLVMGPU/CMakeLists.txt index ba93a836ae7f..bd99273f8066 100644 --- a/compiler/src/iree/compiler/Codegen/LLVMGPU/CMakeLists.txt +++ b/compiler/src/iree/compiler/Codegen/LLVMGPU/CMakeLists.txt @@ -157,6 +157,7 @@ iree_cc_library( MLIRSupport MLIRTensorDialect MLIRTransformDialect + MLIRTransformUtils MLIRTransforms MLIRValueBoundsOpInterface MLIRVectorDialect diff --git a/compiler/src/iree/compiler/Codegen/LLVMGPU/TransformExtensions/BUILD.bazel b/compiler/src/iree/compiler/Codegen/LLVMGPU/TransformExtensions/BUILD.bazel index f1cb18110b62..9c870dc10b81 100644 --- a/compiler/src/iree/compiler/Codegen/LLVMGPU/TransformExtensions/BUILD.bazel +++ b/compiler/src/iree/compiler/Codegen/LLVMGPU/TransformExtensions/BUILD.bazel @@ -71,6 +71,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:ArithDialect", "@llvm-project//mlir:BufferizationDialect", "@llvm-project//mlir:BufferizationInterfaces", + "@llvm-project//mlir:BytecodeOpInterface", "@llvm-project//mlir:DialectUtils", "@llvm-project//mlir:FuncDialect", "@llvm-project//mlir:FunctionInterfaces", @@ -89,6 +90,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:TensorTransformOps", "@llvm-project//mlir:TransformDialect", "@llvm-project//mlir:TransformDialectInterfaces", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", "@llvm-project//mlir:VectorDialect", "@llvm-project//mlir:VectorToGPU", diff --git a/compiler/src/iree/compiler/Codegen/LLVMGPU/TransformExtensions/CMakeLists.txt b/compiler/src/iree/compiler/Codegen/LLVMGPU/TransformExtensions/CMakeLists.txt index 6c20675e9511..3afc5fa37e9b 100644 --- a/compiler/src/iree/compiler/Codegen/LLVMGPU/TransformExtensions/CMakeLists.txt +++ b/compiler/src/iree/compiler/Codegen/LLVMGPU/TransformExtensions/CMakeLists.txt @@ -38,6 +38,7 @@ iree_cc_library( MLIRAffineDialect MLIRArithDialect MLIRBufferizationDialect + MLIRBytecodeOpInterface MLIRFuncDialect MLIRFunctionInterfaces MLIRGPUDialect @@ -55,6 +56,7 @@ iree_cc_library( MLIRTensorTransformOps MLIRTransformDialect MLIRTransformDialectInterfaces + MLIRTransformUtils MLIRTransforms MLIRVectorDialect MLIRVectorToGPU diff --git a/compiler/src/iree/compiler/Codegen/SPIRV/BUILD.bazel b/compiler/src/iree/compiler/Codegen/SPIRV/BUILD.bazel index a46721b0d3d3..30c56a49ecd4 100644 --- a/compiler/src/iree/compiler/Codegen/SPIRV/BUILD.bazel +++ b/compiler/src/iree/compiler/Codegen/SPIRV/BUILD.bazel @@ -40,6 +40,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:LinalgTransforms", "@llvm-project//mlir:MemRefDialect", "@llvm-project//mlir:Pass", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) @@ -151,6 +152,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:TosaDialect", "@llvm-project//mlir:TosaToArith", "@llvm-project//mlir:TransformDialect", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", "@llvm-project//mlir:VectorDialect", "@llvm-project//mlir:VectorInterfaces", diff --git a/compiler/src/iree/compiler/Codegen/SPIRV/CMakeLists.txt b/compiler/src/iree/compiler/Codegen/SPIRV/CMakeLists.txt index 630f5ed9eeb1..7c608f1d502d 100644 --- a/compiler/src/iree/compiler/Codegen/SPIRV/CMakeLists.txt +++ b/compiler/src/iree/compiler/Codegen/SPIRV/CMakeLists.txt @@ -31,6 +31,7 @@ iree_cc_library( MLIRLinalgTransforms MLIRMemRefDialect MLIRPass + MLIRTransformUtils MLIRTransforms iree::compiler::Codegen::Dialect::Codegen::IR::IREECodegenDialect iree::compiler::Dialect::HAL::IR @@ -127,6 +128,7 @@ iree_cc_library( MLIRTosaDialect MLIRTosaToArith MLIRTransformDialect + MLIRTransformUtils MLIRTransforms MLIRVectorDialect MLIRVectorInterfaces diff --git a/compiler/src/iree/compiler/Codegen/SPIRV/ConvertToSPIRVPass.cpp b/compiler/src/iree/compiler/Codegen/SPIRV/ConvertToSPIRVPass.cpp index cdfb6dfc4b6a..4d3e61fe5ade 100644 --- a/compiler/src/iree/compiler/Codegen/SPIRV/ConvertToSPIRVPass.cpp +++ b/compiler/src/iree/compiler/Codegen/SPIRV/ConvertToSPIRVPass.cpp @@ -483,14 +483,13 @@ class ConvertToSPIRVPass final : public ConvertToSPIRVBase { registry.insert(); } - explicit ConvertToSPIRVPass(bool enableFastMath, unsigned indexBits) - : enableFastMath(enableFastMath), indexBits(indexBits) {} + explicit ConvertToSPIRVPass(unsigned indexBits) : indexBits(indexBits) {} - LogicalResult initializeOptions(StringRef options) override { - if (failed(Pass::initializeOptions(options))) + LogicalResult initializeOptions( + StringRef options, + function_ref errorHandler) override { + if (failed(Pass::initializeOptions(options, errorHandler))) return failure(); - // Use pass option if present. - enableFastMath |= enableFastMathOption; indexBits = indexBitsOption; return success(); } @@ -498,9 +497,6 @@ class ConvertToSPIRVPass final : public ConvertToSPIRVBase { void runOnOperation() override; private: - // Enable fast math when doing type conversion by assuming no NaN or infinite - // values. - bool enableFastMath; // Use 64 bits for index widths. unsigned indexBits; }; @@ -631,7 +627,6 @@ void ConvertToSPIRVPass::runOnOperation() { } SPIRVConversionOptions options = {}; - options.enableFastMathMode = this->enableFastMath; options.use64bitIndex = use64bitIndex; SPIRVTypeConverter typeConverter(targetAttr, options); @@ -746,8 +741,8 @@ void ConvertToSPIRVPass::runOnOperation() { //===----------------------------------------------------------------------===// std::unique_ptr> -createConvertToSPIRVPass(bool enableFastMath, unsigned indexBits) { - return std::make_unique(enableFastMath, indexBits); +createConvertToSPIRVPass(unsigned indexBits) { + return std::make_unique(indexBits); } } // namespace mlir::iree_compiler diff --git a/compiler/src/iree/compiler/Codegen/SPIRV/Passes.cpp b/compiler/src/iree/compiler/Codegen/SPIRV/Passes.cpp index 572ac9511d21..28894a58de27 100644 --- a/compiler/src/iree/compiler/Codegen/SPIRV/Passes.cpp +++ b/compiler/src/iree/compiler/Codegen/SPIRV/Passes.cpp @@ -228,7 +228,7 @@ static void addMemRefLoweringPasses(OpPassManager &pm) { } /// Adds passes to perform the final SPIR-V conversion. -static void addSPIRVLoweringPasses(OpPassManager &pm, bool enableFastMath) { +static void addSPIRVLoweringPasses(OpPassManager &pm) { pm.addPass(createCanonicalizerPass()); pm.addPass(createCSEPass()); @@ -248,7 +248,7 @@ static void addSPIRVLoweringPasses(OpPassManager &pm, bool enableFastMath) { pm.addPass(createCanonicalizerPass()); pm.addPass(createCSEPass()); - pm.addPass(createConvertToSPIRVPass(enableFastMath, clSPIRVIndexingBits)); + pm.addPass(createConvertToSPIRVPass(clSPIRVIndexingBits)); auto getTargetEnv = [](spirv::ModuleOp moduleOp) { return getSPIRVTargetEnvAttr(moduleOp); @@ -668,11 +668,11 @@ void buildSPIRVCodegenConfigurationPassPipeline(OpPassManager &pm) { pm.addPass(createSPIRVSelectLoweringStrategyPass()); } -void buildSPIRVCodegenPassPipeline(OpPassManager &pm, bool enableFastMath) { +void buildSPIRVCodegenPassPipeline(OpPassManager &pm) { pm.addPass(createSPIRVLowerExecutableTargetPass()); addMemRefLoweringPasses(pm.nest()); - addSPIRVLoweringPasses(pm.nest(), enableFastMath); + addSPIRVLoweringPasses(pm.nest()); LLVM_DEBUG({ llvm::dbgs() << "Using SPIR-V pass pipeline:\n"; @@ -726,7 +726,7 @@ void registerCodegenSPIRVPasses() { "iree-codegen-linalg-to-spirv-pipeline", "Runs the progressive lowering pipeline from linalg to SPIR-V", [](OpPassManager &passManager) { - buildSPIRVCodegenPassPipeline(passManager, /*enableFastMath=*/false); + buildSPIRVCodegenPassPipeline(passManager); }); } diff --git a/compiler/src/iree/compiler/Codegen/SPIRV/Passes.h b/compiler/src/iree/compiler/Codegen/SPIRV/Passes.h index 8814378b2707..28c4aee3ba14 100644 --- a/compiler/src/iree/compiler/Codegen/SPIRV/Passes.h +++ b/compiler/src/iree/compiler/Codegen/SPIRV/Passes.h @@ -61,7 +61,7 @@ void buildSPIRVCodegenConfigurationPassPipeline(OpPassManager &pm); /// Populates passes needed to lower linalg/arith/math ops to SPIR-V ops via /// the structured ops path. The pass manager `pm` here operate on the module /// within the IREE::HAL::ExecutableOp. -void buildSPIRVCodegenPassPipeline(OpPassManager &pm, bool enableFastMath); +void buildSPIRVCodegenPassPipeline(OpPassManager &pm); /// Populates passes needed to link HAL executables across SPIRV targets. void buildSPIRVLinkingPassPipeline(OpPassManager &passManager); @@ -76,7 +76,7 @@ void buildSPIRVLinkingPassPipeline(OpPassManager &passManager); /// GPU processor ID ops into SPIR-V global variables, loop/standard ops into /// corresponding SPIR-V ops. std::unique_ptr> -createConvertToSPIRVPass(bool enableFastMath = false, unsigned indexWidth = 32); +createConvertToSPIRVPass(unsigned indexWidth = 32); /// Annotates the innermost Winograd loops with the spirv distribute attribute. std::unique_ptr> diff --git a/compiler/src/iree/compiler/Codegen/SPIRV/Passes.td b/compiler/src/iree/compiler/Codegen/SPIRV/Passes.td index 30d6a6b877f2..8990965612ef 100644 --- a/compiler/src/iree/compiler/Codegen/SPIRV/Passes.td +++ b/compiler/src/iree/compiler/Codegen/SPIRV/Passes.td @@ -17,8 +17,6 @@ def ConvertToSPIRV : Pass<"iree-convert-to-spirv", "ModuleOp"> { let summary = "Perform the final conversion to SPIR-V dialect"; let constructor = "mlir::iree_compiler::createConvertToSPIRVPass()"; let options = [ - Option<"enableFastMathOption", "enable-fast-math", "bool", /*default=*/"false", - "Enable fast math mode during type conversion (i.e. assume no NaN/infinity)">, Option<"indexBitsOption", "index-bits", "unsigned", /*default=*/"32", "Specify the bit widths for SPIR-V indices">, ]; diff --git a/compiler/src/iree/compiler/Codegen/SPIRV/SPIRVTileAndPromote.cpp b/compiler/src/iree/compiler/Codegen/SPIRV/SPIRVTileAndPromote.cpp index beba1e225396..cead85bd4c4f 100644 --- a/compiler/src/iree/compiler/Codegen/SPIRV/SPIRVTileAndPromote.cpp +++ b/compiler/src/iree/compiler/Codegen/SPIRV/SPIRVTileAndPromote.cpp @@ -115,8 +115,10 @@ class SPIRVTileAndPromotePass final registry.insert(); } - LogicalResult initializeOptions(StringRef options) override { - if (failed(Pass::initializeOptions(options))) + LogicalResult initializeOptions( + StringRef options, + function_ref errorHandler) override { + if (failed(Pass::initializeOptions(options, errorHandler))) return failure(); // Consider pass option too promoteCMatrix |= this->promoteC; diff --git a/compiler/src/iree/compiler/Codegen/Transforms/BUILD.bazel b/compiler/src/iree/compiler/Codegen/Transforms/BUILD.bazel index 3699c8e871d7..e653ef9a3050 100644 --- a/compiler/src/iree/compiler/Codegen/Transforms/BUILD.bazel +++ b/compiler/src/iree/compiler/Codegen/Transforms/BUILD.bazel @@ -41,6 +41,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:Pass", "@llvm-project//mlir:SCFTransforms", "@llvm-project//mlir:Support", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", "@llvm-project//mlir:ValueBoundsOpInterface", "@llvm-project//mlir:VectorDialect", diff --git a/compiler/src/iree/compiler/Codegen/Transforms/CMakeLists.txt b/compiler/src/iree/compiler/Codegen/Transforms/CMakeLists.txt index 48b9f480b2ed..dfc314e01e28 100644 --- a/compiler/src/iree/compiler/Codegen/Transforms/CMakeLists.txt +++ b/compiler/src/iree/compiler/Codegen/Transforms/CMakeLists.txt @@ -34,6 +34,7 @@ iree_cc_library( MLIRPass MLIRSCFTransforms MLIRSupport + MLIRTransformUtils MLIRTransforms MLIRValueBoundsOpInterface MLIRVectorDialect diff --git a/compiler/src/iree/compiler/Codegen/VMVX/BUILD.bazel b/compiler/src/iree/compiler/Codegen/VMVX/BUILD.bazel index cba89064913b..52f5005d496d 100644 --- a/compiler/src/iree/compiler/Codegen/VMVX/BUILD.bazel +++ b/compiler/src/iree/compiler/Codegen/VMVX/BUILD.bazel @@ -40,6 +40,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:LinalgTransforms", "@llvm-project//mlir:MemRefDialect", "@llvm-project//mlir:Pass", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) @@ -88,6 +89,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:Pass", "@llvm-project//mlir:TensorDialect", "@llvm-project//mlir:TensorTransforms", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", "@llvm-project//mlir:VectorDialect", ], diff --git a/compiler/src/iree/compiler/Codegen/VMVX/CMakeLists.txt b/compiler/src/iree/compiler/Codegen/VMVX/CMakeLists.txt index d5bf95f9a4f8..391caba1ab84 100644 --- a/compiler/src/iree/compiler/Codegen/VMVX/CMakeLists.txt +++ b/compiler/src/iree/compiler/Codegen/VMVX/CMakeLists.txt @@ -31,6 +31,7 @@ iree_cc_library( MLIRLinalgTransforms MLIRMemRefDialect MLIRPass + MLIRTransformUtils MLIRTransforms iree::compiler::Codegen::Dialect::Codegen::IR::IREECodegenDialect iree::compiler::Dialect::HAL::IR @@ -68,6 +69,7 @@ iree_cc_library( MLIRPass MLIRTensorDialect MLIRTensorTransforms + MLIRTransformUtils MLIRTransforms MLIRVectorDialect iree::compiler::Codegen::Common diff --git a/compiler/src/iree/compiler/Dialect/Flow/Conversion/MeshToFlow/BUILD.bazel b/compiler/src/iree/compiler/Dialect/Flow/Conversion/MeshToFlow/BUILD.bazel index 32305c5ddd3e..1bf50380ffd4 100644 --- a/compiler/src/iree/compiler/Dialect/Flow/Conversion/MeshToFlow/BUILD.bazel +++ b/compiler/src/iree/compiler/Dialect/Flow/Conversion/MeshToFlow/BUILD.bazel @@ -37,6 +37,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:Pass", "@llvm-project//mlir:Support", "@llvm-project//mlir:TensorDialect", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) diff --git a/compiler/src/iree/compiler/Dialect/Flow/Conversion/MeshToFlow/CMakeLists.txt b/compiler/src/iree/compiler/Dialect/Flow/Conversion/MeshToFlow/CMakeLists.txt index f1028f29a106..cab6671c8b26 100644 --- a/compiler/src/iree/compiler/Dialect/Flow/Conversion/MeshToFlow/CMakeLists.txt +++ b/compiler/src/iree/compiler/Dialect/Flow/Conversion/MeshToFlow/CMakeLists.txt @@ -30,6 +30,7 @@ iree_cc_library( MLIRPass MLIRSupport MLIRTensorDialect + MLIRTransformUtils MLIRTransforms iree::compiler::Dialect::Flow::IR iree::compiler::Dialect::Util::IR diff --git a/compiler/src/iree/compiler/Dialect/Flow/TransformExtensions/BUILD.bazel b/compiler/src/iree/compiler/Dialect/Flow/TransformExtensions/BUILD.bazel index c4a45b1594c4..a29e25417b2d 100644 --- a/compiler/src/iree/compiler/Dialect/Flow/TransformExtensions/BUILD.bazel +++ b/compiler/src/iree/compiler/Dialect/Flow/TransformExtensions/BUILD.bazel @@ -62,6 +62,7 @@ iree_compiler_cc_library( "//llvm-external-projects/iree-dialects:IREEDialectsTransforms", "//llvm-external-projects/iree-dialects:IREELinalgTransformDialect", "@llvm-project//mlir:ArithDialect", + "@llvm-project//mlir:BytecodeOpInterface", "@llvm-project//mlir:IR", "@llvm-project//mlir:PDLDialect", "@llvm-project//mlir:SCFDialect", diff --git a/compiler/src/iree/compiler/Dialect/Flow/TransformExtensions/CMakeLists.txt b/compiler/src/iree/compiler/Dialect/Flow/TransformExtensions/CMakeLists.txt index 9911ffd9d50f..ea1f1319a7ed 100644 --- a/compiler/src/iree/compiler/Dialect/Flow/TransformExtensions/CMakeLists.txt +++ b/compiler/src/iree/compiler/Dialect/Flow/TransformExtensions/CMakeLists.txt @@ -34,6 +34,7 @@ iree_cc_library( IREEDialectsTransforms IREELinalgTransformDialect MLIRArithDialect + MLIRBytecodeOpInterface MLIRIR MLIRPDLDialect MLIRSCFDialect diff --git a/compiler/src/iree/compiler/Dialect/Flow/Transforms/TensorPadToTensorInsertSlice.cpp b/compiler/src/iree/compiler/Dialect/Flow/Transforms/TensorPadToTensorInsertSlice.cpp index 805a073a1e49..a3367bd7b711 100644 --- a/compiler/src/iree/compiler/Dialect/Flow/Transforms/TensorPadToTensorInsertSlice.cpp +++ b/compiler/src/iree/compiler/Dialect/Flow/Transforms/TensorPadToTensorInsertSlice.cpp @@ -92,8 +92,10 @@ struct TensorPadToTensorInsertSlicePass mlir::math::MathDialect, mlir::arith::ArithDialect>(); } - LogicalResult initializeOptions(StringRef options) override { - if (failed(Pass::initializeOptions(options))) { + LogicalResult initializeOptions( + StringRef options, + function_ref errorHandler) override { + if (failed(Pass::initializeOptions(options, errorHandler))) { return failure(); } // `skipSingleLinalgOpUses` may have been set to `true` in the constructor diff --git a/compiler/src/iree/compiler/Dialect/HAL/Conversion/BUILD.bazel b/compiler/src/iree/compiler/Dialect/HAL/Conversion/BUILD.bazel index a0f148880c2a..0343df9401d7 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Conversion/BUILD.bazel +++ b/compiler/src/iree/compiler/Dialect/HAL/Conversion/BUILD.bazel @@ -30,6 +30,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:FunctionInterfaces", "@llvm-project//mlir:IR", "@llvm-project//mlir:MemRefDialect", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) diff --git a/compiler/src/iree/compiler/Dialect/HAL/Conversion/CMakeLists.txt b/compiler/src/iree/compiler/Dialect/HAL/Conversion/CMakeLists.txt index 417047c6bf5f..9f699149794d 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Conversion/CMakeLists.txt +++ b/compiler/src/iree/compiler/Dialect/HAL/Conversion/CMakeLists.txt @@ -25,6 +25,7 @@ iree_cc_library( MLIRFunctionInterfaces MLIRIR MLIRMemRefDialect + MLIRTransformUtils MLIRTransforms iree::compiler::Dialect::HAL::IR iree::compiler::Dialect::Util::IR diff --git a/compiler/src/iree/compiler/Dialect/HAL/Conversion/HALToHAL/BUILD.bazel b/compiler/src/iree/compiler/Dialect/HAL/Conversion/HALToHAL/BUILD.bazel index 028edd5a906a..d3c33fb3ea48 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Conversion/HALToHAL/BUILD.bazel +++ b/compiler/src/iree/compiler/Dialect/HAL/Conversion/HALToHAL/BUILD.bazel @@ -23,6 +23,7 @@ iree_compiler_cc_library( deps = [ "//compiler/src/iree/compiler/Dialect/HAL/IR", "@llvm-project//mlir:IR", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) diff --git a/compiler/src/iree/compiler/Dialect/HAL/Conversion/HALToHAL/CMakeLists.txt b/compiler/src/iree/compiler/Dialect/HAL/Conversion/HALToHAL/CMakeLists.txt index fec5123c8c0b..832a19d91937 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Conversion/HALToHAL/CMakeLists.txt +++ b/compiler/src/iree/compiler/Dialect/HAL/Conversion/HALToHAL/CMakeLists.txt @@ -19,6 +19,7 @@ iree_cc_library( "Patterns.cpp" DEPS MLIRIR + MLIRTransformUtils MLIRTransforms iree::compiler::Dialect::HAL::IR PUBLIC diff --git a/compiler/src/iree/compiler/Dialect/HAL/Conversion/HALToVM/BUILD.bazel b/compiler/src/iree/compiler/Dialect/HAL/Conversion/HALToVM/BUILD.bazel index 66ea5af3338c..75732bcbc765 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Conversion/HALToVM/BUILD.bazel +++ b/compiler/src/iree/compiler/Dialect/HAL/Conversion/HALToVM/BUILD.bazel @@ -45,6 +45,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:FunctionInterfaces", "@llvm-project//mlir:IR", "@llvm-project//mlir:Pass", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) diff --git a/compiler/src/iree/compiler/Dialect/HAL/Conversion/HALToVM/CMakeLists.txt b/compiler/src/iree/compiler/Dialect/HAL/Conversion/HALToVM/CMakeLists.txt index 97b5cc49d90a..1378582ab760 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Conversion/HALToVM/CMakeLists.txt +++ b/compiler/src/iree/compiler/Dialect/HAL/Conversion/HALToVM/CMakeLists.txt @@ -34,6 +34,7 @@ iree_cc_library( MLIRFunctionInterfaces MLIRIR MLIRPass + MLIRTransformUtils MLIRTransforms iree::compiler::Dialect::HAL::IR iree::compiler::Dialect::HAL::hal_imports diff --git a/compiler/src/iree/compiler/Dialect/HAL/Conversion/StandardToHAL/BUILD.bazel b/compiler/src/iree/compiler/Dialect/HAL/Conversion/StandardToHAL/BUILD.bazel index 15a68c053124..eff99b66c13f 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Conversion/StandardToHAL/BUILD.bazel +++ b/compiler/src/iree/compiler/Dialect/HAL/Conversion/StandardToHAL/BUILD.bazel @@ -35,6 +35,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:Pass", "@llvm-project//mlir:ShapeDialect", "@llvm-project//mlir:TensorDialect", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) diff --git a/compiler/src/iree/compiler/Dialect/HAL/Conversion/StandardToHAL/CMakeLists.txt b/compiler/src/iree/compiler/Dialect/HAL/Conversion/StandardToHAL/CMakeLists.txt index 7cb5fb98bfff..39d19746d940 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Conversion/StandardToHAL/CMakeLists.txt +++ b/compiler/src/iree/compiler/Dialect/HAL/Conversion/StandardToHAL/CMakeLists.txt @@ -27,6 +27,7 @@ iree_cc_library( MLIRPass MLIRShapeDialect MLIRTensorDialect + MLIRTransformUtils MLIRTransforms iree::compiler::Dialect::HAL::Conversion iree::compiler::Dialect::HAL::IR diff --git a/compiler/src/iree/compiler/Dialect/HAL/Conversion/StreamToHAL/BUILD.bazel b/compiler/src/iree/compiler/Dialect/HAL/Conversion/StreamToHAL/BUILD.bazel index 8386bf9fa31a..236a8a273781 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Conversion/StreamToHAL/BUILD.bazel +++ b/compiler/src/iree/compiler/Dialect/HAL/Conversion/StreamToHAL/BUILD.bazel @@ -35,6 +35,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:IR", "@llvm-project//mlir:Pass", "@llvm-project//mlir:SCFDialect", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) diff --git a/compiler/src/iree/compiler/Dialect/HAL/Conversion/StreamToHAL/CMakeLists.txt b/compiler/src/iree/compiler/Dialect/HAL/Conversion/StreamToHAL/CMakeLists.txt index 4de634b18b29..95dd8ff40b8c 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Conversion/StreamToHAL/CMakeLists.txt +++ b/compiler/src/iree/compiler/Dialect/HAL/Conversion/StreamToHAL/CMakeLists.txt @@ -26,6 +26,7 @@ iree_cc_library( MLIRIR MLIRPass MLIRSCFDialect + MLIRTransformUtils MLIRTransforms iree::compiler::Dialect::HAL::Conversion iree::compiler::Dialect::HAL::IR diff --git a/compiler/src/iree/compiler/Dialect/HAL/Conversion/UtilToHAL/BUILD.bazel b/compiler/src/iree/compiler/Dialect/HAL/Conversion/UtilToHAL/BUILD.bazel index 52c077cb8f91..44708df89c7e 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Conversion/UtilToHAL/BUILD.bazel +++ b/compiler/src/iree/compiler/Dialect/HAL/Conversion/UtilToHAL/BUILD.bazel @@ -27,6 +27,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:FuncDialect", "@llvm-project//mlir:FunctionInterfaces", "@llvm-project//mlir:IR", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) diff --git a/compiler/src/iree/compiler/Dialect/HAL/Conversion/UtilToHAL/CMakeLists.txt b/compiler/src/iree/compiler/Dialect/HAL/Conversion/UtilToHAL/CMakeLists.txt index 0b739bfb2fa1..b0cce4c47b02 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Conversion/UtilToHAL/CMakeLists.txt +++ b/compiler/src/iree/compiler/Dialect/HAL/Conversion/UtilToHAL/CMakeLists.txt @@ -21,6 +21,7 @@ iree_cc_library( MLIRFuncDialect MLIRFunctionInterfaces MLIRIR + MLIRTransformUtils MLIRTransforms iree::compiler::Dialect::HAL::IR iree::compiler::Dialect::Util::Conversion diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/BUILD.bazel b/compiler/src/iree/compiler/Dialect/HAL/Transforms/BUILD.bazel index e6f514d43040..2847a8351fca 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/BUILD.bazel +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/BUILD.bazel @@ -81,6 +81,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:SCFToControlFlow", "@llvm-project//mlir:Support", "@llvm-project//mlir:TensorDialect", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/CMakeLists.txt b/compiler/src/iree/compiler/Dialect/HAL/Transforms/CMakeLists.txt index 4201d373b1a3..8c0584999e82 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/CMakeLists.txt +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/CMakeLists.txt @@ -57,6 +57,7 @@ iree_cc_library( MLIRSCFToControlFlow MLIRSupport MLIRTensorDialect + MLIRTransformUtils MLIRTransforms iree::compiler::Codegen::Common::CPU::CommonCPUPasses iree::compiler::Codegen::Dialect::Codegen::IR::IREECodegenDialect diff --git a/compiler/src/iree/compiler/Dialect/Stream/Conversion/BUILD.bazel b/compiler/src/iree/compiler/Dialect/Stream/Conversion/BUILD.bazel index 92d4dda16c3b..3116a862d1bc 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Conversion/BUILD.bazel +++ b/compiler/src/iree/compiler/Dialect/Stream/Conversion/BUILD.bazel @@ -25,6 +25,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:FuncDialect", "@llvm-project//mlir:FunctionInterfaces", "@llvm-project//mlir:IR", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) diff --git a/compiler/src/iree/compiler/Dialect/Stream/Conversion/CMakeLists.txt b/compiler/src/iree/compiler/Dialect/Stream/Conversion/CMakeLists.txt index d6d13915be19..472fdb95bb93 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Conversion/CMakeLists.txt +++ b/compiler/src/iree/compiler/Dialect/Stream/Conversion/CMakeLists.txt @@ -21,6 +21,7 @@ iree_cc_library( MLIRFuncDialect MLIRFunctionInterfaces MLIRIR + MLIRTransformUtils MLIRTransforms iree::compiler::Dialect::Stream::IR PUBLIC diff --git a/compiler/src/iree/compiler/Dialect/Stream/Conversion/FlowToStream/BUILD.bazel b/compiler/src/iree/compiler/Dialect/Stream/Conversion/FlowToStream/BUILD.bazel index 4f15eceae012..8d471cf14992 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Conversion/FlowToStream/BUILD.bazel +++ b/compiler/src/iree/compiler/Dialect/Stream/Conversion/FlowToStream/BUILD.bazel @@ -29,6 +29,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:FunctionInterfaces", "@llvm-project//mlir:IR", "@llvm-project//mlir:TensorDialect", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) diff --git a/compiler/src/iree/compiler/Dialect/Stream/Conversion/FlowToStream/CMakeLists.txt b/compiler/src/iree/compiler/Dialect/Stream/Conversion/FlowToStream/CMakeLists.txt index 0f14aa1c1d2d..53fab5f6e4c2 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Conversion/FlowToStream/CMakeLists.txt +++ b/compiler/src/iree/compiler/Dialect/Stream/Conversion/FlowToStream/CMakeLists.txt @@ -23,6 +23,7 @@ iree_cc_library( MLIRFunctionInterfaces MLIRIR MLIRTensorDialect + MLIRTransformUtils MLIRTransforms iree::compiler::Dialect::Flow::IR iree::compiler::Dialect::Stream::Conversion diff --git a/compiler/src/iree/compiler/Dialect/Stream/Conversion/HALToStream/BUILD.bazel b/compiler/src/iree/compiler/Dialect/Stream/Conversion/HALToStream/BUILD.bazel index e7dec422dee5..6437fef7b1de 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Conversion/HALToStream/BUILD.bazel +++ b/compiler/src/iree/compiler/Dialect/Stream/Conversion/HALToStream/BUILD.bazel @@ -28,6 +28,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:FuncDialect", "@llvm-project//mlir:FunctionInterfaces", "@llvm-project//mlir:IR", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) diff --git a/compiler/src/iree/compiler/Dialect/Stream/Conversion/HALToStream/CMakeLists.txt b/compiler/src/iree/compiler/Dialect/Stream/Conversion/HALToStream/CMakeLists.txt index 1a9f32a7a4de..fedd69d3a374 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Conversion/HALToStream/CMakeLists.txt +++ b/compiler/src/iree/compiler/Dialect/Stream/Conversion/HALToStream/CMakeLists.txt @@ -22,6 +22,7 @@ iree_cc_library( MLIRFuncDialect MLIRFunctionInterfaces MLIRIR + MLIRTransformUtils MLIRTransforms iree::compiler::Dialect::HAL::IR iree::compiler::Dialect::Stream::Conversion diff --git a/compiler/src/iree/compiler/Dialect/Stream/Conversion/StandardToStream/BUILD.bazel b/compiler/src/iree/compiler/Dialect/Stream/Conversion/StandardToStream/BUILD.bazel index e5ab347f1b0e..646d55e890f8 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Conversion/StandardToStream/BUILD.bazel +++ b/compiler/src/iree/compiler/Dialect/Stream/Conversion/StandardToStream/BUILD.bazel @@ -35,6 +35,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:SCFDialect", "@llvm-project//mlir:ShapeDialect", "@llvm-project//mlir:TensorDialect", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) diff --git a/compiler/src/iree/compiler/Dialect/Stream/Conversion/StandardToStream/CMakeLists.txt b/compiler/src/iree/compiler/Dialect/Stream/Conversion/StandardToStream/CMakeLists.txt index d1462bc5c494..b910c60c1feb 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Conversion/StandardToStream/CMakeLists.txt +++ b/compiler/src/iree/compiler/Dialect/Stream/Conversion/StandardToStream/CMakeLists.txt @@ -30,6 +30,7 @@ iree_cc_library( MLIRSCFDialect MLIRShapeDialect MLIRTensorDialect + MLIRTransformUtils MLIRTransforms iree::compiler::Dialect::Stream::Conversion iree::compiler::Dialect::Stream::IR diff --git a/compiler/src/iree/compiler/Dialect/Stream/Conversion/UtilToStream/BUILD.bazel b/compiler/src/iree/compiler/Dialect/Stream/Conversion/UtilToStream/BUILD.bazel index 4a01cc10a731..a8e3750559b2 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Conversion/UtilToStream/BUILD.bazel +++ b/compiler/src/iree/compiler/Dialect/Stream/Conversion/UtilToStream/BUILD.bazel @@ -27,6 +27,7 @@ iree_compiler_cc_library( "//compiler/src/iree/compiler/Dialect/Util/IR", "@llvm-project//mlir:FunctionInterfaces", "@llvm-project//mlir:IR", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) diff --git a/compiler/src/iree/compiler/Dialect/Stream/Conversion/UtilToStream/CMakeLists.txt b/compiler/src/iree/compiler/Dialect/Stream/Conversion/UtilToStream/CMakeLists.txt index e3957bb18d82..2dd6fdd25c10 100644 --- a/compiler/src/iree/compiler/Dialect/Stream/Conversion/UtilToStream/CMakeLists.txt +++ b/compiler/src/iree/compiler/Dialect/Stream/Conversion/UtilToStream/CMakeLists.txt @@ -20,6 +20,7 @@ iree_cc_library( DEPS MLIRFunctionInterfaces MLIRIR + MLIRTransformUtils MLIRTransforms iree::compiler::Dialect::Stream::Conversion iree::compiler::Dialect::Stream::IR diff --git a/compiler/src/iree/compiler/Dialect/Util/Conversion/BUILD.bazel b/compiler/src/iree/compiler/Dialect/Util/Conversion/BUILD.bazel index 16054b14e00c..56f212b7bc72 100644 --- a/compiler/src/iree/compiler/Dialect/Util/Conversion/BUILD.bazel +++ b/compiler/src/iree/compiler/Dialect/Util/Conversion/BUILD.bazel @@ -31,6 +31,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:Pass", "@llvm-project//mlir:SCFDialect", "@llvm-project//mlir:Support", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) diff --git a/compiler/src/iree/compiler/Dialect/Util/Conversion/CMakeLists.txt b/compiler/src/iree/compiler/Dialect/Util/Conversion/CMakeLists.txt index d30daba96155..42cda397d5ab 100644 --- a/compiler/src/iree/compiler/Dialect/Util/Conversion/CMakeLists.txt +++ b/compiler/src/iree/compiler/Dialect/Util/Conversion/CMakeLists.txt @@ -27,6 +27,7 @@ iree_cc_library( MLIRPass MLIRSCFDialect MLIRSupport + MLIRTransformUtils MLIRTransforms iree::compiler::Dialect::Util::IR PUBLIC diff --git a/compiler/src/iree/compiler/Dialect/Util/IR/BUILD.bazel b/compiler/src/iree/compiler/Dialect/Util/IR/BUILD.bazel index d7478ddbb09c..da0d9ae71189 100644 --- a/compiler/src/iree/compiler/Dialect/Util/IR/BUILD.bazel +++ b/compiler/src/iree/compiler/Dialect/Util/IR/BUILD.bazel @@ -87,11 +87,13 @@ iree_compiler_cc_library( "@llvm-project//mlir:FunctionInterfaces", "@llvm-project//mlir:IR", "@llvm-project//mlir:InferTypeOpInterface", + "@llvm-project//mlir:InliningUtils", "@llvm-project//mlir:MemRefDialect", "@llvm-project//mlir:Parser", "@llvm-project//mlir:SideEffectInterfaces", "@llvm-project//mlir:Support", "@llvm-project//mlir:TensorDialect", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", "@llvm-project//mlir:ViewLikeInterface", ], diff --git a/compiler/src/iree/compiler/Dialect/Util/IR/CMakeLists.txt b/compiler/src/iree/compiler/Dialect/Util/IR/CMakeLists.txt index e0d1ad7b54c7..0365e6d16e38 100644 --- a/compiler/src/iree/compiler/Dialect/Util/IR/CMakeLists.txt +++ b/compiler/src/iree/compiler/Dialect/Util/IR/CMakeLists.txt @@ -61,6 +61,7 @@ iree_cc_library( MLIRSideEffectInterfaces MLIRSupport MLIRTensorDialect + MLIRTransformUtils MLIRTransforms MLIRViewLikeInterface PUBLIC diff --git a/compiler/src/iree/compiler/Dialect/Util/Transforms/BUILD.bazel b/compiler/src/iree/compiler/Dialect/Util/Transforms/BUILD.bazel index c4b92f5abc54..ed200bd013ef 100644 --- a/compiler/src/iree/compiler/Dialect/Util/Transforms/BUILD.bazel +++ b/compiler/src/iree/compiler/Dialect/Util/Transforms/BUILD.bazel @@ -68,6 +68,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:Pass", "@llvm-project//mlir:SCFDialect", "@llvm-project//mlir:Support", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", "@llvm-project//mlir:VectorDialect", ], diff --git a/compiler/src/iree/compiler/Dialect/Util/Transforms/CMakeLists.txt b/compiler/src/iree/compiler/Dialect/Util/Transforms/CMakeLists.txt index 3f77e4d401ad..08dd96e4f56f 100644 --- a/compiler/src/iree/compiler/Dialect/Util/Transforms/CMakeLists.txt +++ b/compiler/src/iree/compiler/Dialect/Util/Transforms/CMakeLists.txt @@ -56,6 +56,7 @@ iree_cc_library( MLIRPass MLIRSCFDialect MLIRSupport + MLIRTransformUtils MLIRTransforms MLIRVectorDialect iree::compiler::Dialect::Util::Analysis diff --git a/compiler/src/iree/compiler/Dialect/Util/Transforms/FixedPointIterator.cpp b/compiler/src/iree/compiler/Dialect/Util/Transforms/FixedPointIterator.cpp index 81b0dc62647a..ece11e96496d 100644 --- a/compiler/src/iree/compiler/Dialect/Util/Transforms/FixedPointIterator.cpp +++ b/compiler/src/iree/compiler/Dialect/Util/Transforms/FixedPointIterator.cpp @@ -31,7 +31,9 @@ class FixedPointIteratorPass FixedPointIteratorPass(OpPassManager pipeline); private: - LogicalResult initializeOptions(StringRef options) override; + LogicalResult initializeOptions( + StringRef options, + function_ref errorHandler) override; void getDependentDialects(DialectRegistry ®istry) const override; void runOnOperation() override; @@ -52,8 +54,10 @@ FixedPointIteratorPass::FixedPointIteratorPass(OpPassManager pipeline) ss.flush(); } -LogicalResult FixedPointIteratorPass::initializeOptions(StringRef options) { - if (failed(Pass::initializeOptions(options))) +LogicalResult FixedPointIteratorPass::initializeOptions( + StringRef options, + function_ref errorHandler) { + if (failed(Pass::initializeOptions(options, errorHandler))) return failure(); if (pipeline) return success(); diff --git a/compiler/src/iree/compiler/Dialect/VM/Conversion/BUILD.bazel b/compiler/src/iree/compiler/Dialect/VM/Conversion/BUILD.bazel index 313e99d8d2fb..c99c0a166bf4 100644 --- a/compiler/src/iree/compiler/Dialect/VM/Conversion/BUILD.bazel +++ b/compiler/src/iree/compiler/Dialect/VM/Conversion/BUILD.bazel @@ -37,6 +37,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:FunctionInterfaces", "@llvm-project//mlir:IR", "@llvm-project//mlir:Parser", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) diff --git a/compiler/src/iree/compiler/Dialect/VM/Conversion/CMakeLists.txt b/compiler/src/iree/compiler/Dialect/VM/Conversion/CMakeLists.txt index eab429bc38b2..58cb03f6c2e0 100644 --- a/compiler/src/iree/compiler/Dialect/VM/Conversion/CMakeLists.txt +++ b/compiler/src/iree/compiler/Dialect/VM/Conversion/CMakeLists.txt @@ -31,6 +31,7 @@ iree_cc_library( MLIRFunctionInterfaces MLIRIR MLIRParser + MLIRTransformUtils MLIRTransforms iree::compiler::Dialect::Util::IR iree::compiler::Dialect::VM::IR diff --git a/compiler/src/iree/compiler/Dialect/VM/Conversion/VMToEmitC/BUILD.bazel b/compiler/src/iree/compiler/Dialect/VM/Conversion/VMToEmitC/BUILD.bazel index b9e00ca6ba2a..50b1cde3bed5 100644 --- a/compiler/src/iree/compiler/Dialect/VM/Conversion/VMToEmitC/BUILD.bazel +++ b/compiler/src/iree/compiler/Dialect/VM/Conversion/VMToEmitC/BUILD.bazel @@ -51,6 +51,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:IR", "@llvm-project//mlir:MathDialect", "@llvm-project//mlir:Pass", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) diff --git a/compiler/src/iree/compiler/Dialect/VM/Conversion/VMToEmitC/CMakeLists.txt b/compiler/src/iree/compiler/Dialect/VM/Conversion/VMToEmitC/CMakeLists.txt index 528f9774d543..bdac150ab9f6 100644 --- a/compiler/src/iree/compiler/Dialect/VM/Conversion/VMToEmitC/CMakeLists.txt +++ b/compiler/src/iree/compiler/Dialect/VM/Conversion/VMToEmitC/CMakeLists.txt @@ -38,6 +38,7 @@ iree_cc_library( MLIRIR MLIRMathDialect MLIRPass + MLIRTransformUtils MLIRTransforms iree::compiler::Dialect::Util::Conversion iree::compiler::Dialect::Util::IR diff --git a/compiler/src/iree/compiler/Dialect/VM/Target/Bytecode/BUILD.bazel b/compiler/src/iree/compiler/Dialect/VM/Target/Bytecode/BUILD.bazel index 627589a5d35e..f407b351dfaa 100644 --- a/compiler/src/iree/compiler/Dialect/VM/Target/Bytecode/BUILD.bazel +++ b/compiler/src/iree/compiler/Dialect/VM/Target/Bytecode/BUILD.bazel @@ -42,6 +42,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:IR", "@llvm-project//mlir:Pass", "@llvm-project//mlir:Support", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", "@llvm-project//mlir:TranslateLib", ], diff --git a/compiler/src/iree/compiler/Dialect/VM/Target/Bytecode/CMakeLists.txt b/compiler/src/iree/compiler/Dialect/VM/Target/Bytecode/CMakeLists.txt index e0a587b136ac..c09f1bb07039 100644 --- a/compiler/src/iree/compiler/Dialect/VM/Target/Bytecode/CMakeLists.txt +++ b/compiler/src/iree/compiler/Dialect/VM/Target/Bytecode/CMakeLists.txt @@ -29,6 +29,7 @@ iree_cc_library( MLIRIR MLIRPass MLIRSupport + MLIRTransformUtils MLIRTransforms MLIRTranslateLib iree::compiler::Dialect::Util::IR diff --git a/compiler/src/iree/compiler/Dialect/VM/Transforms/BUILD.bazel b/compiler/src/iree/compiler/Dialect/VM/Transforms/BUILD.bazel index dd3ac6af03b8..b0959920c4e2 100644 --- a/compiler/src/iree/compiler/Dialect/VM/Transforms/BUILD.bazel +++ b/compiler/src/iree/compiler/Dialect/VM/Transforms/BUILD.bazel @@ -50,6 +50,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:FuncDialect", "@llvm-project//mlir:FunctionInterfaces", "@llvm-project//mlir:IR", + "@llvm-project//mlir:InliningUtils", "@llvm-project//mlir:MathDialect", "@llvm-project//mlir:MemRefDialect", "@llvm-project//mlir:Pass", diff --git a/compiler/src/iree/compiler/Dialect/VMVX/Conversion/HALToVMVX/BUILD.bazel b/compiler/src/iree/compiler/Dialect/VMVX/Conversion/HALToVMVX/BUILD.bazel index f5851e910de5..61f5aa058978 100644 --- a/compiler/src/iree/compiler/Dialect/VMVX/Conversion/HALToVMVX/BUILD.bazel +++ b/compiler/src/iree/compiler/Dialect/VMVX/Conversion/HALToVMVX/BUILD.bazel @@ -32,6 +32,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:IR", "@llvm-project//mlir:MemRefDialect", "@llvm-project//mlir:Pass", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) diff --git a/compiler/src/iree/compiler/Dialect/VMVX/Conversion/HALToVMVX/CMakeLists.txt b/compiler/src/iree/compiler/Dialect/VMVX/Conversion/HALToVMVX/CMakeLists.txt index f0313f65bb42..75a9c8c27af5 100644 --- a/compiler/src/iree/compiler/Dialect/VMVX/Conversion/HALToVMVX/CMakeLists.txt +++ b/compiler/src/iree/compiler/Dialect/VMVX/Conversion/HALToVMVX/CMakeLists.txt @@ -24,6 +24,7 @@ iree_cc_library( MLIRIR MLIRMemRefDialect MLIRPass + MLIRTransformUtils MLIRTransforms iree::compiler::Dialect::HAL::IR iree::compiler::Dialect::Util::IR diff --git a/compiler/src/iree/compiler/Dialect/VMVX/Conversion/StandardToVMVX/BUILD.bazel b/compiler/src/iree/compiler/Dialect/VMVX/Conversion/StandardToVMVX/BUILD.bazel index 4c170407b141..878fc3d53368 100644 --- a/compiler/src/iree/compiler/Dialect/VMVX/Conversion/StandardToVMVX/BUILD.bazel +++ b/compiler/src/iree/compiler/Dialect/VMVX/Conversion/StandardToVMVX/BUILD.bazel @@ -33,6 +33,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:MemRefDialect", "@llvm-project//mlir:Pass", "@llvm-project//mlir:Support", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) diff --git a/compiler/src/iree/compiler/Dialect/VMVX/Conversion/StandardToVMVX/CMakeLists.txt b/compiler/src/iree/compiler/Dialect/VMVX/Conversion/StandardToVMVX/CMakeLists.txt index cd19f9eed879..2270bf2bf2c1 100644 --- a/compiler/src/iree/compiler/Dialect/VMVX/Conversion/StandardToVMVX/CMakeLists.txt +++ b/compiler/src/iree/compiler/Dialect/VMVX/Conversion/StandardToVMVX/CMakeLists.txt @@ -27,6 +27,7 @@ iree_cc_library( MLIRMemRefDialect MLIRPass MLIRSupport + MLIRTransformUtils MLIRTransforms iree::compiler::Dialect::Util::IR iree::compiler::Dialect::VMVX::IR diff --git a/compiler/src/iree/compiler/Dialect/VMVX/Conversion/VMVXToVM/BUILD.bazel b/compiler/src/iree/compiler/Dialect/VMVX/Conversion/VMVXToVM/BUILD.bazel index 159c98b5ad9c..267f7d49e1bc 100644 --- a/compiler/src/iree/compiler/Dialect/VMVX/Conversion/VMVXToVM/BUILD.bazel +++ b/compiler/src/iree/compiler/Dialect/VMVX/Conversion/VMVXToVM/BUILD.bazel @@ -31,6 +31,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:FunctionInterfaces", "@llvm-project//mlir:IR", "@llvm-project//mlir:Pass", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) diff --git a/compiler/src/iree/compiler/Dialect/VMVX/Conversion/VMVXToVM/CMakeLists.txt b/compiler/src/iree/compiler/Dialect/VMVX/Conversion/VMVXToVM/CMakeLists.txt index a7e7da06e6ed..78cd5dd0e5be 100644 --- a/compiler/src/iree/compiler/Dialect/VMVX/Conversion/VMVXToVM/CMakeLists.txt +++ b/compiler/src/iree/compiler/Dialect/VMVX/Conversion/VMVXToVM/CMakeLists.txt @@ -23,6 +23,7 @@ iree_cc_library( MLIRFunctionInterfaces MLIRIR MLIRPass + MLIRTransformUtils MLIRTransforms iree::compiler::Dialect::Util::IR iree::compiler::Dialect::VM::Conversion diff --git a/compiler/src/iree/compiler/Dialect/VMVX/Transforms/BUILD.bazel b/compiler/src/iree/compiler/Dialect/VMVX/Transforms/BUILD.bazel index d984bba0eb4b..5093195b6cd7 100644 --- a/compiler/src/iree/compiler/Dialect/VMVX/Transforms/BUILD.bazel +++ b/compiler/src/iree/compiler/Dialect/VMVX/Transforms/BUILD.bazel @@ -35,6 +35,7 @@ iree_compiler_cc_library( deps = [ ":PassesIncGen", "@llvm-project//mlir:Pass", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) @@ -93,6 +94,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:Support", "@llvm-project//mlir:TensorDialect", "@llvm-project//mlir:TosaToArith", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", "@llvm-project//mlir:VectorDialect", "@llvm-project//mlir:VectorToSCF", diff --git a/compiler/src/iree/compiler/Dialect/VMVX/Transforms/CMakeLists.txt b/compiler/src/iree/compiler/Dialect/VMVX/Transforms/CMakeLists.txt index b95a9029d79c..7036907052b1 100644 --- a/compiler/src/iree/compiler/Dialect/VMVX/Transforms/CMakeLists.txt +++ b/compiler/src/iree/compiler/Dialect/VMVX/Transforms/CMakeLists.txt @@ -29,6 +29,7 @@ iree_cc_library( DEPS ::PassesIncGen MLIRPass + MLIRTransformUtils MLIRTransforms PUBLIC ) @@ -69,6 +70,7 @@ iree_cc_library( MLIRSupport MLIRTensorDialect MLIRTosaToArith + MLIRTransformUtils MLIRTransforms MLIRVectorDialect MLIRVectorToSCF diff --git a/compiler/src/iree/compiler/GlobalOptimization/BUILD.bazel b/compiler/src/iree/compiler/GlobalOptimization/BUILD.bazel index bafbac9de57d..23929f984737 100644 --- a/compiler/src/iree/compiler/GlobalOptimization/BUILD.bazel +++ b/compiler/src/iree/compiler/GlobalOptimization/BUILD.bazel @@ -37,6 +37,7 @@ iree_compiler_cc_library( deps = [ ":PassesIncGen", "@llvm-project//mlir:Pass", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) @@ -115,6 +116,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:TensorDialect", "@llvm-project//mlir:TensorTransforms", "@llvm-project//mlir:TensorUtils", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) diff --git a/compiler/src/iree/compiler/GlobalOptimization/CMakeLists.txt b/compiler/src/iree/compiler/GlobalOptimization/CMakeLists.txt index 66eda40082f2..be8e5bf971f7 100644 --- a/compiler/src/iree/compiler/GlobalOptimization/CMakeLists.txt +++ b/compiler/src/iree/compiler/GlobalOptimization/CMakeLists.txt @@ -29,6 +29,7 @@ iree_cc_library( DEPS ::PassesIncGen MLIRPass + MLIRTransformUtils MLIRTransforms PUBLIC ) @@ -86,6 +87,7 @@ iree_cc_library( MLIRTensorDialect MLIRTensorTransforms MLIRTensorUtils + MLIRTransformUtils MLIRTransforms iree::compiler::Codegen::Common iree::compiler::Codegen::Common::CPU::CommonCPUPasses diff --git a/compiler/src/iree/compiler/InputConversion/Common/BUILD.bazel b/compiler/src/iree/compiler/InputConversion/Common/BUILD.bazel index c214d5495971..7637c3987af4 100644 --- a/compiler/src/iree/compiler/InputConversion/Common/BUILD.bazel +++ b/compiler/src/iree/compiler/InputConversion/Common/BUILD.bazel @@ -37,6 +37,7 @@ iree_compiler_cc_library( deps = [ ":PassesIncGen", "@llvm-project//mlir:Pass", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) @@ -80,6 +81,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:SCFToControlFlow", "@llvm-project//mlir:TensorDialect", "@llvm-project//mlir:TensorUtils", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) @@ -103,6 +105,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:FunctionInterfaces", "@llvm-project//mlir:IR", "@llvm-project//mlir:Pass", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) diff --git a/compiler/src/iree/compiler/InputConversion/Common/CMakeLists.txt b/compiler/src/iree/compiler/InputConversion/Common/CMakeLists.txt index 1f1dc4fb7bb0..ab14826079ad 100644 --- a/compiler/src/iree/compiler/InputConversion/Common/CMakeLists.txt +++ b/compiler/src/iree/compiler/InputConversion/Common/CMakeLists.txt @@ -29,6 +29,7 @@ iree_cc_library( DEPS ::PassesIncGen MLIRPass + MLIRTransformUtils MLIRTransforms PUBLIC ) @@ -66,6 +67,7 @@ iree_cc_library( MLIRSCFToControlFlow MLIRTensorDialect MLIRTensorUtils + MLIRTransformUtils MLIRTransforms iree::compiler::Dialect::Flow::Conversion::MeshToFlow iree::compiler::Dialect::Flow::IR @@ -91,6 +93,7 @@ iree_cc_library( MLIRFunctionInterfaces MLIRIR MLIRPass + MLIRTransformUtils MLIRTransforms iree::compiler::PluginAPI iree::compiler::Utils diff --git a/compiler/src/iree/compiler/Modules/Check/Conversion/BUILD.bazel b/compiler/src/iree/compiler/Modules/Check/Conversion/BUILD.bazel index 4dcde8c579a9..42d582b921cd 100644 --- a/compiler/src/iree/compiler/Modules/Check/Conversion/BUILD.bazel +++ b/compiler/src/iree/compiler/Modules/Check/Conversion/BUILD.bazel @@ -26,6 +26,7 @@ iree_compiler_cc_library( "//compiler/src/iree/compiler/Dialect/VM/Conversion", "//compiler/src/iree/compiler/Modules/Check/IR", "@llvm-project//mlir:Pass", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) diff --git a/compiler/src/iree/compiler/Modules/Check/Conversion/CMakeLists.txt b/compiler/src/iree/compiler/Modules/Check/Conversion/CMakeLists.txt index c55d7713656e..161a143e8ce6 100644 --- a/compiler/src/iree/compiler/Modules/Check/Conversion/CMakeLists.txt +++ b/compiler/src/iree/compiler/Modules/Check/Conversion/CMakeLists.txt @@ -19,6 +19,7 @@ iree_cc_library( "ConversionPatterns.cpp" DEPS MLIRPass + MLIRTransformUtils MLIRTransforms iree::compiler::Dialect::HAL::Conversion iree::compiler::Dialect::HAL::IR diff --git a/compiler/src/iree/compiler/Modules/Check/IR/BUILD.bazel b/compiler/src/iree/compiler/Modules/Check/IR/BUILD.bazel index a77ab613006a..38fa6946a948 100644 --- a/compiler/src/iree/compiler/Modules/Check/IR/BUILD.bazel +++ b/compiler/src/iree/compiler/Modules/Check/IR/BUILD.bazel @@ -64,6 +64,7 @@ iree_compiler_cc_library( "//compiler/src/iree/compiler/Modules/Check/Conversion", "@llvm-project//mlir:IR", "@llvm-project//mlir:Parser", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) diff --git a/compiler/src/iree/compiler/Modules/Check/IR/CMakeLists.txt b/compiler/src/iree/compiler/Modules/Check/IR/CMakeLists.txt index e192509dc807..34b6c2bab406 100644 --- a/compiler/src/iree/compiler/Modules/Check/IR/CMakeLists.txt +++ b/compiler/src/iree/compiler/Modules/Check/IR/CMakeLists.txt @@ -41,6 +41,7 @@ iree_cc_library( ::check_ops_gen MLIRIR MLIRParser + MLIRTransformUtils MLIRTransforms iree::compiler::Dialect::HAL::Conversion iree::compiler::Dialect::HAL::IR::HALDialect diff --git a/compiler/src/iree/compiler/Modules/HAL/Inline/Conversion/HALInlineToVM/BUILD.bazel b/compiler/src/iree/compiler/Modules/HAL/Inline/Conversion/HALInlineToVM/BUILD.bazel index 0c0fc1dd0002..8e98f3b23f7a 100644 --- a/compiler/src/iree/compiler/Modules/HAL/Inline/Conversion/HALInlineToVM/BUILD.bazel +++ b/compiler/src/iree/compiler/Modules/HAL/Inline/Conversion/HALInlineToVM/BUILD.bazel @@ -31,6 +31,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:FunctionInterfaces", "@llvm-project//mlir:IR", "@llvm-project//mlir:Pass", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) diff --git a/compiler/src/iree/compiler/Modules/HAL/Inline/Conversion/HALInlineToVM/CMakeLists.txt b/compiler/src/iree/compiler/Modules/HAL/Inline/Conversion/HALInlineToVM/CMakeLists.txt index 10a7f22b28e4..9bb95db272c5 100644 --- a/compiler/src/iree/compiler/Modules/HAL/Inline/Conversion/HALInlineToVM/CMakeLists.txt +++ b/compiler/src/iree/compiler/Modules/HAL/Inline/Conversion/HALInlineToVM/CMakeLists.txt @@ -23,6 +23,7 @@ iree_cc_library( MLIRFunctionInterfaces MLIRIR MLIRPass + MLIRTransformUtils MLIRTransforms iree::compiler::Dialect::Util::IR iree::compiler::Dialect::VM::Conversion diff --git a/compiler/src/iree/compiler/Modules/HAL/Inline/Conversion/HALToHALInline/BUILD.bazel b/compiler/src/iree/compiler/Modules/HAL/Inline/Conversion/HALToHALInline/BUILD.bazel index 8754c7c065f5..e9dac8341db9 100644 --- a/compiler/src/iree/compiler/Modules/HAL/Inline/Conversion/HALToHALInline/BUILD.bazel +++ b/compiler/src/iree/compiler/Modules/HAL/Inline/Conversion/HALToHALInline/BUILD.bazel @@ -34,6 +34,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:FunctionInterfaces", "@llvm-project//mlir:IR", "@llvm-project//mlir:Pass", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) diff --git a/compiler/src/iree/compiler/Modules/HAL/Inline/Conversion/HALToHALInline/CMakeLists.txt b/compiler/src/iree/compiler/Modules/HAL/Inline/Conversion/HALToHALInline/CMakeLists.txt index a051a716380b..ebeb3ea61434 100644 --- a/compiler/src/iree/compiler/Modules/HAL/Inline/Conversion/HALToHALInline/CMakeLists.txt +++ b/compiler/src/iree/compiler/Modules/HAL/Inline/Conversion/HALToHALInline/CMakeLists.txt @@ -24,6 +24,7 @@ iree_cc_library( MLIRFunctionInterfaces MLIRIR MLIRPass + MLIRTransformUtils MLIRTransforms iree::compiler::Dialect::HAL::Conversion iree::compiler::Dialect::HAL::IR diff --git a/compiler/src/iree/compiler/Modules/HAL/Inline/Conversion/StreamToHALInline/BUILD.bazel b/compiler/src/iree/compiler/Modules/HAL/Inline/Conversion/StreamToHALInline/BUILD.bazel index eae08d33bcdc..ea60d06eec76 100644 --- a/compiler/src/iree/compiler/Modules/HAL/Inline/Conversion/StreamToHALInline/BUILD.bazel +++ b/compiler/src/iree/compiler/Modules/HAL/Inline/Conversion/StreamToHALInline/BUILD.bazel @@ -35,6 +35,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:FunctionInterfaces", "@llvm-project//mlir:IR", "@llvm-project//mlir:Pass", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) diff --git a/compiler/src/iree/compiler/Modules/HAL/Inline/Conversion/StreamToHALInline/CMakeLists.txt b/compiler/src/iree/compiler/Modules/HAL/Inline/Conversion/StreamToHALInline/CMakeLists.txt index 7e3e88083b6d..bf9007fc337c 100644 --- a/compiler/src/iree/compiler/Modules/HAL/Inline/Conversion/StreamToHALInline/CMakeLists.txt +++ b/compiler/src/iree/compiler/Modules/HAL/Inline/Conversion/StreamToHALInline/CMakeLists.txt @@ -24,6 +24,7 @@ iree_cc_library( MLIRFunctionInterfaces MLIRIR MLIRPass + MLIRTransformUtils MLIRTransforms iree::compiler::Dialect::HAL::Conversion iree::compiler::Dialect::HAL::IR diff --git a/compiler/src/iree/compiler/Modules/HAL/Inline/Transforms/BUILD.bazel b/compiler/src/iree/compiler/Modules/HAL/Inline/Transforms/BUILD.bazel index 90c24f506b83..3d353b49f5fc 100644 --- a/compiler/src/iree/compiler/Modules/HAL/Inline/Transforms/BUILD.bazel +++ b/compiler/src/iree/compiler/Modules/HAL/Inline/Transforms/BUILD.bazel @@ -52,6 +52,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:SCFDialect", "@llvm-project//mlir:SCFToControlFlow", "@llvm-project//mlir:Support", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) diff --git a/compiler/src/iree/compiler/Modules/HAL/Inline/Transforms/CMakeLists.txt b/compiler/src/iree/compiler/Modules/HAL/Inline/Transforms/CMakeLists.txt index 60bdece3b339..3e403115244f 100644 --- a/compiler/src/iree/compiler/Modules/HAL/Inline/Transforms/CMakeLists.txt +++ b/compiler/src/iree/compiler/Modules/HAL/Inline/Transforms/CMakeLists.txt @@ -36,6 +36,7 @@ iree_cc_library( MLIRSCFDialect MLIRSCFToControlFlow MLIRSupport + MLIRTransformUtils MLIRTransforms iree::compiler::Dialect::HAL::Conversion iree::compiler::Dialect::HAL::Conversion::StandardToHAL diff --git a/compiler/src/iree/compiler/Modules/HAL/Loader/Conversion/HALLoaderToVM/BUILD.bazel b/compiler/src/iree/compiler/Modules/HAL/Loader/Conversion/HALLoaderToVM/BUILD.bazel index 64ad88eca390..7f749415c596 100644 --- a/compiler/src/iree/compiler/Modules/HAL/Loader/Conversion/HALLoaderToVM/BUILD.bazel +++ b/compiler/src/iree/compiler/Modules/HAL/Loader/Conversion/HALLoaderToVM/BUILD.bazel @@ -32,6 +32,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:FunctionInterfaces", "@llvm-project//mlir:IR", "@llvm-project//mlir:Pass", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) diff --git a/compiler/src/iree/compiler/Modules/HAL/Loader/Conversion/HALLoaderToVM/CMakeLists.txt b/compiler/src/iree/compiler/Modules/HAL/Loader/Conversion/HALLoaderToVM/CMakeLists.txt index 17224b0475cd..272ab6ebbb36 100644 --- a/compiler/src/iree/compiler/Modules/HAL/Loader/Conversion/HALLoaderToVM/CMakeLists.txt +++ b/compiler/src/iree/compiler/Modules/HAL/Loader/Conversion/HALLoaderToVM/CMakeLists.txt @@ -23,6 +23,7 @@ iree_cc_library( MLIRFunctionInterfaces MLIRIR MLIRPass + MLIRTransformUtils MLIRTransforms iree::compiler::Dialect::HAL::Conversion::HALToVM iree::compiler::Dialect::Util::IR diff --git a/compiler/src/iree/compiler/Modules/HAL/Loader/Conversion/StreamToHALLoader/BUILD.bazel b/compiler/src/iree/compiler/Modules/HAL/Loader/Conversion/StreamToHALLoader/BUILD.bazel index ac4664887e1b..69fdf1a14cf3 100644 --- a/compiler/src/iree/compiler/Modules/HAL/Loader/Conversion/StreamToHALLoader/BUILD.bazel +++ b/compiler/src/iree/compiler/Modules/HAL/Loader/Conversion/StreamToHALLoader/BUILD.bazel @@ -36,6 +36,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:FunctionInterfaces", "@llvm-project//mlir:IR", "@llvm-project//mlir:Pass", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) diff --git a/compiler/src/iree/compiler/Modules/HAL/Loader/Conversion/StreamToHALLoader/CMakeLists.txt b/compiler/src/iree/compiler/Modules/HAL/Loader/Conversion/StreamToHALLoader/CMakeLists.txt index 29afd918ee7f..1ab2e63562bf 100644 --- a/compiler/src/iree/compiler/Modules/HAL/Loader/Conversion/StreamToHALLoader/CMakeLists.txt +++ b/compiler/src/iree/compiler/Modules/HAL/Loader/Conversion/StreamToHALLoader/CMakeLists.txt @@ -24,6 +24,7 @@ iree_cc_library( MLIRFunctionInterfaces MLIRIR MLIRPass + MLIRTransformUtils MLIRTransforms iree::compiler::Dialect::HAL::Conversion iree::compiler::Dialect::HAL::IR diff --git a/compiler/src/iree/compiler/Modules/HAL/Loader/Transforms/BUILD.bazel b/compiler/src/iree/compiler/Modules/HAL/Loader/Transforms/BUILD.bazel index fee61e4c7554..cee460e28cca 100644 --- a/compiler/src/iree/compiler/Modules/HAL/Loader/Transforms/BUILD.bazel +++ b/compiler/src/iree/compiler/Modules/HAL/Loader/Transforms/BUILD.bazel @@ -57,6 +57,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:SCFDialect", "@llvm-project//mlir:SCFToControlFlow", "@llvm-project//mlir:Support", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) diff --git a/compiler/src/iree/compiler/Modules/HAL/Loader/Transforms/CMakeLists.txt b/compiler/src/iree/compiler/Modules/HAL/Loader/Transforms/CMakeLists.txt index d8eb5555d04f..39fc73efe482 100644 --- a/compiler/src/iree/compiler/Modules/HAL/Loader/Transforms/CMakeLists.txt +++ b/compiler/src/iree/compiler/Modules/HAL/Loader/Transforms/CMakeLists.txt @@ -38,6 +38,7 @@ iree_cc_library( MLIRSCFDialect MLIRSCFToControlFlow MLIRSupport + MLIRTransformUtils MLIRTransforms iree::compiler::Dialect::HAL::Conversion iree::compiler::Dialect::HAL::Conversion::StandardToHAL diff --git a/compiler/src/iree/compiler/Modules/IO/Parameters/Conversion/ParamsToVM/BUILD.bazel b/compiler/src/iree/compiler/Modules/IO/Parameters/Conversion/ParamsToVM/BUILD.bazel index dbd20c210867..625697bcf651 100644 --- a/compiler/src/iree/compiler/Modules/IO/Parameters/Conversion/ParamsToVM/BUILD.bazel +++ b/compiler/src/iree/compiler/Modules/IO/Parameters/Conversion/ParamsToVM/BUILD.bazel @@ -32,6 +32,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:FunctionInterfaces", "@llvm-project//mlir:IR", "@llvm-project//mlir:Pass", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) diff --git a/compiler/src/iree/compiler/Modules/IO/Parameters/Conversion/ParamsToVM/CMakeLists.txt b/compiler/src/iree/compiler/Modules/IO/Parameters/Conversion/ParamsToVM/CMakeLists.txt index 3cf658e245a6..dc8bcc7f77fd 100644 --- a/compiler/src/iree/compiler/Modules/IO/Parameters/Conversion/ParamsToVM/CMakeLists.txt +++ b/compiler/src/iree/compiler/Modules/IO/Parameters/Conversion/ParamsToVM/CMakeLists.txt @@ -23,6 +23,7 @@ iree_cc_library( MLIRFunctionInterfaces MLIRIR MLIRPass + MLIRTransformUtils MLIRTransforms iree::compiler::Dialect::HAL::Conversion::HALToVM iree::compiler::Dialect::Util::IR diff --git a/compiler/src/iree/compiler/Modules/IO/Parameters/Conversion/StreamToParams/BUILD.bazel b/compiler/src/iree/compiler/Modules/IO/Parameters/Conversion/StreamToParams/BUILD.bazel index 3d47d5adf973..8920d10666bb 100644 --- a/compiler/src/iree/compiler/Modules/IO/Parameters/Conversion/StreamToParams/BUILD.bazel +++ b/compiler/src/iree/compiler/Modules/IO/Parameters/Conversion/StreamToParams/BUILD.bazel @@ -34,6 +34,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:FunctionInterfaces", "@llvm-project//mlir:IR", "@llvm-project//mlir:Pass", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) diff --git a/compiler/src/iree/compiler/Modules/IO/Parameters/Conversion/StreamToParams/CMakeLists.txt b/compiler/src/iree/compiler/Modules/IO/Parameters/Conversion/StreamToParams/CMakeLists.txt index aab36b495148..8047620cd909 100644 --- a/compiler/src/iree/compiler/Modules/IO/Parameters/Conversion/StreamToParams/CMakeLists.txt +++ b/compiler/src/iree/compiler/Modules/IO/Parameters/Conversion/StreamToParams/CMakeLists.txt @@ -24,6 +24,7 @@ iree_cc_library( MLIRFunctionInterfaces MLIRIR MLIRPass + MLIRTransformUtils MLIRTransforms iree::compiler::Dialect::HAL::Conversion iree::compiler::Dialect::HAL::Conversion::StreamToHAL::Utils diff --git a/compiler/src/iree/compiler/Preprocessing/Common/BUILD.bazel b/compiler/src/iree/compiler/Preprocessing/Common/BUILD.bazel index ebbc22152d62..b5a9090cb502 100644 --- a/compiler/src/iree/compiler/Preprocessing/Common/BUILD.bazel +++ b/compiler/src/iree/compiler/Preprocessing/Common/BUILD.bazel @@ -67,6 +67,7 @@ iree_compiler_cc_library( "@llvm-project//mlir:TensorUtils", "@llvm-project//mlir:TransformDialect", "@llvm-project//mlir:TransformDialectTransforms", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) diff --git a/compiler/src/iree/compiler/Preprocessing/Common/CMakeLists.txt b/compiler/src/iree/compiler/Preprocessing/Common/CMakeLists.txt index 9ed7bf434bc5..a86d6597586c 100644 --- a/compiler/src/iree/compiler/Preprocessing/Common/CMakeLists.txt +++ b/compiler/src/iree/compiler/Preprocessing/Common/CMakeLists.txt @@ -53,6 +53,7 @@ iree_cc_library( MLIRTensorUtils MLIRTransformDialect MLIRTransformDialectTransforms + MLIRTransformUtils MLIRTransforms iree::compiler::Dialect::Flow::IR iree::compiler::Dialect::Flow::Transforms diff --git a/compiler/src/iree/compiler/Preprocessing/Common/ConvertConvToChannelsLast.cpp b/compiler/src/iree/compiler/Preprocessing/Common/ConvertConvToChannelsLast.cpp index 966c4119c367..1be1cbd1543e 100644 --- a/compiler/src/iree/compiler/Preprocessing/Common/ConvertConvToChannelsLast.cpp +++ b/compiler/src/iree/compiler/Preprocessing/Common/ConvertConvToChannelsLast.cpp @@ -652,8 +652,10 @@ struct ConvertConvToChannelsLastPass registry.insert(); registry.insert(); } - LogicalResult initializeOptions(StringRef options) override { - if (failed(Pass::initializeOptions(options))) { + LogicalResult initializeOptions( + StringRef options, + function_ref errorHandler) override { + if (failed(Pass::initializeOptions(options, errorHandler))) { return failure(); } tilingFactor = tileSize; diff --git a/compiler/src/iree/compiler/Preprocessing/TransformExtensions/PreprocessingExtensions.h b/compiler/src/iree/compiler/Preprocessing/TransformExtensions/PreprocessingExtensions.h index 87033d00f596..877695d84736 100644 --- a/compiler/src/iree/compiler/Preprocessing/TransformExtensions/PreprocessingExtensions.h +++ b/compiler/src/iree/compiler/Preprocessing/TransformExtensions/PreprocessingExtensions.h @@ -8,9 +8,9 @@ #define IREE_COMPILER_CODEGEN_PREPROCESSING_TRANSFORMEXTENSIONS_PREPROCESSINGEXTENSIONS_H_ #include "mlir/Bytecode/BytecodeOpInterface.h" -#include "mlir/Dialect/Transform/IR/MatchInterfaces.h" #include "mlir/Dialect/Transform/IR/TransformDialect.h" #include "mlir/Dialect/Transform/IR/TransformOps.h" +#include "mlir/Dialect/Transform/Interfaces/MatchInterfaces.h" #include "mlir/Dialect/Transform/Interfaces/TransformInterfaces.h" namespace mlir { diff --git a/compiler/src/iree/compiler/Preprocessing/TransformExtensions/PreprocessingExtensionsOps.td b/compiler/src/iree/compiler/Preprocessing/TransformExtensions/PreprocessingExtensionsOps.td index 4993a47d4ee1..d6d0fde91822 100644 --- a/compiler/src/iree/compiler/Preprocessing/TransformExtensions/PreprocessingExtensionsOps.td +++ b/compiler/src/iree/compiler/Preprocessing/TransformExtensions/PreprocessingExtensionsOps.td @@ -7,7 +7,7 @@ #ifndef IREE_COMPILER_DIALECT_PREPROCESSING_TRANSFORMEXTENSIONS_PREPROCESSINGEXTENSIONS #define IREE_COMPILER_DIALECT_PREPROCESSING_TRANSFORMEXTENSIONS_PREPROCESSINGEXTENSIONS -include "mlir/Dialect/Transform/IR/MatchInterfaces.td" +include "mlir/Dialect/Transform/Interfaces/MatchInterfaces.td" include "mlir/Dialect/Transform/IR/TransformDialect.td" include "mlir/Dialect/Transform/IR/TransformAttrs.td" include "mlir/Dialect/Transform/IR/TransformTypes.td" diff --git a/compiler/src/iree/compiler/Reducer/Framework/BUILD.bazel b/compiler/src/iree/compiler/Reducer/Framework/BUILD.bazel index 3f38c32431b7..235f1a65e41e 100644 --- a/compiler/src/iree/compiler/Reducer/Framework/BUILD.bazel +++ b/compiler/src/iree/compiler/Reducer/Framework/BUILD.bazel @@ -29,6 +29,7 @@ iree_compiler_cc_library( deps = [ "//compiler/bindings/c:headers", "@llvm-project//llvm:Support", + "@llvm-project//mlir:BytecodeWriter", "@llvm-project//mlir:IR", "@llvm-project//mlir:Pass", "@llvm-project//mlir:Support", diff --git a/compiler/src/iree/compiler/Reducer/Framework/CMakeLists.txt b/compiler/src/iree/compiler/Reducer/Framework/CMakeLists.txt index 61e9550ae986..497921dd00df 100644 --- a/compiler/src/iree/compiler/Reducer/Framework/CMakeLists.txt +++ b/compiler/src/iree/compiler/Reducer/Framework/CMakeLists.txt @@ -25,6 +25,7 @@ iree_cc_library( "WorkItem.cpp" DEPS LLVMSupport + MLIRBytecodeWriter MLIRIR MLIRPass MLIRSupport diff --git a/llvm-external-projects/iree-dialects/BUILD.bazel b/llvm-external-projects/iree-dialects/BUILD.bazel index d3d67c929445..4c7b0644e8f6 100644 --- a/llvm-external-projects/iree-dialects/BUILD.bazel +++ b/llvm-external-projects/iree-dialects/BUILD.bazel @@ -190,6 +190,7 @@ cc_library( "@llvm-project//mlir:TensorDialect", "@llvm-project//mlir:TransformDialect", "@llvm-project//mlir:TransformDialectInterfaces", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) @@ -268,6 +269,7 @@ cc_library( "@llvm-project//mlir:SCFTransforms", "@llvm-project//mlir:TensorTransformOps", "@llvm-project//mlir:Transforms", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:VectorToSCF", # Utils @@ -485,6 +487,7 @@ cc_library( "@llvm-project//mlir:IR", "@llvm-project//mlir:Pass", "@llvm-project//mlir:Rewrite", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", ], ) @@ -531,6 +534,7 @@ cc_binary( "@llvm-project//mlir:TensorTransformOps", "@llvm-project//mlir:TransformDialect", "@llvm-project//mlir:TransformPDLExtension", + "@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:Transforms", "@llvm-project//mlir:VectorTransformOps", ], diff --git a/samples/custom_dispatch/cpu/mlp_plugin/mlp_tosa.mlir b/samples/custom_dispatch/cpu/mlp_plugin/mlp_tosa.mlir index 58990ca77492..595d08de8b2e 100644 --- a/samples/custom_dispatch/cpu/mlp_plugin/mlp_tosa.mlir +++ b/samples/custom_dispatch/cpu/mlp_plugin/mlp_tosa.mlir @@ -44,15 +44,15 @@ module @example attributes {hal.device.targets = [#cpu_target]} { func.func @mlp_invocation(%lhs: tensor<2x4xf32>, %rhs : tensor<4x8xf32>) -> tensor<2x8xf32> { - %lhs_3D = tosa.reshape %lhs {new_shape = array} : (tensor<2x4xf32>) -> tensor<1x2x4xf32> - %rhs_3D = tosa.reshape %rhs {new_shape = array} : (tensor<4x8xf32>) -> tensor<1x4x8xf32> + %lhs_3D = tosa.reshape %lhs {new_shape = array} : (tensor<2x4xf32>) -> tensor<1x2x4xf32> + %rhs_3D = tosa.reshape %rhs {new_shape = array} : (tensor<4x8xf32>) -> tensor<1x4x8xf32> %0 = tosa.matmul %lhs_3D, %rhs_3D : (tensor<1x2x4xf32>, tensor<1x4x8xf32>) -> tensor<1x2x8xf32> %1 = tosa.clamp %0 { min_int = 0 : i64, max_int = 9223372036854775807 : i64, min_fp = 0.0 : f32, max_fp = 3.4028235e+38 : f32} : (tensor<1x2x8xf32>) -> tensor<1x2x8xf32> %2 = tosa.negate %1 : (tensor<1x2x8xf32>) -> tensor<1x2x8xf32> - %3 = tosa.reshape %2 {new_shape = array} : (tensor<1x2x8xf32>) -> tensor<2x8xf32> + %3 = tosa.reshape %2 {new_shape = array} : (tensor<1x2x8xf32>) -> tensor<2x8xf32> return %3 : tensor<2x8xf32> } } diff --git a/third_party/llvm-project b/third_party/llvm-project index 35329adfd666..a6d932bca887 160000 --- a/third_party/llvm-project +++ b/third_party/llvm-project @@ -1 +1 @@ -Subproject commit 35329adfd666d3002257d688d90cf8a6613c1177 +Subproject commit a6d932bca8875198fbf34564cda8a8d1640cdcbc