[Mlir-commits] [mlir] Reapply "[mlir] NFC: fix dependence of (Tensor|Linalg|MemRef|Complex) dialects on LLVM Dialect and LLVM Core in CMake build (#104832)" (PR #105703)
Christopher Bate
llvmlistbot at llvm.org
Thu Aug 22 10:26:25 PDT 2024
https://github.com/christopherbate created https://github.com/llvm/llvm-project/pull/105703
Reapply the commit with additional fixes for building with
BUILD_SHARED_LIBS=ON.
>From 6774cac1e30070b3614315da8a49a078cfe457af Mon Sep 17 00:00:00 2001
From: Christopher Bate <cbate at nvidia.com>
Date: Tue, 20 Aug 2024 15:28:22 +0000
Subject: [PATCH] Reapply "[mlir] NFC: fix dependence of
(Tensor|Linalg|MemRef|Complex) dialects on LLVM Dialect and LLVM Core in
CMake build (#104832)"
Reapply the commit with additional fixes for building with
BUILD_SHARED_LIBS=ON.
---
mlir/lib/Conversion/AffineToStandard/CMakeLists.txt | 3 ---
mlir/lib/Conversion/ComplexToLLVM/CMakeLists.txt | 1 +
mlir/lib/Conversion/ControlFlowToSCF/CMakeLists.txt | 6 +-----
mlir/lib/Conversion/ControlFlowToSCF/ControlFlowToSCF.cpp | 1 -
mlir/lib/Conversion/SCFToControlFlow/CMakeLists.txt | 5 +----
mlir/lib/Conversion/SCFToControlFlow/SCFToControlFlow.cpp | 5 ++---
mlir/lib/Conversion/VectorToLLVM/CMakeLists.txt | 5 +++--
mlir/lib/Conversion/VectorToSCF/CMakeLists.txt | 4 ----
mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt | 1 -
mlir/lib/Dialect/Complex/IR/CMakeLists.txt | 1 -
mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt | 2 --
mlir/lib/Dialect/MemRef/IR/CMakeLists.txt | 3 ---
mlir/lib/Dialect/MemRef/TransformOps/CMakeLists.txt | 1 +
mlir/lib/Dialect/MemRef/Transforms/CMakeLists.txt | 3 ++-
mlir/lib/Dialect/SparseTensor/Transforms/CMakeLists.txt | 1 +
mlir/lib/Dialect/Tensor/IR/CMakeLists.txt | 3 ---
16 files changed, 12 insertions(+), 33 deletions(-)
diff --git a/mlir/lib/Conversion/AffineToStandard/CMakeLists.txt b/mlir/lib/Conversion/AffineToStandard/CMakeLists.txt
index f41e3ca27ee4dd..cd8193aee8da32 100644
--- a/mlir/lib/Conversion/AffineToStandard/CMakeLists.txt
+++ b/mlir/lib/Conversion/AffineToStandard/CMakeLists.txt
@@ -7,9 +7,6 @@ add_mlir_conversion_library(MLIRAffineToStandard
DEPENDS
MLIRConversionPassIncGen
- LINK_COMPONENTS
- Core
-
LINK_LIBS PUBLIC
MLIRAffineDialect
MLIRAffineTransforms
diff --git a/mlir/lib/Conversion/ComplexToLLVM/CMakeLists.txt b/mlir/lib/Conversion/ComplexToLLVM/CMakeLists.txt
index b6fae75c15b956..d3a5bf2aa2f05b 100644
--- a/mlir/lib/Conversion/ComplexToLLVM/CMakeLists.txt
+++ b/mlir/lib/Conversion/ComplexToLLVM/CMakeLists.txt
@@ -11,6 +11,7 @@ add_mlir_conversion_library(MLIRComplexToLLVM
Core
LINK_LIBS PUBLIC
+ MLIRArithAttrToLLVMConversion
MLIRComplexDialect
MLIRLLVMCommonConversion
MLIRLLVMDialect
diff --git a/mlir/lib/Conversion/ControlFlowToSCF/CMakeLists.txt b/mlir/lib/Conversion/ControlFlowToSCF/CMakeLists.txt
index 679eca3dfa988c..e7024dfbd5ee32 100644
--- a/mlir/lib/Conversion/ControlFlowToSCF/CMakeLists.txt
+++ b/mlir/lib/Conversion/ControlFlowToSCF/CMakeLists.txt
@@ -5,11 +5,7 @@ add_mlir_conversion_library(MLIRControlFlowToSCF
${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/ControlFlowToSCF
DEPENDS
- MLIRConversionPassIncGen
- intrinsics_gen
-
- LINK_COMPONENTS
- Core
+ MLIRConversionPassIncGen
LINK_LIBS PUBLIC
MLIRAnalysis
diff --git a/mlir/lib/Conversion/ControlFlowToSCF/ControlFlowToSCF.cpp b/mlir/lib/Conversion/ControlFlowToSCF/ControlFlowToSCF.cpp
index d3ee89743da9db..1c592d665f3e4c 100644
--- a/mlir/lib/Conversion/ControlFlowToSCF/ControlFlowToSCF.cpp
+++ b/mlir/lib/Conversion/ControlFlowToSCF/ControlFlowToSCF.cpp
@@ -16,7 +16,6 @@
#include "mlir/Dialect/ControlFlow/IR/ControlFlow.h"
#include "mlir/Dialect/ControlFlow/IR/ControlFlowOps.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
-#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/Dialect/SCF/IR/SCF.h"
#include "mlir/Dialect/UB/IR/UBOps.h"
#include "mlir/Pass/Pass.h"
diff --git a/mlir/lib/Conversion/SCFToControlFlow/CMakeLists.txt b/mlir/lib/Conversion/SCFToControlFlow/CMakeLists.txt
index 63c5199af9290c..ff64b8fcca0830 100644
--- a/mlir/lib/Conversion/SCFToControlFlow/CMakeLists.txt
+++ b/mlir/lib/Conversion/SCFToControlFlow/CMakeLists.txt
@@ -5,10 +5,7 @@ add_mlir_conversion_library(MLIRSCFToControlFlow
${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/SCFToControlFlow
DEPENDS
- MLIRConversionPassIncGen
-
- LINK_COMPONENTS
- Core
+ MLIRConversionPassIncGen
LINK_LIBS PUBLIC
MLIRArithDialect
diff --git a/mlir/lib/Conversion/SCFToControlFlow/SCFToControlFlow.cpp b/mlir/lib/Conversion/SCFToControlFlow/SCFToControlFlow.cpp
index 2372ab5b82a772..cef96c206dda5c 100644
--- a/mlir/lib/Conversion/SCFToControlFlow/SCFToControlFlow.cpp
+++ b/mlir/lib/Conversion/SCFToControlFlow/SCFToControlFlow.cpp
@@ -15,7 +15,6 @@
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/ControlFlow/IR/ControlFlowOps.h"
-#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/Dialect/SCF/IR/SCF.h"
#include "mlir/Dialect/SCF/Transforms/Transforms.h"
#include "mlir/IR/Builders.h"
@@ -379,8 +378,8 @@ LogicalResult ForLowering::matchAndRewrite(ForOp forOp,
// llvm.loop_annotation attribute.
SmallVector<NamedAttribute> llvmAttrs;
llvm::copy_if(forOp->getAttrs(), std::back_inserter(llvmAttrs),
- [](auto attr) {
- return isa<LLVM::LLVMDialect>(attr.getValue().getDialect());
+ [](NamedAttribute attr) {
+ return attr.getValue().getDialect().getNamespace() == "llvm";
});
condBranchOp->setDiscardableAttrs(llvmAttrs);
// The result of the loop operation is the values of the condition block
diff --git a/mlir/lib/Conversion/VectorToLLVM/CMakeLists.txt b/mlir/lib/Conversion/VectorToLLVM/CMakeLists.txt
index a0fce139f27466..925e12fafa2836 100644
--- a/mlir/lib/Conversion/VectorToLLVM/CMakeLists.txt
+++ b/mlir/lib/Conversion/VectorToLLVM/CMakeLists.txt
@@ -13,10 +13,11 @@ add_mlir_conversion_library(MLIRVectorToLLVM
Core
LINK_LIBS PUBLIC
- MLIRArithDialect
+ MLIRArithAttrToLLVMConversion
+ MLIRArithDialect
MLIRLLVMCommonConversion
MLIRLLVMDialect
- MLIRMemRefDialect
+ MLIRMemRefDialect
MLIRTargetLLVMIRExport
MLIRTransforms
MLIRVectorDialect
diff --git a/mlir/lib/Conversion/VectorToSCF/CMakeLists.txt b/mlir/lib/Conversion/VectorToSCF/CMakeLists.txt
index 83bbc4a4bc395a..0915270e453dfd 100644
--- a/mlir/lib/Conversion/VectorToSCF/CMakeLists.txt
+++ b/mlir/lib/Conversion/VectorToSCF/CMakeLists.txt
@@ -4,12 +4,8 @@ add_mlir_conversion_library(MLIRVectorToSCF
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/VectorToSCF
- LINK_COMPONENTS
- Core
-
LINK_LIBS PUBLIC
MLIRArithDialect
- MLIRLLVMDialect
MLIRMemRefDialect
MLIRTransforms
MLIRVectorDialect
diff --git a/mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt
index 60d14a373348d3..772f15335d907f 100644
--- a/mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt
@@ -39,6 +39,5 @@ add_mlir_dialect_library(MLIRAffineTransforms
MLIRValueBoundsOpInterface
MLIRVectorDialect
MLIRVectorUtils
- MLIRVectorToLLVM
)
diff --git a/mlir/lib/Dialect/Complex/IR/CMakeLists.txt b/mlir/lib/Dialect/Complex/IR/CMakeLists.txt
index 3ee0d26f3225f7..a90f34ec1684d9 100644
--- a/mlir/lib/Dialect/Complex/IR/CMakeLists.txt
+++ b/mlir/lib/Dialect/Complex/IR/CMakeLists.txt
@@ -10,7 +10,6 @@ add_mlir_dialect_library(MLIRComplexDialect
MLIRComplexAttributesIncGen
LINK_LIBS PUBLIC
- MLIRArithAttrToLLVMConversion
MLIRArithDialect
MLIRDialect
MLIRInferTypeOpInterface
diff --git a/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt
index a7dcc29b5b9be1..47af392def94ac 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt
@@ -60,7 +60,6 @@ add_mlir_dialect_library(MLIRLinalgTransforms
MLIRDestinationStyleOpInterface
MLIRDialectUtils
MLIRFuncDialect
- MLIRFuncToLLVM
MLIRFuncTransforms
MLIRIndexDialect
MLIRInferTypeOpInterface
@@ -87,6 +86,5 @@ add_mlir_dialect_library(MLIRLinalgTransforms
MLIRVectorDialect
MLIRVectorTransforms
MLIRVectorUtils
- MLIRX86VectorTransforms
MLIRVectorToSCF
)
diff --git a/mlir/lib/Dialect/MemRef/IR/CMakeLists.txt b/mlir/lib/Dialect/MemRef/IR/CMakeLists.txt
index fd2fed28badd63..845914ebd107a2 100644
--- a/mlir/lib/Dialect/MemRef/IR/CMakeLists.txt
+++ b/mlir/lib/Dialect/MemRef/IR/CMakeLists.txt
@@ -10,9 +10,6 @@ add_mlir_dialect_library(MLIRMemRefDialect
DEPENDS
MLIRMemRefOpsIncGen
- LINK_COMPONENTS
- Core
-
LINK_LIBS PUBLIC
MLIRArithDialect
MLIRArithUtils
diff --git a/mlir/lib/Dialect/MemRef/TransformOps/CMakeLists.txt b/mlir/lib/Dialect/MemRef/TransformOps/CMakeLists.txt
index e379663f3b0a01..4c9e3d3c813f7a 100644
--- a/mlir/lib/Dialect/MemRef/TransformOps/CMakeLists.txt
+++ b/mlir/lib/Dialect/MemRef/TransformOps/CMakeLists.txt
@@ -19,4 +19,5 @@ add_mlir_dialect_library(MLIRMemRefTransformOps
MLIRNVGPUDialect
MLIRTransformDialect
MLIRVectorDialect
+ MLIRVectorTransforms
)
diff --git a/mlir/lib/Dialect/MemRef/Transforms/CMakeLists.txt b/mlir/lib/Dialect/MemRef/Transforms/CMakeLists.txt
index f150ac7ac2d634..01bec09f1f21f5 100644
--- a/mlir/lib/Dialect/MemRef/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/MemRef/Transforms/CMakeLists.txt
@@ -35,11 +35,12 @@ add_mlir_dialect_library(MLIRMemRefTransforms
MLIRInferTypeOpInterface
MLIRLoopLikeInterface
MLIRMemRefDialect
+ MLIRMemRefUtils
MLIRNVGPUDialect
MLIRPass
MLIRTensorDialect
MLIRTransforms
MLIRValueBoundsOpInterface
- MLIRVectorDialect
+ MLIRVectorDialect
)
diff --git a/mlir/lib/Dialect/SparseTensor/Transforms/CMakeLists.txt b/mlir/lib/Dialect/SparseTensor/Transforms/CMakeLists.txt
index e4acfa8889e5f8..43e5c3251c5258 100644
--- a/mlir/lib/Dialect/SparseTensor/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/SparseTensor/Transforms/CMakeLists.txt
@@ -40,6 +40,7 @@ add_mlir_dialect_library(MLIRSparseTensorTransforms
MLIRLLVMDialect
MLIRLinalgDialect
MLIRLinalgTransforms
+ MLIRLLVMCommonConversion
MLIRMemRefDialect
MLIRPass
MLIRSCFDialect
diff --git a/mlir/lib/Dialect/Tensor/IR/CMakeLists.txt b/mlir/lib/Dialect/Tensor/IR/CMakeLists.txt
index 549b9f10388bd4..cfdd3847761a49 100644
--- a/mlir/lib/Dialect/Tensor/IR/CMakeLists.txt
+++ b/mlir/lib/Dialect/Tensor/IR/CMakeLists.txt
@@ -17,9 +17,6 @@ add_mlir_dialect_library(MLIRTensorDialect
DEPENDS
MLIRTensorOpsIncGen
- LINK_COMPONENTS
- Core
-
LINK_LIBS PUBLIC
MLIRAffineDialect
MLIRArithDialect
More information about the Mlir-commits
mailing list