From e9ee5fad00931528bab21fa853a86c173cff6787 Mon Sep 17 00:00:00 2001 From: Kunwar Grover Date: Thu, 1 Aug 2024 19:26:50 +0100 Subject: [PATCH] [VectorExt] Move VectorExt from llvm-external-projects to Codegen/Dialect (#18082) This patch moves the VectorExt dialect from llvm-external-projects to compiler/Codegen/Dialect. Keeping the dialect externally with a different code style is a headache. This patch also drops a redundant iterator test from VectorExt which is extensively tested by VectorDistribution now. --- compiler/plugins/target/ROCM/BUILD.bazel | 2 +- compiler/plugins/target/ROCM/CMakeLists.txt | 2 +- compiler/plugins/target/ROCM/ROCMTarget.cpp | 2 +- .../iree/compiler/Codegen/Common/BUILD.bazel | 6 +- .../compiler/Codegen/Common/CMakeLists.txt | 6 +- .../Common/CommonDialectRegistration.cpp | 2 +- .../compiler/Codegen/Common/GPU/BUILD.bazel | 2 +- .../Codegen/Common/GPU/CMakeLists.txt | 2 +- .../Common/GPU/GPUDistributionPatterns.cpp | 2 +- .../GPUNestedLayoutDistributionPatterns.cpp | 2 +- .../Common/GPU/GPUVectorDistribution.cpp | 4 +- .../Common/GPU/GPUVectorDistribution.h | 2 +- .../Common/TransformExtensions/BUILD.bazel | 2 +- .../Common/TransformExtensions/CMakeLists.txt | 2 +- .../Codegen/Common/VectorLayoutAnalysis.h | 2 +- .../Codegen/Dialect/GPU/IR/BUILD.bazel | 2 +- .../Codegen/Dialect/GPU/IR/CMakeLists.txt | 2 +- .../Codegen/Dialect/GPU/IR/IREEGPUAttrs.cpp | 2 +- .../Dialect/GPU/IR/IREEGPUInterfaces.h | 2 +- .../Codegen/Dialect/VectorExt/BUILD.bazel | 11 + .../Codegen/Dialect/VectorExt/CMakeLists.txt | 13 ++ .../Codegen/Dialect/VectorExt/IR/BUILD.bazel | 189 ++++++++++++++++++ .../Dialect/VectorExt/IR/CMakeLists.txt | 111 ++++++++++ .../Dialect/VectorExt/IR/VectorExtAttrs.cpp | 18 +- .../Dialect/VectorExt/IR/VectorExtAttrs.td | 2 +- .../Dialect/VectorExt/IR/VectorExtBase.td | 2 +- .../Dialect/VectorExt/IR/VectorExtDialect.cpp | 14 +- .../Dialect/VectorExt/IR/VectorExtDialect.h | 12 +- .../VectorExt/IR/VectorExtInterfaces.h | 6 +- .../VectorExt/IR/VectorExtInterfaces.td | 0 .../Dialect/VectorExt/IR/VectorExtOps.cpp | 6 +- .../Dialect/VectorExt/IR/VectorExtOps.h | 6 +- .../Dialect/VectorExt/IR/VectorExtOps.td | 5 +- .../Dialect/VectorExt/IR/test/BUILD.bazel | 32 +++ .../Dialect/VectorExt/IR/test/CMakeLists.txt | 25 +++ .../VectorExt/IR/test}/canonicalize.mlir | 2 +- .../Dialect/VectorExt/IR/test}/invalid.mlir | 2 +- .../Dialect/VectorExt/IR/test}/roundtrip.mlir | 14 +- .../iree/compiler/Codegen/LLVMGPU/BUILD.bazel | 2 +- .../compiler/Codegen/LLVMGPU/CMakeLists.txt | 2 +- .../LLVMGPU/LLVMGPUConfigureVectorLayouts.cpp | 2 +- .../LLVMGPU/LLVMGPULowerExecutableTarget.cpp | 2 +- .../LLVMGPU/LLVMGPUVectorDistribute.cpp | 2 +- .../Utils/AMDGPUDistributionPatterns.cpp | 2 +- .../Codegen/LLVMGPU/Utils/BUILD.bazel | 2 +- .../Codegen/LLVMGPU/Utils/CMakeLists.txt | 2 +- compiler/src/iree/compiler/Tools/BUILD.bazel | 2 +- .../src/iree/compiler/Tools/CMakeLists.txt | 2 +- .../iree/compiler/Tools/init_iree_dialects.h | 2 +- .../docs/reference/mlir-dialects/index.md | 2 +- docs/website/generate_extra_files.sh | 1 - docs/website/mkdocs.yml | 2 +- docs/website/postprocess_dialect_docs.py | 2 +- .../iree-dialects/BUILD.bazel | 118 ----------- .../iree-dialects/Dialect/CMakeLists.txt | 1 - .../Dialect/VectorExt/CMakeLists.txt | 1 - .../Dialect/VectorExt/IR/CMakeLists.txt | 48 ----- .../iree-dialects/lib/Dialect/CMakeLists.txt | 1 - .../lib/Dialect/VectorExt/CMakeLists.txt | 1 - .../lib/Dialect/VectorExt/IR/CMakeLists.txt | 18 -- .../iree-dialects/test/CMakeLists.txt | 2 - .../Dialect/iree_vector_ext/iterators.mlir | 55 ----- .../iree-dialects/test/lib/CMakeLists.txt | 1 - .../test/lib/VectorExt/CMakeLists.txt | 12 -- .../test/lib/VectorExt/TestIterators.cpp | 90 --------- .../tools/iree-dialects-opt/CMakeLists.txt | 2 - .../iree-dialects-opt/iree-dialects-opt.cpp | 11 - 67 files changed, 464 insertions(+), 444 deletions(-) create mode 100644 compiler/src/iree/compiler/Codegen/Dialect/VectorExt/BUILD.bazel create mode 100644 compiler/src/iree/compiler/Codegen/Dialect/VectorExt/CMakeLists.txt create mode 100644 compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/BUILD.bazel create mode 100644 compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/CMakeLists.txt rename {llvm-external-projects/iree-dialects/lib => compiler/src/iree/compiler/Codegen}/Dialect/VectorExt/IR/VectorExtAttrs.cpp (97%) rename {llvm-external-projects/iree-dialects/include/iree-dialects => compiler/src/iree/compiler/Codegen}/Dialect/VectorExt/IR/VectorExtAttrs.td (99%) rename {llvm-external-projects/iree-dialects/include/iree-dialects => compiler/src/iree/compiler/Codegen}/Dialect/VectorExt/IR/VectorExtBase.td (95%) rename {llvm-external-projects/iree-dialects/lib => compiler/src/iree/compiler/Codegen}/Dialect/VectorExt/IR/VectorExtDialect.cpp (74%) rename {llvm-external-projects/iree-dialects/include/iree-dialects => compiler/src/iree/compiler/Codegen}/Dialect/VectorExt/IR/VectorExtDialect.h (58%) rename {llvm-external-projects/iree-dialects/include/iree-dialects => compiler/src/iree/compiler/Codegen}/Dialect/VectorExt/IR/VectorExtInterfaces.h (87%) rename {llvm-external-projects/iree-dialects/include/iree-dialects => compiler/src/iree/compiler/Codegen}/Dialect/VectorExt/IR/VectorExtInterfaces.td (100%) rename {llvm-external-projects/iree-dialects/lib => compiler/src/iree/compiler/Codegen}/Dialect/VectorExt/IR/VectorExtOps.cpp (96%) rename {llvm-external-projects/iree-dialects/include/iree-dialects => compiler/src/iree/compiler/Codegen}/Dialect/VectorExt/IR/VectorExtOps.h (97%) rename {llvm-external-projects/iree-dialects/include/iree-dialects => compiler/src/iree/compiler/Codegen}/Dialect/VectorExt/IR/VectorExtOps.td (92%) create mode 100644 compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/test/BUILD.bazel create mode 100644 compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/test/CMakeLists.txt rename {llvm-external-projects/iree-dialects/test/Dialect/iree_vector_ext => compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/test}/canonicalize.mlir (96%) rename {llvm-external-projects/iree-dialects/test/Dialect/iree_vector_ext => compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/test}/invalid.mlir (96%) rename {llvm-external-projects/iree-dialects/test/Dialect/iree_vector_ext => compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/test}/roundtrip.mlir (85%) delete mode 100644 llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/VectorExt/CMakeLists.txt delete mode 100644 llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/VectorExt/IR/CMakeLists.txt delete mode 100644 llvm-external-projects/iree-dialects/lib/Dialect/VectorExt/CMakeLists.txt delete mode 100644 llvm-external-projects/iree-dialects/lib/Dialect/VectorExt/IR/CMakeLists.txt delete mode 100644 llvm-external-projects/iree-dialects/test/Dialect/iree_vector_ext/iterators.mlir delete mode 100644 llvm-external-projects/iree-dialects/test/lib/CMakeLists.txt delete mode 100644 llvm-external-projects/iree-dialects/test/lib/VectorExt/CMakeLists.txt delete mode 100644 llvm-external-projects/iree-dialects/test/lib/VectorExt/TestIterators.cpp diff --git a/compiler/plugins/target/ROCM/BUILD.bazel b/compiler/plugins/target/ROCM/BUILD.bazel index b2fa883b31c9..75296b81eb0c 100644 --- a/compiler/plugins/target/ROCM/BUILD.bazel +++ b/compiler/plugins/target/ROCM/BUILD.bazel @@ -30,6 +30,7 @@ iree_compiler_cc_library( "//compiler/src/iree/compiler/Codegen/Dialect/Codegen/IR:IREECodegenDialect", "//compiler/src/iree/compiler/Codegen/Dialect/GPU/IR:IREEGPUDialect", "//compiler/src/iree/compiler/Codegen/Dialect/GPU/TargetUtils:KnownTargets", + "//compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR:IREEVectorExtDialect", "//compiler/src/iree/compiler/Codegen/LLVMGPU", "//compiler/src/iree/compiler/Codegen/Utils", "//compiler/src/iree/compiler/Dialect/HAL/IR", @@ -37,7 +38,6 @@ iree_compiler_cc_library( "//compiler/src/iree/compiler/Dialect/HAL/Utils:LLVMLinkerUtils", "//compiler/src/iree/compiler/PluginAPI", "//compiler/src/iree/compiler/Utils", - "//llvm-external-projects/iree-dialects:IREEVectorExtDialect", "//runtime/src/iree/schemas:rocm_executable_def_c_fbs", "@llvm-project//llvm:AMDGPUCodeGen", "@llvm-project//llvm:Analysis", diff --git a/compiler/plugins/target/ROCM/CMakeLists.txt b/compiler/plugins/target/ROCM/CMakeLists.txt index 7e88b8a4ca99..b3e8fd53e6a9 100644 --- a/compiler/plugins/target/ROCM/CMakeLists.txt +++ b/compiler/plugins/target/ROCM/CMakeLists.txt @@ -26,7 +26,6 @@ iree_cc_library( "ROCMTarget.cpp" "ROCMTargetUtils.cpp" DEPS - IREEVectorExtDialect LLVMAMDGPUCodeGen LLVMAnalysis LLVMBitWriter @@ -56,6 +55,7 @@ iree_cc_library( iree::compiler::Codegen::Dialect::Codegen::IR::IREECodegenDialect iree::compiler::Codegen::Dialect::GPU::IR::IREEGPUDialect iree::compiler::Codegen::Dialect::GPU::TargetUtils::KnownTargets + iree::compiler::Codegen::Dialect::VectorExt::IR::IREEVectorExtDialect iree::compiler::Codegen::LLVMGPU iree::compiler::Codegen::Utils iree::compiler::Dialect::HAL::IR diff --git a/compiler/plugins/target/ROCM/ROCMTarget.cpp b/compiler/plugins/target/ROCM/ROCMTarget.cpp index 75e4bbdb66c0..d6cc400a299e 100644 --- a/compiler/plugins/target/ROCM/ROCMTarget.cpp +++ b/compiler/plugins/target/ROCM/ROCMTarget.cpp @@ -8,11 +8,11 @@ #include -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtDialect.h" #include "iree/compiler/Codegen/Dialect/Codegen/IR/IREECodegenDialect.h" #include "iree/compiler/Codegen/Dialect/GPU/IR/IREEGPUAttrs.h" #include "iree/compiler/Codegen/Dialect/GPU/IR/IREEGPUDialect.h" #include "iree/compiler/Codegen/Dialect/GPU/TargetUtils/KnownTargets.h" +#include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtDialect.h" #include "iree/compiler/Codegen/LLVMGPU/Passes.h" #include "iree/compiler/Codegen/Utils/GPUUtils.h" #include "iree/compiler/Codegen/Utils/Utils.h" diff --git a/compiler/src/iree/compiler/Codegen/Common/BUILD.bazel b/compiler/src/iree/compiler/Codegen/Common/BUILD.bazel index 40b2d283a012..15cd82b2f145 100644 --- a/compiler/src/iree/compiler/Codegen/Common/BUILD.bazel +++ b/compiler/src/iree/compiler/Codegen/Common/BUILD.bazel @@ -74,7 +74,7 @@ iree_compiler_cc_library( "VectorLayoutAnalysis.h", ], deps = [ - "//llvm-external-projects/iree-dialects:IREEVectorExtDialect", + "//compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR:IREEVectorExtDialect", "@llvm-project//llvm:Support", "@llvm-project//mlir:Analysis", "@llvm-project//mlir:DialectUtils", @@ -160,6 +160,7 @@ iree_compiler_cc_library( ":PassesIncGen", "//compiler/src/iree/compiler/Codegen/Common:FoldTensorExtractOpIncGen", "//compiler/src/iree/compiler/Codegen/Dialect/Codegen/IR:IREECodegenDialect", + "//compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR:IREEVectorExtDialect", "//compiler/src/iree/compiler/Codegen/Interfaces:BufferizationInterfaces", "//compiler/src/iree/compiler/Codegen/Interfaces:PartitionableLoopsInterface", "//compiler/src/iree/compiler/Codegen/Interfaces:UKernelOpInterface", @@ -173,7 +174,6 @@ iree_compiler_cc_library( "//compiler/src/iree/compiler/Dialect/Util/IR", "//compiler/src/iree/compiler/Utils", "//llvm-external-projects/iree-dialects:IREELinalgTransformDialect", - "//llvm-external-projects/iree-dialects:IREEVectorExtDialect", "@llvm-project//llvm:Support", "@llvm-project//mlir:AffineAnalysis", "@llvm-project//mlir:AffineDialect", @@ -254,7 +254,7 @@ iree_compiler_cc_library( "//compiler/src/iree/compiler/Dialect/LinalgExt/IR", "//compiler/src/iree/compiler/Dialect/LinalgExt/TransformExtensions:LinalgExtExtensions", "//llvm-external-projects/iree-dialects:IREELinalgTransformDialect", - "//llvm-external-projects/iree-dialects:IREEVectorExtDialect", + "//compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR:IREEVectorExtDialect", "@llvm-project//mlir:AffineDialect", "@llvm-project//mlir:AffineUtils", "@llvm-project//mlir:ArmSMEDialect", diff --git a/compiler/src/iree/compiler/Codegen/Common/CMakeLists.txt b/compiler/src/iree/compiler/Codegen/Common/CMakeLists.txt index 3a73c1125a9f..76ed4cdad4fc 100644 --- a/compiler/src/iree/compiler/Codegen/Common/CMakeLists.txt +++ b/compiler/src/iree/compiler/Codegen/Common/CMakeLists.txt @@ -56,11 +56,11 @@ iree_cc_library( SRCS "VectorLayoutAnalysis.cpp" DEPS - IREEVectorExtDialect LLVMSupport MLIRAnalysis MLIRIR MLIRVectorDialect + iree::compiler::Codegen::Dialect::VectorExt::IR::IREEVectorExtDialect PUBLIC ) @@ -139,7 +139,6 @@ iree_cc_library( ::PassHeaders ::PassesIncGen IREELinalgTransformDialect - IREEVectorExtDialect LLVMSupport MLIRAffineAnalysis MLIRAffineDialect @@ -188,6 +187,7 @@ iree_cc_library( MLIRViewLikeInterface iree::compiler::Codegen::Common::FoldTensorExtractOpIncGen iree::compiler::Codegen::Dialect::Codegen::IR::IREECodegenDialect + iree::compiler::Codegen::Dialect::VectorExt::IR::IREEVectorExtDialect iree::compiler::Codegen::Interfaces::BufferizationInterfaces iree::compiler::Codegen::Interfaces::PartitionableLoopsInterface iree::compiler::Codegen::Interfaces::UKernelOpInterface @@ -216,7 +216,6 @@ iree_cc_library( ::PassesIncGen IREEDialectsTransforms IREELinalgTransformDialect - IREEVectorExtDialect LLVMSupport MLIRAffineDialect MLIRAffineTransformOps @@ -264,6 +263,7 @@ iree_cc_library( iree::compiler::Codegen::Dialect::Codegen::IR::IREECodegenDialect iree::compiler::Codegen::Dialect::GPU::IR::IREEGPUDialect iree::compiler::Codegen::Dialect::GPU::TransformExtensions::IREEGPUExtensions + iree::compiler::Codegen::Dialect::VectorExt::IR::IREEVectorExtDialect iree::compiler::Codegen::LLVMCPU::TransformExtensions::LLVMCPUExtensions iree::compiler::Codegen::LLVMGPU::TransformExtensions::LLVMGPUExtensions iree::compiler::Codegen::TransformStrategies::Common::TransformStrategies diff --git a/compiler/src/iree/compiler/Codegen/Common/CommonDialectRegistration.cpp b/compiler/src/iree/compiler/Codegen/Common/CommonDialectRegistration.cpp index 6495168dfd7c..6a96ecbdc28d 100644 --- a/compiler/src/iree/compiler/Codegen/Common/CommonDialectRegistration.cpp +++ b/compiler/src/iree/compiler/Codegen/Common/CommonDialectRegistration.cpp @@ -5,12 +5,12 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "iree-dialects/Dialect/LinalgTransform/StructuredTransformOpsExt.h" -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtDialect.h" #include "iree/compiler/Codegen/Common/PassDetail.h" #include "iree/compiler/Codegen/Common/Passes.h" #include "iree/compiler/Codegen/Common/TransformExtensions/CommonExtensions.h" #include "iree/compiler/Codegen/Dialect/Codegen/IR/IREECodegenDialect.h" #include "iree/compiler/Codegen/Dialect/GPU/IR/IREEGPUDialect.h" +#include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtDialect.h" #include "iree/compiler/Codegen/LLVMCPU/TransformExtensions/LLVMCPUExtensions.h" #include "iree/compiler/Codegen/LLVMGPU/TransformExtensions/LLVMGPUExtensions.h" #include "iree/compiler/Dialect/Encoding/IR/EncodingDialect.h" diff --git a/compiler/src/iree/compiler/Codegen/Common/GPU/BUILD.bazel b/compiler/src/iree/compiler/Codegen/Common/GPU/BUILD.bazel index d0871c17344c..91895b38e642 100644 --- a/compiler/src/iree/compiler/Codegen/Common/GPU/BUILD.bazel +++ b/compiler/src/iree/compiler/Codegen/Common/GPU/BUILD.bazel @@ -90,12 +90,12 @@ iree_compiler_cc_library( "//compiler/src/iree/compiler/Codegen/Dialect/Codegen/IR:IREECodegenDialect", "//compiler/src/iree/compiler/Codegen/Dialect/GPU/IR:IREEGPUDialect", "//compiler/src/iree/compiler/Codegen/Dialect/GPU/Transforms:GPUTransforms", + "//compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR:IREEVectorExtDialect", "//compiler/src/iree/compiler/Codegen/Interfaces:PartitionableLoopsInterface", "//compiler/src/iree/compiler/Codegen/Transforms", "//compiler/src/iree/compiler/Codegen/Utils", "//compiler/src/iree/compiler/Codegen/Utils:VectorOpUtils", "//compiler/src/iree/compiler/Dialect/HAL/IR", - "//llvm-external-projects/iree-dialects:IREEVectorExtDialect", "@llvm-project//llvm:Support", "@llvm-project//mlir:AMDGPUDialect", "@llvm-project//mlir:AffineDialect", diff --git a/compiler/src/iree/compiler/Codegen/Common/GPU/CMakeLists.txt b/compiler/src/iree/compiler/Codegen/Common/GPU/CMakeLists.txt index 29669e8ead0e..8905673860f7 100644 --- a/compiler/src/iree/compiler/Codegen/Common/GPU/CMakeLists.txt +++ b/compiler/src/iree/compiler/Codegen/Common/GPU/CMakeLists.txt @@ -77,7 +77,6 @@ iree_cc_library( DEPS ::PassHeaders ::PassesIncGen - IREEVectorExtDialect LLVMSupport MLIRAMDGPUDialect MLIRAffineDialect @@ -121,6 +120,7 @@ iree_cc_library( iree::compiler::Codegen::Dialect::Codegen::IR::IREECodegenDialect iree::compiler::Codegen::Dialect::GPU::IR::IREEGPUDialect iree::compiler::Codegen::Dialect::GPU::Transforms::GPUTransforms + iree::compiler::Codegen::Dialect::VectorExt::IR::IREEVectorExtDialect iree::compiler::Codegen::Interfaces::PartitionableLoopsInterface iree::compiler::Codegen::Transforms iree::compiler::Codegen::Utils diff --git a/compiler/src/iree/compiler/Codegen/Common/GPU/GPUDistributionPatterns.cpp b/compiler/src/iree/compiler/Codegen/Common/GPU/GPUDistributionPatterns.cpp index e0b5e6de614e..3829f83a055a 100644 --- a/compiler/src/iree/compiler/Codegen/Common/GPU/GPUDistributionPatterns.cpp +++ b/compiler/src/iree/compiler/Codegen/Common/GPU/GPUDistributionPatterns.cpp @@ -5,10 +5,10 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtOps.h" #include "iree/compiler/Codegen/Common/GPU/GPUPatterns.h" #include "iree/compiler/Codegen/Common/GPU/GPUVectorDistribution.h" #include "iree/compiler/Codegen/Dialect/Codegen/IR/IREECodegenAttrs.h" +#include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtOps.h" #include "iree/compiler/Codegen/Utils/GPUUtils.h" #include "mlir/Dialect/Affine/IR/AffineOps.h" #include "mlir/Dialect/Affine/Utils.h" diff --git a/compiler/src/iree/compiler/Codegen/Common/GPU/GPUNestedLayoutDistributionPatterns.cpp b/compiler/src/iree/compiler/Codegen/Common/GPU/GPUNestedLayoutDistributionPatterns.cpp index 6aa994cdf60b..db54f9eaa328 100644 --- a/compiler/src/iree/compiler/Codegen/Common/GPU/GPUNestedLayoutDistributionPatterns.cpp +++ b/compiler/src/iree/compiler/Codegen/Common/GPU/GPUNestedLayoutDistributionPatterns.cpp @@ -5,10 +5,10 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtDialect.h" #include "iree/compiler/Codegen/Common/GPU/GPUPatterns.h" #include "iree/compiler/Codegen/Common/GPU/GPUVectorDistribution.h" #include "iree/compiler/Codegen/Common/VectorLayoutAnalysis.h" +#include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtDialect.h" #include "iree/compiler/Codegen/Utils/GPUUtils.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/SmallVector.h" diff --git a/compiler/src/iree/compiler/Codegen/Common/GPU/GPUVectorDistribution.cpp b/compiler/src/iree/compiler/Codegen/Common/GPU/GPUVectorDistribution.cpp index 3e2df9002431..a8831809e25b 100644 --- a/compiler/src/iree/compiler/Codegen/Common/GPU/GPUVectorDistribution.cpp +++ b/compiler/src/iree/compiler/Codegen/Common/GPU/GPUVectorDistribution.cpp @@ -5,9 +5,9 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "iree/compiler/Codegen/Common/GPU/GPUVectorDistribution.h" -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtDialect.h" -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtOps.h" #include "iree/compiler/Codegen/Common/VectorLayoutAnalysis.h" +#include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtDialect.h" +#include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtOps.h" #include "mlir/Dialect/Affine/IR/AffineOps.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" #include "mlir/IR/PatternMatch.h" diff --git a/compiler/src/iree/compiler/Codegen/Common/GPU/GPUVectorDistribution.h b/compiler/src/iree/compiler/Codegen/Common/GPU/GPUVectorDistribution.h index 2ef2eb39fcd7..e0df25b0cc13 100644 --- a/compiler/src/iree/compiler/Codegen/Common/GPU/GPUVectorDistribution.h +++ b/compiler/src/iree/compiler/Codegen/Common/GPU/GPUVectorDistribution.h @@ -7,8 +7,8 @@ #ifndef IREE_COMPILER_CODEGEN_COMMON_GPU_VECTOR_DISTRIBUTION_H_ #define IREE_COMPILER_CODEGEN_COMMON_GPU_VECTOR_DISTRIBUTION_H_ -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtOps.h" #include "iree/compiler/Codegen/Common/VectorLayoutAnalysis.h" +#include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtOps.h" #include "llvm/Support/Debug.h" #include "mlir/Dialect/GPU/IR/GPUDialect.h" #include "mlir/Dialect/Vector/IR/VectorOps.h" diff --git a/compiler/src/iree/compiler/Codegen/Common/TransformExtensions/BUILD.bazel b/compiler/src/iree/compiler/Codegen/Common/TransformExtensions/BUILD.bazel index 295ec03d279c..3314da9038cc 100644 --- a/compiler/src/iree/compiler/Codegen/Common/TransformExtensions/BUILD.bazel +++ b/compiler/src/iree/compiler/Codegen/Common/TransformExtensions/BUILD.bazel @@ -67,6 +67,7 @@ iree_compiler_cc_library( "//compiler/src/iree/compiler/Codegen/Common/GPU:CommonGPUPasses", "//compiler/src/iree/compiler/Codegen/Dialect/GPU/IR:IREEGPUDialect", "//compiler/src/iree/compiler/Codegen/Dialect/GPU/Transforms:GPUTransforms", + "//compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR:IREEVectorExtDialect", "//compiler/src/iree/compiler/Codegen/Interfaces:BufferizationInterfaces", "//compiler/src/iree/compiler/Codegen/Transforms", "//compiler/src/iree/compiler/Codegen/Utils", @@ -75,7 +76,6 @@ iree_compiler_cc_library( "//compiler/src/iree/compiler/Dialect/LinalgExt/IR", "//llvm-external-projects/iree-dialects:IREEDialectsTransforms", "//llvm-external-projects/iree-dialects:IREELinalgTransformDialect", - "//llvm-external-projects/iree-dialects:IREEVectorExtDialect", "@llvm-project//llvm:Support", "@llvm-project//mlir:AffineDialect", "@llvm-project//mlir:AffineUtils", diff --git a/compiler/src/iree/compiler/Codegen/Common/TransformExtensions/CMakeLists.txt b/compiler/src/iree/compiler/Codegen/Common/TransformExtensions/CMakeLists.txt index 69f2ab2df75d..a31b95e92204 100644 --- a/compiler/src/iree/compiler/Codegen/Common/TransformExtensions/CMakeLists.txt +++ b/compiler/src/iree/compiler/Codegen/Common/TransformExtensions/CMakeLists.txt @@ -33,7 +33,6 @@ iree_cc_library( ::CommonExtensionsOpGen IREEDialectsTransforms IREELinalgTransformDialect - IREEVectorExtDialect LLVMSupport MLIRAffineDialect MLIRAffineUtils @@ -71,6 +70,7 @@ iree_cc_library( iree::compiler::Codegen::Common::VectorLayoutAnalysis iree::compiler::Codegen::Dialect::GPU::IR::IREEGPUDialect iree::compiler::Codegen::Dialect::GPU::Transforms::GPUTransforms + iree::compiler::Codegen::Dialect::VectorExt::IR::IREEVectorExtDialect iree::compiler::Codegen::Interfaces::BufferizationInterfaces iree::compiler::Codegen::Transforms iree::compiler::Codegen::Utils diff --git a/compiler/src/iree/compiler/Codegen/Common/VectorLayoutAnalysis.h b/compiler/src/iree/compiler/Codegen/Common/VectorLayoutAnalysis.h index 0eb70b1a17e4..76bea15a1725 100644 --- a/compiler/src/iree/compiler/Codegen/Common/VectorLayoutAnalysis.h +++ b/compiler/src/iree/compiler/Codegen/Common/VectorLayoutAnalysis.h @@ -7,7 +7,7 @@ #ifndef IREE_COMPILER_CODEGEN_VECTOR_LAYOUT_ANALYSIS_H #define IREE_COMPILER_CODEGEN_VECTOR_LAYOUT_ANALYSIS_H -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtOps.h" +#include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtOps.h" #include "mlir/Analysis/DataFlowFramework.h" namespace mlir { diff --git a/compiler/src/iree/compiler/Codegen/Dialect/GPU/IR/BUILD.bazel b/compiler/src/iree/compiler/Codegen/Dialect/GPU/IR/BUILD.bazel index a87a1dd7ac38..9e12352c989a 100644 --- a/compiler/src/iree/compiler/Codegen/Dialect/GPU/IR/BUILD.bazel +++ b/compiler/src/iree/compiler/Codegen/Dialect/GPU/IR/BUILD.bazel @@ -78,8 +78,8 @@ iree_compiler_cc_library( ":IREEGPUOpsGen", "//compiler/src/iree/compiler/Codegen/Dialect/Codegen/IR:IREECodegenDialect", "//compiler/src/iree/compiler/Codegen/Dialect/GPU/TargetUtils:ConfigUtils", + "//compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR:IREEVectorExtDialect", "//compiler/src/iree/compiler/Codegen/Utils:VectorOpUtils", - "//llvm-external-projects/iree-dialects:IREEVectorExtDialect", "@llvm-project//llvm:Support", "@llvm-project//mlir:AMDGPUDialect", "@llvm-project//mlir:AffineDialect", diff --git a/compiler/src/iree/compiler/Codegen/Dialect/GPU/IR/CMakeLists.txt b/compiler/src/iree/compiler/Codegen/Dialect/GPU/IR/CMakeLists.txt index d43954cefab2..b66ab3c7b089 100644 --- a/compiler/src/iree/compiler/Codegen/Dialect/GPU/IR/CMakeLists.txt +++ b/compiler/src/iree/compiler/Codegen/Dialect/GPU/IR/CMakeLists.txt @@ -41,7 +41,6 @@ iree_cc_library( ::IREEGPUEnums ::IREEGPUInterfaces ::IREEGPUOpsGen - IREEVectorExtDialect LLVMSupport MLIRAMDGPUDialect MLIRAffineDialect @@ -58,6 +57,7 @@ iree_cc_library( MLIRVectorInterfaces iree::compiler::Codegen::Dialect::Codegen::IR::IREECodegenDialect iree::compiler::Codegen::Dialect::GPU::TargetUtils::ConfigUtils + iree::compiler::Codegen::Dialect::VectorExt::IR::IREEVectorExtDialect iree::compiler::Codegen::Utils::VectorOpUtils PUBLIC ) diff --git a/compiler/src/iree/compiler/Codegen/Dialect/GPU/IR/IREEGPUAttrs.cpp b/compiler/src/iree/compiler/Codegen/Dialect/GPU/IR/IREEGPUAttrs.cpp index 966bfdae93b6..0cfe17e3f96d 100644 --- a/compiler/src/iree/compiler/Codegen/Dialect/GPU/IR/IREEGPUAttrs.cpp +++ b/compiler/src/iree/compiler/Codegen/Dialect/GPU/IR/IREEGPUAttrs.cpp @@ -7,11 +7,11 @@ #include "iree/compiler/Codegen/Dialect/GPU/IR/IREEGPUAttrs.h" #include -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtDialect.h" #include "iree/compiler/Codegen/Dialect/GPU/IR/IREEGPUDialect.h" #include "iree/compiler/Codegen/Dialect/GPU/IR/IREEGPUEnums.h" #include "iree/compiler/Codegen/Dialect/GPU/IR/IREEGPUInterfaces.h" #include "iree/compiler/Codegen/Dialect/GPU/TargetUtils/ConfigUtils.h" +#include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtDialect.h" #include "iree/compiler/Codegen/Utils/VectorOpUtils.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/STLForwardCompat.h" diff --git a/compiler/src/iree/compiler/Codegen/Dialect/GPU/IR/IREEGPUInterfaces.h b/compiler/src/iree/compiler/Codegen/Dialect/GPU/IR/IREEGPUInterfaces.h index 5338d7dcad19..6485884f6b2f 100644 --- a/compiler/src/iree/compiler/Codegen/Dialect/GPU/IR/IREEGPUInterfaces.h +++ b/compiler/src/iree/compiler/Codegen/Dialect/GPU/IR/IREEGPUInterfaces.h @@ -7,8 +7,8 @@ #ifndef IREE_COMPILER_CODEGEN_DIALECT_GPU_IREEGPUINTERFACES_H_ #define IREE_COMPILER_CODEGEN_DIALECT_GPU_IREEGPUINTERFACES_H_ -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtInterfaces.h" #include "iree/compiler/Codegen/Dialect/GPU/IR/IREEGPUEnums.h" +#include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtInterfaces.h" #include "mlir/Dialect/Vector/IR/VectorOps.h" #include "mlir/IR/Builders.h" #include "mlir/IR/BuiltinAttributes.h" diff --git a/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/BUILD.bazel b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/BUILD.bazel new file mode 100644 index 000000000000..236a47446725 --- /dev/null +++ b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/BUILD.bazel @@ -0,0 +1,11 @@ +# Copyright 2020 The IREE Authors +# +# Licensed under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +package( + default_visibility = ["//visibility:public"], + features = ["layering_check"], + licenses = ["notice"], # Apache 2.0 +) diff --git a/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/CMakeLists.txt b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/CMakeLists.txt new file mode 100644 index 000000000000..a4496148378e --- /dev/null +++ b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/CMakeLists.txt @@ -0,0 +1,13 @@ +################################################################################ +# Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from # +# compiler/src/iree/compiler/Codegen/Dialect/VectorExt/BUILD.bazel # +# # +# Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary # +# CMake-only content. # +# # +# To disable autogeneration for this file entirely, delete this header. # +################################################################################ + +iree_add_all_subdirs() + +### BAZEL_TO_CMAKE_PRESERVES_ALL_CONTENT_BELOW_THIS_LINE ### diff --git a/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/BUILD.bazel b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/BUILD.bazel new file mode 100644 index 000000000000..1d32b4747aed --- /dev/null +++ b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/BUILD.bazel @@ -0,0 +1,189 @@ +# Copyright 2024 The IREE Authors +# +# Licensed under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +load("//build_tools/bazel:build_defs.oss.bzl", "iree_compiler_cc_library", "iree_gentbl_cc_library", "iree_tablegen_doc", "iree_td_library") +load("//build_tools/bazel:enforce_glob.bzl", "enforce_glob") + +package( + default_visibility = ["//visibility:public"], + features = ["layering_check"], + licenses = ["notice"], # Apache 2.0 +) + +exports_files([ + "VectorExtAttrs.td", + "VectorExtBase.td", + "VectorExtOps.td", + "VectorExtInterfaces.td", +]) + +iree_td_library( + name = "td_files", + srcs = enforce_glob( + [ + "VectorExtAttrs.td", + "VectorExtBase.td", + "VectorExtOps.td", + "VectorExtInterfaces.td", + ], + include = ["*.td"], + ), + deps = [ + "@llvm-project//mlir:BuiltinDialectTdFiles", + "@llvm-project//mlir:InferTypeOpInterfaceTdFiles", + "@llvm-project//mlir:OpBaseTdFiles", + "@llvm-project//mlir:SideEffectInterfacesTdFiles", + ], +) + +iree_compiler_cc_library( + name = "IREEVectorExtDialect", + srcs = [ + "VectorExtAttrs.cpp", + "VectorExtDialect.cpp", + "VectorExtOps.cpp", + ], + hdrs = [ + "VectorExtDialect.h", + "VectorExtInterfaces.h", + "VectorExtOps.h", + ], + textual_hdrs = [ + "VectorExtDialect.h.inc", + "VectorExtDialect.cpp.inc", + "VectorExtAttrs.h.inc", + "VectorExtAttrs.cpp.inc", + "VectorExtEnums.h.inc", + "VectorExtEnums.cpp.inc", + "VectorExtAttrInterfaces.h.inc", + "VectorExtAttrInterfaces.cpp.inc", + "VectorExtOps.h.inc", + "VectorExtOps.cpp.inc", + ], + deps = [ + ":IREEVectorExtAttrsGen", + ":IREEVectorExtDialectGen", + ":IREEVectorExtEnumsGen", + ":IREEVectorExtInterfacesGen", + ":IREEVectorExtOpsGen", + "//compiler/src/iree/compiler/Codegen/Utils:VectorOpUtils", + "@llvm-project//llvm:Support", + "@llvm-project//mlir:AffineDialect", + "@llvm-project//mlir:DialectUtils", + "@llvm-project//mlir:IR", + "@llvm-project//mlir:SideEffectInterfaces", + "@llvm-project//mlir:Support", + "@llvm-project//mlir:TensorDialect", + "@llvm-project//mlir:VectorDialect", + ], +) + +iree_gentbl_cc_library( + name = "IREEVectorExtDialectGen", + tbl_outs = [ + ( + ["--gen-dialect-decls"], + "VectorExtDialect.h.inc", + ), + ( + ["--gen-dialect-defs"], + "VectorExtDialect.cpp.inc", + ), + ], + tblgen = "@llvm-project//mlir:mlir-tblgen", + td_file = "VectorExtBase.td", + deps = [":td_files"], +) + +iree_gentbl_cc_library( + name = "IREEVectorExtEnumsGen", + tbl_outs = [ + ( + ["--gen-enum-decls"], + "VectorExtEnums.h.inc", + ), + ( + ["--gen-enum-defs"], + "VectorExtEnums.cpp.inc", + ), + ], + tblgen = "@llvm-project//mlir:mlir-tblgen", + td_file = "VectorExtAttrs.td", + deps = [ + ":td_files", + ], +) + +iree_gentbl_cc_library( + name = "IREEVectorExtAttrsGen", + tbl_outs = [ + ( + ["--gen-attrdef-decls"], + "VectorExtAttrs.h.inc", + ), + ( + ["--gen-attrdef-defs"], + "VectorExtAttrs.cpp.inc", + ), + ], + tblgen = "@llvm-project//mlir:mlir-tblgen", + td_file = "VectorExtAttrs.td", + deps = [ + ":td_files", + ], +) + +iree_gentbl_cc_library( + name = "IREEVectorExtInterfacesGen", + tbl_outs = [ + ( + ["--gen-attr-interface-decls"], + "VectorExtAttrInterfaces.h.inc", + ), + ( + ["--gen-attr-interface-defs"], + "VectorExtAttrInterfaces.cpp.inc", + ), + ], + tblgen = "@llvm-project//mlir:mlir-tblgen", + td_file = "VectorExtInterfaces.td", + deps = [":td_files"], +) + +iree_gentbl_cc_library( + name = "IREEVectorExtOpsGen", + tbl_outs = [ + ( + ["--gen-op-decls"], + "VectorExtOps.h.inc", + ), + ( + ["--gen-op-defs"], + "VectorExtOps.cpp.inc", + ), + ], + tblgen = "@llvm-project//mlir:mlir-tblgen", + td_file = "VectorExtOps.td", + deps = [ + ":td_files", + ], +) + +iree_tablegen_doc( + name = "IREEVectorExtDialectDocGen", + tbl_outs = [ + ( + [ + "--gen-dialect-doc", + "--dialect=iree_vector_ext", + ], + "IREEVectorExtDialect.md", + ), + ], + tblgen = "@llvm-project//mlir:mlir-tblgen", + td_file = "VectorExtOps.td", + deps = [":td_files"], +) diff --git a/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/CMakeLists.txt b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/CMakeLists.txt new file mode 100644 index 000000000000..03fbfcfc7003 --- /dev/null +++ b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/CMakeLists.txt @@ -0,0 +1,111 @@ +################################################################################ +# Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from # +# compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/BUILD.bazel # +# # +# Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary # +# CMake-only content. # +# # +# To disable autogeneration for this file entirely, delete this header. # +################################################################################ + +iree_add_all_subdirs() + +iree_cc_library( + NAME + IREEVectorExtDialect + HDRS + "VectorExtDialect.h" + "VectorExtInterfaces.h" + "VectorExtOps.h" + TEXTUAL_HDRS + "VectorExtAttrInterfaces.cpp.inc" + "VectorExtAttrInterfaces.h.inc" + "VectorExtAttrs.cpp.inc" + "VectorExtAttrs.h.inc" + "VectorExtDialect.cpp.inc" + "VectorExtDialect.h.inc" + "VectorExtEnums.cpp.inc" + "VectorExtEnums.h.inc" + "VectorExtOps.cpp.inc" + "VectorExtOps.h.inc" + SRCS + "VectorExtAttrs.cpp" + "VectorExtDialect.cpp" + "VectorExtOps.cpp" + DEPS + ::IREEVectorExtAttrsGen + ::IREEVectorExtDialectGen + ::IREEVectorExtEnumsGen + ::IREEVectorExtInterfacesGen + ::IREEVectorExtOpsGen + LLVMSupport + MLIRAffineDialect + MLIRIR + MLIRSideEffectInterfaces + MLIRSupport + MLIRTensorDialect + MLIRVectorDialect + iree::compiler::Codegen::Utils::VectorOpUtils + PUBLIC +) + +iree_tablegen_library( + NAME + IREEVectorExtDialectGen + TD_FILE + "VectorExtBase.td" + OUTS + --gen-dialect-decls VectorExtDialect.h.inc + --gen-dialect-defs VectorExtDialect.cpp.inc +) + +iree_tablegen_library( + NAME + IREEVectorExtEnumsGen + TD_FILE + "VectorExtAttrs.td" + OUTS + --gen-enum-decls VectorExtEnums.h.inc + --gen-enum-defs VectorExtEnums.cpp.inc +) + +iree_tablegen_library( + NAME + IREEVectorExtAttrsGen + TD_FILE + "VectorExtAttrs.td" + OUTS + --gen-attrdef-decls VectorExtAttrs.h.inc + --gen-attrdef-defs VectorExtAttrs.cpp.inc +) + +iree_tablegen_library( + NAME + IREEVectorExtInterfacesGen + TD_FILE + "VectorExtInterfaces.td" + OUTS + --gen-attr-interface-decls VectorExtAttrInterfaces.h.inc + --gen-attr-interface-defs VectorExtAttrInterfaces.cpp.inc +) + +iree_tablegen_library( + NAME + IREEVectorExtOpsGen + TD_FILE + "VectorExtOps.td" + OUTS + --gen-op-decls VectorExtOps.h.inc + --gen-op-defs VectorExtOps.cpp.inc +) + +iree_tablegen_doc( + NAME + IREEVectorExtDialectDocGen + TD_FILE + "VectorExtOps.td" + OUTS + --gen-dialect-doc --dialect=iree_vector_ext IREEVectorExtDialect.md +) + +### BAZEL_TO_CMAKE_PRESERVES_ALL_CONTENT_BELOW_THIS_LINE ### diff --git a/llvm-external-projects/iree-dialects/lib/Dialect/VectorExt/IR/VectorExtAttrs.cpp b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtAttrs.cpp similarity index 97% rename from llvm-external-projects/iree-dialects/lib/Dialect/VectorExt/IR/VectorExtAttrs.cpp rename to compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtAttrs.cpp index 8c175c1fff2a..8335cd65ac5c 100644 --- a/llvm-external-projects/iree-dialects/lib/Dialect/VectorExt/IR/VectorExtAttrs.cpp +++ b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtAttrs.cpp @@ -6,18 +6,18 @@ #include -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtDialect.h" -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtOps.h" +#include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtDialect.h" +#include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtOps.h" +#include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/TypeSwitch.h" #include "mlir/Dialect/Affine/IR/AffineOps.h" #include "mlir/Dialect/Utils/IndexingUtils.h" #include "mlir/IR/AffineMap.h" #include "mlir/IR/DialectImplementation.h" #include "mlir/IR/OpDefinition.h" #include "mlir/IR/PatternMatch.h" -#include "llvm/ADT/DenseMap.h" -#include "llvm/ADT/STLExtras.h" -#include "llvm/ADT/SmallVector.h" -#include "llvm/ADT/TypeSwitch.h" using namespace mlir; @@ -496,14 +496,14 @@ NestedLayoutAttr::computeThreadIds(Value threadId, int64_t subgroupSize, using namespace mlir::iree_compiler::IREE::VectorExt; -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtEnums.cpp.inc" // IWYU pragma: keep +#include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtEnums.cpp.inc" // IWYU pragma: keep #define GET_ATTRDEF_CLASSES -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtAttrs.cpp.inc" // IWYU pragma: keep +#include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtAttrs.cpp.inc" // IWYU pragma: keep void IREEVectorExtDialect::registerAttributes() { addAttributes< #define GET_ATTRDEF_LIST -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtAttrs.cpp.inc" +#include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtAttrs.cpp.inc" >(); } diff --git a/llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/VectorExt/IR/VectorExtAttrs.td b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtAttrs.td similarity index 99% rename from llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/VectorExt/IR/VectorExtAttrs.td rename to compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtAttrs.td index a91caf5d48d5..400a6eaf85a4 100644 --- a/llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/VectorExt/IR/VectorExtAttrs.td +++ b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtAttrs.td @@ -7,7 +7,7 @@ #ifndef IREE_DIALECT_VECTOREXT_ATTRS #define IREE_DIALECT_VECTOREXT_ATTRS -include "iree-dialects/Dialect/VectorExt/IR/VectorExtBase.td" +include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtBase.td" //===---------------------------------------------------------------------===// // Vector layout attributes diff --git a/llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/VectorExt/IR/VectorExtBase.td b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtBase.td similarity index 95% rename from llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/VectorExt/IR/VectorExtBase.td rename to compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtBase.td index 5bab8e9bb81e..61843e35bb5c 100644 --- a/llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/VectorExt/IR/VectorExtBase.td +++ b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtBase.td @@ -12,7 +12,7 @@ include "mlir/IR/OpBase.td" include "mlir/IR/AttrTypeBase.td" include "mlir/IR/EnumAttr.td" -include "iree-dialects/Dialect/VectorExt/IR/VectorExtInterfaces.td" +include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtInterfaces.td" //===----------------------------------------------------------------------===// // Dialect definition diff --git a/llvm-external-projects/iree-dialects/lib/Dialect/VectorExt/IR/VectorExtDialect.cpp b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtDialect.cpp similarity index 74% rename from llvm-external-projects/iree-dialects/lib/Dialect/VectorExt/IR/VectorExtDialect.cpp rename to compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtDialect.cpp index 213f57b79f9f..ba32c2326cb2 100644 --- a/llvm-external-projects/iree-dialects/lib/Dialect/VectorExt/IR/VectorExtDialect.cpp +++ b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtDialect.cpp @@ -4,19 +4,19 @@ // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtDialect.h" -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtOps.h" -#include "mlir/IR/DialectImplementation.h" -#include "llvm/ADT/TypeSwitch.h" +#include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtDialect.h" #include +#include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtOps.h" +#include "llvm/ADT/TypeSwitch.h" +#include "mlir/IR/DialectImplementation.h" using namespace mlir; -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtDialect.cpp.inc" +#include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtDialect.cpp.inc" using namespace mlir::iree_compiler::IREE::VectorExt; -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtAttrInterfaces.cpp.inc" +#include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtAttrInterfaces.cpp.inc" namespace mlir::iree_compiler::IREE::VectorExt { @@ -41,7 +41,7 @@ void IREEVectorExtDialect::initialize() { #define GET_OP_LIST addOperations< -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtOps.cpp.inc" +#include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtOps.cpp.inc" >(); } diff --git a/llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/VectorExt/IR/VectorExtDialect.h b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtDialect.h similarity index 58% rename from llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/VectorExt/IR/VectorExtDialect.h rename to compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtDialect.h index 3b47d68210df..feef8f14e41d 100644 --- a/llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/VectorExt/IR/VectorExtDialect.h +++ b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtDialect.h @@ -7,7 +7,7 @@ #ifndef IREE_DIALECTS_DIALECT_VECTOREXT_IR_VECTOREXTDIALECT_H_ #define IREE_DIALECTS_DIALECT_VECTOREXT_IR_VECTOREXTDIALECT_H_ -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtInterfaces.h" +#include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtInterfaces.h" #include "mlir/Bytecode/BytecodeImplementation.h" #include "mlir/Bytecode/BytecodeOpInterface.h" #include "mlir/IR/Dialect.h" @@ -16,15 +16,15 @@ // clang-format off: must be included after all LLVM/MLIR headers -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtDialect.h.inc" // IWYU pragma: keep - -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtEnums.h.inc" // IWYU pragma: export +#include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtDialect.h.inc" // IWYU pragma: keep + // +#include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtEnums.h.inc" // IWYU pragma: keep #define GET_ATTRDEF_CLASSES -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtAttrs.h.inc" // IWYU pragma: export +#include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtAttrs.h.inc" // IWYU pragma: export #define GET_OP_CLASSES -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtOps.h.inc" // IWYU pragma: export +#include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtOps.h.inc" // IWYU pragma: export // clang-format on diff --git a/llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/VectorExt/IR/VectorExtInterfaces.h b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtInterfaces.h similarity index 87% rename from llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/VectorExt/IR/VectorExtInterfaces.h rename to compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtInterfaces.h index 59bcd1abdc9d..a46487fc64c0 100644 --- a/llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/VectorExt/IR/VectorExtInterfaces.h +++ b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtInterfaces.h @@ -7,12 +7,12 @@ #ifndef IREE_DIALECTS_DIALECT_VECTOREXT_INTERFACES_H_ #define IREE_DIALECTS_DIALECT_VECTOREXT_INTERFACES_H_ -#include "mlir/IR/BuiltinTypes.h" -#include "mlir/IR/OpDefinition.h" #include #include +#include "mlir/IR/BuiltinTypes.h" +#include "mlir/IR/OpDefinition.h" /// Include the generated interface declarations. -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtAttrInterfaces.h.inc" +#include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtAttrInterfaces.h.inc" #endif // IREE_DIALECTS_DIALECT_VECTOREXT_INTERFACES_H diff --git a/llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/VectorExt/IR/VectorExtInterfaces.td b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtInterfaces.td similarity index 100% rename from llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/VectorExt/IR/VectorExtInterfaces.td rename to compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtInterfaces.td diff --git a/llvm-external-projects/iree-dialects/lib/Dialect/VectorExt/IR/VectorExtOps.cpp b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtOps.cpp similarity index 96% rename from llvm-external-projects/iree-dialects/lib/Dialect/VectorExt/IR/VectorExtOps.cpp rename to compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtOps.cpp index c6943989c515..e06b65f86fc4 100644 --- a/llvm-external-projects/iree-dialects/lib/Dialect/VectorExt/IR/VectorExtOps.cpp +++ b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtOps.cpp @@ -4,9 +4,9 @@ // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtOps.h" -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtDialect.h" +#include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtOps.h" #include +#include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtDialect.h" using namespace mlir; using namespace mlir::iree_compiler::IREE::VectorExt; @@ -197,5 +197,5 @@ LayoutIterator LayoutIterator::getBatchIterator() const { // clang-format off #define GET_OP_CLASSES -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtOps.cpp.inc" // IWYU pragma: keep +#include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtOps.cpp.inc" // IWYU pragma: keep // clang-format on diff --git a/llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/VectorExt/IR/VectorExtOps.h b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtOps.h similarity index 97% rename from llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/VectorExt/IR/VectorExtOps.h rename to compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtOps.h index cc92bb6406ea..408c95a80548 100644 --- a/llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/VectorExt/IR/VectorExtOps.h +++ b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtOps.h @@ -7,8 +7,9 @@ #ifndef IREE_DIALECTS_DIALECT_VECTOREXT_IR_VECTOREXTOPS_H_ #define IREE_DIALECTS_DIALECT_VECTOREXT_IR_VECTOREXTOPS_H_ -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtDialect.h" -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtInterfaces.h" +#include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtDialect.h" +#include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtInterfaces.h" +#include "llvm/ADT/MapVector.h" #include "mlir/Bytecode/BytecodeImplementation.h" #include "mlir/Bytecode/BytecodeOpInterface.h" #include "mlir/IR/Attributes.h" @@ -17,7 +18,6 @@ #include "mlir/IR/Dialect.h" #include "mlir/IR/OpDefinition.h" #include "mlir/Interfaces/SideEffectInterfaces.h" -#include "llvm/ADT/MapVector.h" namespace mlir::iree_compiler::IREE::VectorExt { diff --git a/llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/VectorExt/IR/VectorExtOps.td b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtOps.td similarity index 92% rename from llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/VectorExt/IR/VectorExtOps.td rename to compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtOps.td index f21607a25a2c..5565165792f0 100644 --- a/llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/VectorExt/IR/VectorExtOps.td +++ b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtOps.td @@ -7,8 +7,9 @@ #ifndef IREE_DIALECT_VECTOREXT_OPS #define IREE_DIALECT_VECTOREXT_OPS -include "iree-dialects/Dialect/VectorExt/IR/VectorExtBase.td" -include "iree-dialects/Dialect/VectorExt/IR/VectorExtInterfaces.td" +include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtBase.td" +include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtAttrs.td" +include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtInterfaces.td" include "mlir/IR/OpBase.td" include "mlir/Interfaces/SideEffectInterfaces.td" diff --git a/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/test/BUILD.bazel b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/test/BUILD.bazel new file mode 100644 index 000000000000..f4b3ce71c919 --- /dev/null +++ b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/test/BUILD.bazel @@ -0,0 +1,32 @@ +# Copyright 2024 The IREE Authors +# +# Licensed under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +# Tests for common transforms. + +load("//build_tools/bazel:enforce_glob.bzl", "enforce_glob") +load("//build_tools/bazel:iree_lit_test.bzl", "iree_lit_test_suite") + +package( + features = ["layering_check"], + licenses = ["notice"], # Apache 2.0 +) + +iree_lit_test_suite( + name = "lit", + srcs = enforce_glob( + [ + "canonicalize.mlir", + "invalid.mlir", + "roundtrip.mlir", + ], + include = ["*.mlir"], + ), + cfg = "//compiler:lit.cfg.py", + tools = [ + "//tools:iree-opt", + "@llvm-project//llvm:FileCheck", + ], +) diff --git a/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/test/CMakeLists.txt b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/test/CMakeLists.txt new file mode 100644 index 000000000000..32de92c96b91 --- /dev/null +++ b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/test/CMakeLists.txt @@ -0,0 +1,25 @@ +################################################################################ +# Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from # +# compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/test/BUILD.bazel # +# # +# Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary # +# CMake-only content. # +# # +# To disable autogeneration for this file entirely, delete this header. # +################################################################################ + +iree_add_all_subdirs() + +iree_lit_test_suite( + NAME + lit + SRCS + "canonicalize.mlir" + "invalid.mlir" + "roundtrip.mlir" + TOOLS + FileCheck + iree-opt +) + +### BAZEL_TO_CMAKE_PRESERVES_ALL_CONTENT_BELOW_THIS_LINE ### diff --git a/llvm-external-projects/iree-dialects/test/Dialect/iree_vector_ext/canonicalize.mlir b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/test/canonicalize.mlir similarity index 96% rename from llvm-external-projects/iree-dialects/test/Dialect/iree_vector_ext/canonicalize.mlir rename to compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/test/canonicalize.mlir index 2af2a085b46b..6e22f2d411d7 100644 --- a/llvm-external-projects/iree-dialects/test/Dialect/iree_vector_ext/canonicalize.mlir +++ b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/test/canonicalize.mlir @@ -1,4 +1,4 @@ -// RUN: iree-dialects-opt --canonicalize --split-input-file %s | FileCheck %s +// RUN: iree-opt --canonicalize --split-input-file %s | FileCheck %s // CHECK-LABEL: @to_simt_to_simd_fold // CHECK-SAME: (%[[SIMD:.*]]: vector<64x64xf32>) -> vector<64x64xf32> diff --git a/llvm-external-projects/iree-dialects/test/Dialect/iree_vector_ext/invalid.mlir b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/test/invalid.mlir similarity index 96% rename from llvm-external-projects/iree-dialects/test/Dialect/iree_vector_ext/invalid.mlir rename to compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/test/invalid.mlir index 7a848362524f..2f24757e9903 100644 --- a/llvm-external-projects/iree-dialects/test/Dialect/iree_vector_ext/invalid.mlir +++ b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/test/invalid.mlir @@ -1,4 +1,4 @@ -// RUN: iree-dialects-opt --split-input-file --verify-diagnostics %s +// RUN: iree-opt --split-input-file --verify-diagnostics %s #row_layout1 = #iree_vector_ext.per_dim_layout<[BATCHX, LANEX, VECTORY], [1, 1, 1]> #col_layout1 = #iree_vector_ext.per_dim_layout<[BATCHY, LANEY, VECTORX], [4, 2, 4]> diff --git a/llvm-external-projects/iree-dialects/test/Dialect/iree_vector_ext/roundtrip.mlir b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/test/roundtrip.mlir similarity index 85% rename from llvm-external-projects/iree-dialects/test/Dialect/iree_vector_ext/roundtrip.mlir rename to compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/test/roundtrip.mlir index 5d8018df03f6..d1835c9015ab 100644 --- a/llvm-external-projects/iree-dialects/test/Dialect/iree_vector_ext/roundtrip.mlir +++ b/compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR/test/roundtrip.mlir @@ -1,4 +1,4 @@ -// RUN: iree-dialects-opt --split-input-file %s | FileCheck %s +// RUN: iree-opt --split-input-file %s | FileCheck %s #row_layout1 = #iree_vector_ext.per_dim_layout<[BATCHX, LANEX, VECTORY], [2, 4, 4]> #col_layout1 = #iree_vector_ext.per_dim_layout<[BATCHY, LANEY, VECTORX], [4, 2, 4]> @@ -11,9 +11,9 @@ func.func @specify_layout(%lhs: memref<32x32xf16>) -> vector<32x32xf16> { return %2 : vector<32x32xf16> } -// CHECK-DAG: #[[LAYOUT0:.+]] = #iree_vector_ext.layout<<[ BATCHY, LANEY, VECTORX], [4, 2, 4]>, <[ BATCHX, LANEX, VECTORY], [2, 4, 4]>> +// CHECK-DAG: #[[$LAYOUT0:.+]] = #iree_vector_ext.layout<<[ BATCHY, LANEY, VECTORX], [4, 2, 4]>, <[ BATCHX, LANEX, VECTORY], [2, 4, 4]>> // CHECK-LABEL: func.func @specify_layout -// CHECK: iree_vector_ext.to_layout {{.*}} to #[[LAYOUT0]] +// CHECK: iree_vector_ext.to_layout {{.*}} to #[[$LAYOUT0]] // ----- @@ -50,7 +50,7 @@ func.func @specify_nested(%lhs: memref<32x32xf16>) -> vector<32x32xf16> { return %result : vector<32x32xf16> } -// CHECK: #[[LAYOUT0:.+]] = #iree_vector_ext.nested_layout< +// CHECK: #[[$LAYOUT0:.+]] = #iree_vector_ext.nested_layout< // CHECK-SAME: subgroups_per_workgroup = [1, 1], // CHECK-SAME: batches_per_subgroup = [2, 4], // CHECK-SAME: outers_per_batch = [4, 1], @@ -59,7 +59,7 @@ func.func @specify_nested(%lhs: memref<32x32xf16>) -> vector<32x32xf16> { // CHECK-SAME: subgroup_strides = [0, 0], // CHECK-SAME: thread_strides = [1, 4]> -// CHECK: #[[LAYOUT1:.+]] = #iree_vector_ext.nested_layout< +// CHECK: #[[$LAYOUT1:.+]] = #iree_vector_ext.nested_layout< // CHECK-SAME: subgroups_per_workgroup = [1, 1], // CHECK-SAME: batches_per_subgroup = [4, 2], // CHECK-SAME: outers_per_batch = [1, 4], @@ -70,8 +70,8 @@ func.func @specify_nested(%lhs: memref<32x32xf16>) -> vector<32x32xf16> { // CHECK-LABEL: func.func @specify_nested // CHECK: vector.transfer_read -// CHECK-SAME: layout0 = #[[LAYOUT0]] -// CHECK-SAME: layout1 = #[[LAYOUT1]] +// CHECK-SAME: layout0 = #[[$LAYOUT0]] +// CHECK-SAME: layout1 = #[[$LAYOUT1]] // ----- diff --git a/compiler/src/iree/compiler/Codegen/LLVMGPU/BUILD.bazel b/compiler/src/iree/compiler/Codegen/LLVMGPU/BUILD.bazel index 784a945cc0cf..aeeee5e777c0 100644 --- a/compiler/src/iree/compiler/Codegen/LLVMGPU/BUILD.bazel +++ b/compiler/src/iree/compiler/Codegen/LLVMGPU/BUILD.bazel @@ -133,6 +133,7 @@ iree_compiler_cc_library( "//compiler/src/iree/compiler/Codegen/Dialect/Codegen/IR:IREECodegenDialect", "//compiler/src/iree/compiler/Codegen/Dialect/GPU/IR:IREEGPUDialect", "//compiler/src/iree/compiler/Codegen/Dialect/GPU/Transforms:GPUTransforms", + "//compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR:IREEVectorExtDialect", "//compiler/src/iree/compiler/Codegen/Interfaces:PartitionableLoopsInterface", "//compiler/src/iree/compiler/Codegen/Interfaces:UKernelOpInterface", "//compiler/src/iree/compiler/Codegen/LLVMGPU/TransformExtensions:LLVMGPUExtensions", @@ -152,7 +153,6 @@ iree_compiler_cc_library( "//compiler/src/iree/compiler/Utils", "//llvm-external-projects/iree-dialects:IREELinalgTransformDialect", "//llvm-external-projects/iree-dialects:IREELinalgTransformDialectPasses", - "//llvm-external-projects/iree-dialects:IREEVectorExtDialect", "@llvm-project//llvm:Support", "@llvm-project//mlir:AMDGPUDialect", "@llvm-project//mlir:AMDGPUToROCDL", diff --git a/compiler/src/iree/compiler/Codegen/LLVMGPU/CMakeLists.txt b/compiler/src/iree/compiler/Codegen/LLVMGPU/CMakeLists.txt index a552962f0fee..f57af96e8081 100644 --- a/compiler/src/iree/compiler/Codegen/LLVMGPU/CMakeLists.txt +++ b/compiler/src/iree/compiler/Codegen/LLVMGPU/CMakeLists.txt @@ -104,7 +104,6 @@ iree_cc_library( ::ROCDLPassesIncGen IREELinalgTransformDialect IREELinalgTransformDialectPasses - IREEVectorExtDialect LLVMSupport MLIRAMDGPUDialect MLIRAMDGPUToROCDL @@ -175,6 +174,7 @@ iree_cc_library( iree::compiler::Codegen::Dialect::Codegen::IR::IREECodegenDialect iree::compiler::Codegen::Dialect::GPU::IR::IREEGPUDialect iree::compiler::Codegen::Dialect::GPU::Transforms::GPUTransforms + iree::compiler::Codegen::Dialect::VectorExt::IR::IREEVectorExtDialect iree::compiler::Codegen::Interfaces::PartitionableLoopsInterface iree::compiler::Codegen::Interfaces::UKernelOpInterface iree::compiler::Codegen::LLVMGPU::TransformExtensions::LLVMGPUExtensions diff --git a/compiler/src/iree/compiler/Codegen/LLVMGPU/LLVMGPUConfigureVectorLayouts.cpp b/compiler/src/iree/compiler/Codegen/LLVMGPU/LLVMGPUConfigureVectorLayouts.cpp index e576102c9db7..dee5e89b086b 100644 --- a/compiler/src/iree/compiler/Codegen/LLVMGPU/LLVMGPUConfigureVectorLayouts.cpp +++ b/compiler/src/iree/compiler/Codegen/LLVMGPU/LLVMGPUConfigureVectorLayouts.cpp @@ -6,9 +6,9 @@ #include -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtDialect.h" #include "iree/compiler/Codegen/Dialect/Codegen/IR/IREECodegenAttrs.h" #include "iree/compiler/Codegen/Dialect/GPU/IR/IREEGPUAttrs.h" +#include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtDialect.h" #include "iree/compiler/Codegen/LLVMGPU/PassDetail.h" #include "iree/compiler/Codegen/LLVMGPU/Passes.h" #include "iree/compiler/Codegen/Utils/GPUUtils.h" diff --git a/compiler/src/iree/compiler/Codegen/LLVMGPU/LLVMGPULowerExecutableTarget.cpp b/compiler/src/iree/compiler/Codegen/LLVMGPU/LLVMGPULowerExecutableTarget.cpp index 6ee91d5f7085..2b72c8ab40b5 100644 --- a/compiler/src/iree/compiler/Codegen/LLVMGPU/LLVMGPULowerExecutableTarget.cpp +++ b/compiler/src/iree/compiler/Codegen/LLVMGPU/LLVMGPULowerExecutableTarget.cpp @@ -4,11 +4,11 @@ // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtDialect.h" #include "iree/compiler/Codegen/Common/PassUtils.h" #include "iree/compiler/Codegen/Dialect/Codegen/IR/IREECodegenAttrs.h" #include "iree/compiler/Codegen/Dialect/Codegen/IR/IREECodegenDialect.h" #include "iree/compiler/Codegen/Dialect/GPU/IR/IREEGPUDialect.h" +#include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtDialect.h" #include "iree/compiler/Codegen/LLVMGPU/KernelConfig.h" #include "iree/compiler/Codegen/LLVMGPU/PassDetail.h" #include "iree/compiler/Codegen/LLVMGPU/Passes.h" diff --git a/compiler/src/iree/compiler/Codegen/LLVMGPU/LLVMGPUVectorDistribute.cpp b/compiler/src/iree/compiler/Codegen/LLVMGPU/LLVMGPUVectorDistribute.cpp index d9d513819bac..e4a9a81708ca 100644 --- a/compiler/src/iree/compiler/Codegen/LLVMGPU/LLVMGPUVectorDistribute.cpp +++ b/compiler/src/iree/compiler/Codegen/LLVMGPU/LLVMGPUVectorDistribute.cpp @@ -4,10 +4,10 @@ // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtDialect.h" #include "iree/compiler/Codegen/Common/GPU/GPUPatterns.h" #include "iree/compiler/Codegen/Common/GPU/GPUVectorDistribution.h" #include "iree/compiler/Codegen/Dialect/Codegen/IR/IREECodegenAttrs.h" +#include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtDialect.h" #include "iree/compiler/Codegen/LLVMGPU/PassDetail.h" #include "iree/compiler/Codegen/LLVMGPU/Passes.h" #include "mlir/Analysis/SliceAnalysis.h" diff --git a/compiler/src/iree/compiler/Codegen/LLVMGPU/Utils/AMDGPUDistributionPatterns.cpp b/compiler/src/iree/compiler/Codegen/LLVMGPU/Utils/AMDGPUDistributionPatterns.cpp index 9140faf0313d..986a389e788c 100644 --- a/compiler/src/iree/compiler/Codegen/LLVMGPU/Utils/AMDGPUDistributionPatterns.cpp +++ b/compiler/src/iree/compiler/Codegen/LLVMGPU/Utils/AMDGPUDistributionPatterns.cpp @@ -4,10 +4,10 @@ // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtOps.h" #include "iree/compiler/Codegen/Common/GPU/GPUVectorDistribution.h" #include "iree/compiler/Codegen/Common/VectorLayoutAnalysis.h" #include "iree/compiler/Codegen/Dialect/GPU/IR/IREEGPUAttrs.h" +#include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtOps.h" #include "iree/compiler/Codegen/LLVMGPU/Utils/LLVMGPUUtils.h" #include "iree/compiler/Codegen/Utils/VectorOpUtils.h" diff --git a/compiler/src/iree/compiler/Codegen/LLVMGPU/Utils/BUILD.bazel b/compiler/src/iree/compiler/Codegen/LLVMGPU/Utils/BUILD.bazel index 5e1f85e48680..dcf89c80bf53 100644 --- a/compiler/src/iree/compiler/Codegen/LLVMGPU/Utils/BUILD.bazel +++ b/compiler/src/iree/compiler/Codegen/LLVMGPU/Utils/BUILD.bazel @@ -30,12 +30,12 @@ iree_compiler_cc_library( "//compiler/src/iree/compiler/Codegen/Common:VectorLayoutAnalysis", "//compiler/src/iree/compiler/Codegen/Common/GPU:CommonGPUPasses", "//compiler/src/iree/compiler/Codegen/Dialect/GPU/IR:IREEGPUDialect", + "//compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR:IREEVectorExtDialect", "//compiler/src/iree/compiler/Codegen/Transforms", "//compiler/src/iree/compiler/Codegen/Utils", "//compiler/src/iree/compiler/Codegen/Utils:VectorOpUtils", "//compiler/src/iree/compiler/Dialect/HAL/IR", "//compiler/src/iree/compiler/Dialect/LinalgExt/Utils", - "//llvm-external-projects/iree-dialects:IREEVectorExtDialect", "@llvm-project//llvm:Support", "@llvm-project//mlir:AMDGPUDialect", "@llvm-project//mlir:AffineDialect", diff --git a/compiler/src/iree/compiler/Codegen/LLVMGPU/Utils/CMakeLists.txt b/compiler/src/iree/compiler/Codegen/LLVMGPU/Utils/CMakeLists.txt index 6fd8c6182b1a..414cc91b3404 100644 --- a/compiler/src/iree/compiler/Codegen/LLVMGPU/Utils/CMakeLists.txt +++ b/compiler/src/iree/compiler/Codegen/LLVMGPU/Utils/CMakeLists.txt @@ -21,7 +21,6 @@ iree_cc_library( "LLVMGPUUtils.cpp" "PrefetchSharedMemoryCopy.cpp" DEPS - IREEVectorExtDialect LLVMSupport MLIRAMDGPUDialect MLIRAffineDialect @@ -42,6 +41,7 @@ iree_cc_library( iree::compiler::Codegen::Common::GPU::CommonGPUPasses iree::compiler::Codegen::Common::VectorLayoutAnalysis iree::compiler::Codegen::Dialect::GPU::IR::IREEGPUDialect + iree::compiler::Codegen::Dialect::VectorExt::IR::IREEVectorExtDialect iree::compiler::Codegen::Transforms iree::compiler::Codegen::Utils iree::compiler::Codegen::Utils::VectorOpUtils diff --git a/compiler/src/iree/compiler/Tools/BUILD.bazel b/compiler/src/iree/compiler/Tools/BUILD.bazel index e57ef6b004b5..ee5d60dccfff 100644 --- a/compiler/src/iree/compiler/Tools/BUILD.bazel +++ b/compiler/src/iree/compiler/Tools/BUILD.bazel @@ -36,6 +36,7 @@ iree_compiler_cc_library( "//compiler/src/iree/compiler/Bindings/TFLite/Transforms", "//compiler/src/iree/compiler/Codegen/Dialect/Codegen/IR:IREECodegenDialect", "//compiler/src/iree/compiler/Codegen/Dialect/GPU/IR:IREEGPUDialect", + "//compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR:IREEVectorExtDialect", "//compiler/src/iree/compiler/Codegen/Interfaces", "//compiler/src/iree/compiler/ConstEval", "//compiler/src/iree/compiler/Dialect/Encoding/IR", @@ -71,7 +72,6 @@ iree_compiler_cc_library( "//llvm-external-projects/iree-dialects:IREEInputDialect", "//llvm-external-projects/iree-dialects:IREELinalgTransformDialect", "//llvm-external-projects/iree-dialects:IREELinalgTransformDialectPasses", - "//llvm-external-projects/iree-dialects:IREEVectorExtDialect", "@llvm-project//mlir:IR", ], ) diff --git a/compiler/src/iree/compiler/Tools/CMakeLists.txt b/compiler/src/iree/compiler/Tools/CMakeLists.txt index 0caa69dfd246..c8531f6ca1f5 100644 --- a/compiler/src/iree/compiler/Tools/CMakeLists.txt +++ b/compiler/src/iree/compiler/Tools/CMakeLists.txt @@ -26,12 +26,12 @@ iree_cc_library( IREEInputDialect IREELinalgTransformDialect IREELinalgTransformDialectPasses - IREEVectorExtDialect MLIRIR iree::compiler::Bindings::Native::Transforms iree::compiler::Bindings::TFLite::Transforms iree::compiler::Codegen::Dialect::Codegen::IR::IREECodegenDialect iree::compiler::Codegen::Dialect::GPU::IR::IREEGPUDialect + iree::compiler::Codegen::Dialect::VectorExt::IR::IREEVectorExtDialect iree::compiler::Codegen::Interfaces::Interfaces iree::compiler::ConstEval iree::compiler::Dialect::Flow::IR diff --git a/compiler/src/iree/compiler/Tools/init_iree_dialects.h b/compiler/src/iree/compiler/Tools/init_iree_dialects.h index 4d333879ae11..0bc41231dbea 100644 --- a/compiler/src/iree/compiler/Tools/init_iree_dialects.h +++ b/compiler/src/iree/compiler/Tools/init_iree_dialects.h @@ -14,9 +14,9 @@ #include "iree-dialects/Dialect/Input/InputDialect.h" #include "iree-dialects/Dialect/LinalgTransform/Passes.h" -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtDialect.h" #include "iree/compiler/Codegen/Dialect/Codegen/IR/IREECodegenDialect.h" #include "iree/compiler/Codegen/Dialect/GPU/IR/IREEGPUDialect.h" +#include "iree/compiler/Codegen/Dialect/VectorExt/IR/VectorExtDialect.h" #include "iree/compiler/Codegen/Interfaces/Interfaces.h" #include "iree/compiler/Dialect/Encoding/IR/EncodingDialect.h" #include "iree/compiler/Dialect/Flow/IR/FlowDialect.h" diff --git a/docs/website/docs/reference/mlir-dialects/index.md b/docs/website/docs/reference/mlir-dialects/index.md index 1862d59d8e10..f96cce9215ea 100644 --- a/docs/website/docs/reference/mlir-dialects/index.md +++ b/docs/website/docs/reference/mlir-dialects/index.md @@ -27,6 +27,7 @@ Dialect | Description [IO/Parameters](./IOParameters.md) | External parameter resource management APIs [IREECodegen](./IREECodegen.md) | Common functionality used by IREE code generation [IREEGPU](./IREEGPU.md) | Common functionality used by GPU focused IREE code generation +[IREEVectorExt](./IREEVectorExt.md) | Extensions to the Vector dialect for specific operations [LinalgExt](./LinalgExt.md) | Extensions to the Linalg dialect for specific operations [Stream](./Stream.md) | Model execution partitioning and scheduling [Util](./Util.md) | Types and ops common across IREE subdialects @@ -44,6 +45,5 @@ mechanism. Dialect | Description ------------------------------------| ----------- [IREEInput](./IREEInput.md) | Structural ops legal as input to IREE's compiler -[IREEVectorExt](./IREEVectorExt.md) | Extensions to the Vector dialect for specific operations [^1]: Hardware Abstraction Layer diff --git a/docs/website/generate_extra_files.sh b/docs/website/generate_extra_files.sh index 57353ed14a73..455cacfd532e 100755 --- a/docs/website/generate_extra_files.sh +++ b/docs/website/generate_extra_files.sh @@ -56,7 +56,6 @@ done # Rename iree-dialect files. mv "${BUILD_DOCS_PROCESSED_DIR}/InputOps.md" "${BUILD_DOCS_PROCESSED_DIR}/IREEInput.md" -mv "${BUILD_DOCS_PROCESSED_DIR}/VectorExtOps.md" "${BUILD_DOCS_PROCESSED_DIR}/IREEVectorExt.md" # mv "${BUILD_DOCS_PROCESSED_DIR}/StructuredTransformOpsExt.md" "${BUILD_DOCS_PROCESSED_DIR}/IREEStructuredTransformExt.md" # Postprocess the dialect docs (e.g. making tweaks to the markdown source). diff --git a/docs/website/mkdocs.yml b/docs/website/mkdocs.yml index ac70451ee2ef..c53e9f0257c2 100644 --- a/docs/website/mkdocs.yml +++ b/docs/website/mkdocs.yml @@ -168,6 +168,7 @@ nav: - IO/Parameters: "reference/mlir-dialects/IOParameters.md" - IREECodegen: "reference/mlir-dialects/IREECodegen.md" - IREEGPU: "reference/mlir-dialects/IREEGPU.md" + - IREEVectorExt: "reference/mlir-dialects/IREEVectorExt.md" - LinalgExt: "reference/mlir-dialects/LinalgExt.md" - Stream: "reference/mlir-dialects/Stream.md" - Util: "reference/mlir-dialects/Util.md" @@ -176,7 +177,6 @@ nav: # Dialects from llvm-external-projects/iree-dialects/ - "Public dialects": - IREEInput: "reference/mlir-dialects/IREEInput.md" - - IREEVectorExt: "reference/mlir-dialects/IREEVectorExt.md" - "Other topics": - Glossary: "reference/glossary.md" - Optimization options: "reference/optimization-options.md" diff --git a/docs/website/postprocess_dialect_docs.py b/docs/website/postprocess_dialect_docs.py index 0caef2a2646e..8cd9337881de 100644 --- a/docs/website/postprocess_dialect_docs.py +++ b/docs/website/postprocess_dialect_docs.py @@ -78,7 +78,7 @@ def main(args): "IREECodegen.md": "compiler/src/iree/compiler/Codegen/Dialect/Codegen/IR", "IREEGPU.md": "compiler/src/iree/compiler/Codegen/Dialect/GPU/IR", "IREEInput.md": "llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/Input", - "IREEVectorExt.md": "llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/VectorExt/IR", + "IREEVectorExt.md": "compiler/src/iree/compiler/Codegen/Dialect/VectorExt/IR", "LinalgExt.md": "compiler/src/iree/compiler/Dialect/LinalgExt/IR", "Stream.md": "compiler/src/iree/compiler/Dialect/Stream/IR", "Util.md": "compiler/src/iree/compiler/Dialect/Util/IR", diff --git a/llvm-external-projects/iree-dialects/BUILD.bazel b/llvm-external-projects/iree-dialects/BUILD.bazel index 4c7b0644e8f6..680c4b038013 100644 --- a/llvm-external-projects/iree-dialects/BUILD.bazel +++ b/llvm-external-projects/iree-dialects/BUILD.bazel @@ -30,7 +30,6 @@ filegroup( name = "TdFilegroup", srcs = glob([ "include/iree-dialects/Dialect/Input/*.td", - "include/iree-dialects/Dialect/VectorExt/IR/*.td", ]), ) @@ -39,7 +38,6 @@ td_library( srcs = glob([ "include/iree-dialects/Dialect/Input/*.td", "include/iree-dialects/Dialect/LinalgTransform/*.td", - "include/iree-dialects/Dialect/VectorExt/IR/*.td", "python/iree/compiler/dialects/*.td", ]), includes = ["include"], @@ -335,120 +333,6 @@ cc_library( ], ) -################################################################################ -# IREEVectorExt Dialect -################################################################################ - -gentbl_cc_library( - name = "IREEVectorExtIncGen", - strip_include_prefix = "include", - tbl_outs = [ - ( - [ - "--dialect=iree_vector_ext", - "--gen-dialect-decls", - ], - "include/iree-dialects/Dialect/VectorExt/IR/VectorExtDialect.h.inc", - ), - ( - [ - "--dialect=iree_vector_ext", - "--gen-dialect-defs", - ], - "include/iree-dialects/Dialect/VectorExt/IR/VectorExtDialect.cpp.inc", - ), - ( - ["--gen-op-decls"], - "include/iree-dialects/Dialect/VectorExt/IR/VectorExtOps.h.inc", - ), - ( - ["--gen-op-defs"], - "include/iree-dialects/Dialect/VectorExt/IR/VectorExtOps.cpp.inc", - ), - ( - ["--gen-typedef-decls"], - "include/iree-dialects/Dialect/VectorExt/IR/VectorExtTypes.h.inc", - ), - ( - ["--gen-typedef-defs"], - "include/iree-dialects/Dialect/VectorExt/IR/VectorExtTypes.cpp.inc", - ), - ], - tblgen = "@llvm-project//mlir:mlir-tblgen", - td_file = "include/iree-dialects/Dialect/VectorExt/IR/VectorExtOps.td", - deps = [ - ":TdFiles", - ], -) - -gentbl_cc_library( - name = "IREEVectorExtAttrsIncGen", - strip_include_prefix = "include", - tbl_outs = [ - ( - ["--gen-attrdef-decls"], - "include/iree-dialects/Dialect/VectorExt/IR/VectorExtAttrs.h.inc", - ), - ( - ["--gen-attrdef-defs"], - "include/iree-dialects/Dialect/VectorExt/IR/VectorExtAttrs.cpp.inc", - ), - ( - ["--gen-enum-decls"], - "include/iree-dialects/Dialect/VectorExt/IR/VectorExtEnums.h.inc", - ), - ( - ["--gen-enum-defs"], - "include/iree-dialects/Dialect/VectorExt/IR/VectorExtEnums.cpp.inc", - ), - ], - tblgen = "@llvm-project//mlir:mlir-tblgen", - td_file = "include/iree-dialects/Dialect/VectorExt/IR/VectorExtAttrs.td", - deps = [ - ":TdFiles", - ], -) - -gentbl_cc_library( - name = "IREEVectorExtInterfacesIncGen", - strip_include_prefix = "include", - tbl_outs = [ - ( - ["--gen-attr-interface-decls"], - "include/iree-dialects/Dialect/VectorExt/IR/VectorExtAttrInterfaces.h.inc", - ), - ( - ["--gen-attr-interface-defs"], - "include/iree-dialects/Dialect/VectorExt/IR/VectorExtAttrInterfaces.cpp.inc", - ), - ], - tblgen = "@llvm-project//mlir:mlir-tblgen", - td_file = "include/iree-dialects/Dialect/VectorExt/IR/VectorExtInterfaces.td", - deps = [ - ":TdFiles", - ], -) - -cc_library( - name = "IREEVectorExtDialect", - srcs = glob([ - "lib/Dialect/VectorExt/IR/*.cpp", - ]), - hdrs = glob([ - "include/iree-dialects/Dialect/VectorExt/IR/*.h", - ]), - includes = ["include"], - deps = [ - ":IREEVectorExtAttrsIncGen", - ":IREEVectorExtIncGen", - ":IREEVectorExtInterfacesIncGen", - "@llvm-project//llvm:Support", - "@llvm-project//mlir:AffineDialect", - "@llvm-project//mlir:DialectUtils", - "@llvm-project//mlir:IR", - ], -) - ################################################################################ # CAPI ################################################################################ @@ -483,7 +367,6 @@ cc_library( ":IREEDialectsTransforms", ":IREELinalgTransformDialect", ":IREELinalgTransformDialectPasses", - ":IREEVectorExtDialect", "@llvm-project//mlir:IR", "@llvm-project//mlir:Pass", "@llvm-project//mlir:Rewrite", @@ -507,7 +390,6 @@ cc_binary( ":IREEInputDialect", ":IREELinalgTransformDialect", ":IREELinalgTransformDialectPasses", - ":IREEVectorExtDialect", "@llvm-project//llvm:Support", "@llvm-project//mlir:AffineDialect", "@llvm-project//mlir:ArithDialect", diff --git a/llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/CMakeLists.txt b/llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/CMakeLists.txt index b83ada223fb0..306774b5da66 100644 --- a/llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/CMakeLists.txt +++ b/llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/CMakeLists.txt @@ -1,3 +1,2 @@ add_subdirectory(Input) add_subdirectory(LinalgTransform) -add_subdirectory(VectorExt) diff --git a/llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/VectorExt/CMakeLists.txt b/llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/VectorExt/CMakeLists.txt deleted file mode 100644 index f33061b2d87c..000000000000 --- a/llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/VectorExt/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(IR) diff --git a/llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/VectorExt/IR/CMakeLists.txt b/llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/VectorExt/IR/CMakeLists.txt deleted file mode 100644 index 1e0b7b60311d..000000000000 --- a/llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/VectorExt/IR/CMakeLists.txt +++ /dev/null @@ -1,48 +0,0 @@ -function(_add_interfaces) - set(LLVM_TARGET_DEFINITIONS VectorExtInterfaces.td) - mlir_tablegen(VectorExtAttrInterfaces.h.inc -gen-attr-interface-decls) - mlir_tablegen(VectorExtAttrInterfaces.cpp.inc -gen-attr-interface-defs) - add_public_tablegen_target(IREEVectorExtInterfacesIncGen) - add_dependencies(IREEVectorExtIncGen IREEVectorExtInterfacesIncGen) -endfunction() - -function(_add_dialect) - set(LLVM_TARGET_DEFINITIONS VectorExtOps.td) - mlir_tablegen(VectorExtOps.h.inc -gen-op-decls) - mlir_tablegen(VectorExtOps.cpp.inc -gen-op-defs) - mlir_tablegen(VectorExtTypes.h.inc -gen-typedef-decls) - mlir_tablegen(VectorExtTypes.cpp.inc -gen-typedef-defs) - mlir_tablegen(VectorExtDialect.h.inc --gen-dialect-decls --dialect=iree_vector_ext) - mlir_tablegen(VectorExtDialect.cpp.inc --gen-dialect-defs --dialect=iree_vector_ext) - add_public_tablegen_target(IREEVectorExtIncGen) - add_dependencies(mlir-headers IREEVectorExtIncGen) - - set(LLVM_TARGET_DEFINITIONS VectorExtAttrs.td) - mlir_tablegen(VectorExtAttrs.h.inc -gen-attrdef-decls) - mlir_tablegen(VectorExtAttrs.cpp.inc -gen-attrdef-defs) - mlir_tablegen(VectorExtEnums.h.inc -gen-enum-decls) - mlir_tablegen(VectorExtEnums.cpp.inc -gen-enum-defs) - add_public_tablegen_target(IREEVectorExtAttrsIncGen) - add_dependencies(mlir-headers IREEVectorExtAttrsIncGen) -endfunction() - -function(_add_doc) - set(LLVM_TARGET_DEFINITIONS VectorExtOps.td) - set(_FLAGS - "--strip-prefix=::mlir::iree_compiler::IREE::" - ) - mlir_tablegen(VectorExtOps.md -gen-dialect-doc ${_FLAGS}) - set(GEN_DOC_FILE ${IREE_DIALECTS_BINARY_DIR}/docs/Dialects/VectorExtOps.md) - add_custom_command( - OUTPUT ${GEN_DOC_FILE} - COMMAND ${CMAKE_COMMAND} -E copy - ${CMAKE_CURRENT_BINARY_DIR}/VectorExtOps.md - ${GEN_DOC_FILE} - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/VectorExtOps.md) - add_custom_target(VectorExtOpsDocGen DEPENDS ${GEN_DOC_FILE}) - add_dependencies(iree-dialects-doc VectorExtOpsDocGen) -endfunction() - -_add_dialect() -_add_interfaces() -_add_doc() diff --git a/llvm-external-projects/iree-dialects/lib/Dialect/CMakeLists.txt b/llvm-external-projects/iree-dialects/lib/Dialect/CMakeLists.txt index b83ada223fb0..306774b5da66 100644 --- a/llvm-external-projects/iree-dialects/lib/Dialect/CMakeLists.txt +++ b/llvm-external-projects/iree-dialects/lib/Dialect/CMakeLists.txt @@ -1,3 +1,2 @@ add_subdirectory(Input) add_subdirectory(LinalgTransform) -add_subdirectory(VectorExt) diff --git a/llvm-external-projects/iree-dialects/lib/Dialect/VectorExt/CMakeLists.txt b/llvm-external-projects/iree-dialects/lib/Dialect/VectorExt/CMakeLists.txt deleted file mode 100644 index f33061b2d87c..000000000000 --- a/llvm-external-projects/iree-dialects/lib/Dialect/VectorExt/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(IR) diff --git a/llvm-external-projects/iree-dialects/lib/Dialect/VectorExt/IR/CMakeLists.txt b/llvm-external-projects/iree-dialects/lib/Dialect/VectorExt/IR/CMakeLists.txt deleted file mode 100644 index 82d810b512df..000000000000 --- a/llvm-external-projects/iree-dialects/lib/Dialect/VectorExt/IR/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -add_mlir_library(IREEVectorExtDialect - VectorExtAttrs.cpp - VectorExtDialect.cpp - VectorExtOps.cpp - - ADDITIONAL_HEADER_DIRS - ${IREE_DIALECTS_SOURCE_DIR}/include - - DEPENDS - IREEVectorExtAttrsIncGen - IREEVectorExtIncGen - - LINK_LIBS PUBLIC - MLIRIR - MLIRAffineDialect -) - -iree_dialects_target_includes(IREEVectorExtDialect) diff --git a/llvm-external-projects/iree-dialects/test/CMakeLists.txt b/llvm-external-projects/iree-dialects/test/CMakeLists.txt index 78f940f7aa25..cdff1035c02f 100644 --- a/llvm-external-projects/iree-dialects/test/CMakeLists.txt +++ b/llvm-external-projects/iree-dialects/test/CMakeLists.txt @@ -27,5 +27,3 @@ add_lit_testsuite(check-iree-dialects "Running the iree-dialects regression test set_target_properties(check-iree-dialects PROPERTIES FOLDER "Tests") add_lit_testsuites(IREE_DIALECTS ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS ${IREE_DIALECTS_TEST_DEPENDS}) - -add_subdirectory(lib) diff --git a/llvm-external-projects/iree-dialects/test/Dialect/iree_vector_ext/iterators.mlir b/llvm-external-projects/iree-dialects/test/Dialect/iree_vector_ext/iterators.mlir deleted file mode 100644 index 08166a0ca41c..000000000000 --- a/llvm-external-projects/iree-dialects/test/Dialect/iree_vector_ext/iterators.mlir +++ /dev/null @@ -1,55 +0,0 @@ -// RUN: iree-dialects-opt --split-input-file --test-vector-ext-iterators %s | FileCheck %s - -// CHECK: VECTORY:0, BATCHX:0, VECTORX:0, BATCHY:0, -// CHECK: VECTORY:1, BATCHX:0, VECTORX:0, BATCHY:0, -// CHECK: VECTORY:0, BATCHX:1, VECTORX:0, BATCHY:0, -// CHECK: VECTORY:1, BATCHX:1, VECTORX:0, BATCHY:0, -// CHECK: VECTORY:0, BATCHX:0, VECTORX:1, BATCHY:0, -// CHECK: VECTORY:1, BATCHX:0, VECTORX:1, BATCHY:0, -// CHECK: VECTORY:0, BATCHX:1, VECTORX:1, BATCHY:0, -// CHECK: VECTORY:1, BATCHX:1, VECTORX:1, BATCHY:0, -// CHECK: VECTORY:0, BATCHX:0, VECTORX:0, BATCHY:1, -// CHECK: VECTORY:1, BATCHX:0, VECTORX:0, BATCHY:1, -// CHECK: VECTORY:0, BATCHX:1, VECTORX:0, BATCHY:1, -// CHECK: VECTORY:1, BATCHX:1, VECTORX:0, BATCHY:1, -// CHECK: VECTORY:0, BATCHX:0, VECTORX:1, BATCHY:1, -// CHECK: VECTORY:1, BATCHX:0, VECTORX:1, BATCHY:1, -// CHECK: VECTORY:0, BATCHX:1, VECTORX:1, BATCHY:1, -// CHECK: VECTORY:1, BATCHX:1, VECTORX:1, BATCHY:1, -#row_layout1 = #iree_vector_ext.per_dim_layout<[BATCHX, LANEX, VECTORY], [2, 1, 2]> -#col_layout1 = #iree_vector_ext.per_dim_layout<[BATCHY, LANEY, VECTORX], [2, 1, 2]> -#layout1 = #iree_vector_ext.layout<#row_layout1, #col_layout1> -func.func @iterator_test(%lhs: memref<4x4xf16>) -> vector<4x4xf16> { - %cst_0 = arith.constant 0.0 : f16 - %c0 = arith.constant 0 : index - %result = vector.transfer_read %lhs[%c0, %c0], %cst_0 {in_bounds = [true, true], __test_iterator_layout__ = #layout1} : memref<4x4xf16>, vector<4x4xf16> - return %result : vector<4x4xf16> -} - -// ----- - -// CHECK: VECTORY:0, BATCHX:0, VECTORX:0, BATCHY:0, VECTORZ:0, -// CHECK: VECTORY:1, BATCHX:0, VECTORX:0, BATCHY:0, VECTORZ:0, -// CHECK: VECTORY:0, BATCHX:1, VECTORX:0, BATCHY:0, VECTORZ:0, -// CHECK: VECTORY:1, BATCHX:1, VECTORX:0, BATCHY:0, VECTORZ:0, -// CHECK: VECTORY:0, BATCHX:0, VECTORX:1, BATCHY:0, VECTORZ:0, -// CHECK: VECTORY:1, BATCHX:0, VECTORX:1, BATCHY:0, VECTORZ:0, -// CHECK: VECTORY:0, BATCHX:1, VECTORX:1, BATCHY:0, VECTORZ:0, -// CHECK: VECTORY:1, BATCHX:1, VECTORX:1, BATCHY:0, VECTORZ:0, -// CHECK: VECTORY:0, BATCHX:0, VECTORX:0, BATCHY:1, VECTORZ:0, -// CHECK: VECTORY:1, BATCHX:0, VECTORX:0, BATCHY:1, VECTORZ:0, -// CHECK: VECTORY:0, BATCHX:1, VECTORX:0, BATCHY:1, VECTORZ:0, -// CHECK: VECTORY:1, BATCHX:1, VECTORX:0, BATCHY:1, VECTORZ:0, -// CHECK: VECTORY:0, BATCHX:0, VECTORX:1, BATCHY:1, VECTORZ:0, -// CHECK: VECTORY:1, BATCHX:0, VECTORX:1, BATCHY:1, VECTORZ:0, -// CHECK: VECTORY:0, BATCHX:1, VECTORX:1, BATCHY:1, VECTORZ:0, -// CHECK: VECTORY:1, BATCHX:1, VECTORX:1, BATCHY:1, VECTORZ:0, -#row_layout1 = #iree_vector_ext.per_dim_layout<[BATCHX, LANEX, VECTORY], [2, 1, 2]> -#col_layout1 = #iree_vector_ext.per_dim_layout<[BATCHY, LANEY, VECTORX], [2, 1, 2]> -#layout1 = #iree_vector_ext.layout<#row_layout1, #col_layout1> -func.func @frozen_iterator_test(%lhs: memref<4x4xf16>) -> vector<4x4xf16> { - %cst_0 = arith.constant 0.0 : f16 - %c0 = arith.constant 0 : index - %result = vector.transfer_read %lhs[%c0, %c0], %cst_0 {in_bounds = [true, true], __test_frozen_iterator_layout__ = #layout1} : memref<4x4xf16>, vector<4x4xf16> - return %result : vector<4x4xf16> -} diff --git a/llvm-external-projects/iree-dialects/test/lib/CMakeLists.txt b/llvm-external-projects/iree-dialects/test/lib/CMakeLists.txt deleted file mode 100644 index 87b979cd5b30..000000000000 --- a/llvm-external-projects/iree-dialects/test/lib/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(VectorExt) diff --git a/llvm-external-projects/iree-dialects/test/lib/VectorExt/CMakeLists.txt b/llvm-external-projects/iree-dialects/test/lib/VectorExt/CMakeLists.txt deleted file mode 100644 index 1950acc25ce8..000000000000 --- a/llvm-external-projects/iree-dialects/test/lib/VectorExt/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -add_mlir_library(IREEVectorExtTestPasses - TestIterators.cpp - - DEPENDS - mlir-headers - - EXCLUDE_FROM_LIBMLIR - - LINK_LIBS PUBLIC - IREEVectorExtDialect - MLIRPass - ) diff --git a/llvm-external-projects/iree-dialects/test/lib/VectorExt/TestIterators.cpp b/llvm-external-projects/iree-dialects/test/lib/VectorExt/TestIterators.cpp deleted file mode 100644 index 5aacc9ed7982..000000000000 --- a/llvm-external-projects/iree-dialects/test/lib/VectorExt/TestIterators.cpp +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2023 The IREE Authors -// -// Licensed under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtDialect.h" -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtOps.h" -#include "mlir/Pass/Pass.h" -#include "mlir/Transforms/GreedyPatternRewriteDriver.h" - -using namespace mlir; -using namespace mlir::iree_compiler::IREE::VectorExt; - -namespace { - -static const StringRef kIteratorMarker = "__test_iterator_layout__"; -static const StringRef kFrozenIteratorMarker = - "__test_frozen_iterator_layout__"; - -struct TestVectorExtIteratorPass - : public PassWrapper { - MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(TestVectorExtIteratorPass) - TestVectorExtIteratorPass() = default; - TestVectorExtIteratorPass(const TestVectorExtIteratorPass &other) - : PassWrapper(other) {} - StringRef getArgument() const final { return "test-vector-ext-iterators"; } - StringRef getDescription() const final { - return "Test VectorExt Iterator pass."; - } - bool canScheduleOn(RegisteredOperationName opName) const override { - return true; - } - // Prints the layout so that LIT can test it for correctness. - static void printFn(const LayoutIterator::State &state) { - for (const auto &[dim, it] : state.iterators) { - llvm::outs() << stringifyLayoutDimension(dim).str() + ":" + - std::to_string(*it) + ", "; - } - llvm::outs() << "\n"; - } - void testIterator(Operation *op) { - auto layout = dyn_cast_or_null(op->getAttr(kIteratorMarker)); - DenseMap strides; - LayoutIterator iterator(layout, strides); - iterator.apply(printFn); - } - LayoutDimensionAttr createLayoutDimensionAttr(MLIRContext *ctx, - LayoutDimension dim) { - return LayoutDimensionAttr::get(ctx, dim); - } - LayoutIterator - createFrozenIterator(MLIRContext *ctx, - DenseMap &strides) { - SmallVector labels{ - createLayoutDimensionAttr(ctx, LayoutDimension::VECTORZ), - createLayoutDimensionAttr(ctx, LayoutDimension::VECTORX)}; - auto newLayout = - LayoutAttr::get(ctx, {PerDimLayoutAttr::get(ctx, labels[0], {1}), - PerDimLayoutAttr::get(ctx, labels[1], {1})}); - return LayoutIterator(newLayout, strides); - } - void testFrozenIterator(Operation *op) { - auto layout = - dyn_cast_or_null(op->getAttr(kFrozenIteratorMarker)); - DenseMap strides; - LayoutIterator iterator(layout, strides); - auto frozenIterator = createFrozenIterator(op->getContext(), strides); - iterator.maybeFreezeAndConcatenate(frozenIterator.getState()); - iterator.apply(printFn); - } - void runOnOperation() override { - getOperation()->walk([&](Operation *op) { - if (op->hasAttr(kIteratorMarker)) { - return testIterator(op); - } - if (op->hasAttr(kFrozenIteratorMarker)) { - return testFrozenIterator(op); - } - }); - } -}; - -} // namespace - -namespace mlir::test_ext { -void registerVectorExtTestPasses() { - PassRegistration(); -} -} // namespace mlir::test_ext diff --git a/llvm-external-projects/iree-dialects/tools/iree-dialects-opt/CMakeLists.txt b/llvm-external-projects/iree-dialects/tools/iree-dialects-opt/CMakeLists.txt index c8e9f8c84942..6515519f38c4 100644 --- a/llvm-external-projects/iree-dialects/tools/iree-dialects-opt/CMakeLists.txt +++ b/llvm-external-projects/iree-dialects/tools/iree-dialects-opt/CMakeLists.txt @@ -3,8 +3,6 @@ set(LIBS IREEInputDialect IREELinalgTransformDialect IREELinalgTransformDialectPasses - IREEVectorExtDialect - IREEVectorExtTestPasses # Core dialects. MLIRAffineDialect MLIRArithDialect diff --git a/llvm-external-projects/iree-dialects/tools/iree-dialects-opt/iree-dialects-opt.cpp b/llvm-external-projects/iree-dialects/tools/iree-dialects-opt/iree-dialects-opt.cpp index a125c4353edb..885d5839cb48 100644 --- a/llvm-external-projects/iree-dialects/tools/iree-dialects-opt/iree-dialects-opt.cpp +++ b/llvm-external-projects/iree-dialects/tools/iree-dialects-opt/iree-dialects-opt.cpp @@ -7,7 +7,6 @@ #include "iree-dialects/Dialect/Input/InputDialect.h" #include "iree-dialects/Dialect/LinalgTransform/Passes.h" #include "iree-dialects/Dialect/LinalgTransform/StructuredTransformOpsExt.h" -#include "iree-dialects/Dialect/VectorExt/IR/VectorExtDialect.h" #include "mlir/Dialect/Affine/IR/AffineOps.h" #include "mlir/Dialect/Arith/IR/Arith.h" #include "mlir/Dialect/Async/IR/Async.h" @@ -40,13 +39,6 @@ using namespace mlir; namespace IREE = mlir::iree_compiler::IREE; -namespace mlir { -namespace test_ext { -/// Test passes, do not deserve an include. -void registerVectorExtTestPasses(); -} // namespace test_ext -} // namespace mlir - int main(int argc, char **argv) { registerAsmPrinterCLOptions(); registerMLIRContextCLOptions(); @@ -56,7 +48,6 @@ int main(int argc, char **argv) { // clang-format off // Local dialects mlir::iree_compiler::IREE::Input::IREEInputDialect, - mlir::iree_compiler::IREE::VectorExt::IREEVectorExtDialect, // Upstream dialects mlir::async::AsyncDialect, mlir::arith::ArithDialect, @@ -80,8 +71,6 @@ int main(int argc, char **argv) { registerSCFPasses(); // Local dialect passes. mlir::linalg::transform::registerDropSchedulePass(); - // Local test passes. - mlir::test_ext::registerVectorExtTestPasses(); // External models. mlir::func::registerInlinerExtension(registry);