Skip to content

Commit 06fd808

Browse files
Revert "[mlir] NFC: fix dependence of (Tensor|Linalg|MemRef|Complex) dialects on LLVM Dialect and LLVM Core in CMake build (#104832)"
This reverts commit 43b5085 since it caused the build to break with BUILD_SHARED_LIBS=ON.
1 parent 52bfb26 commit 06fd808

File tree

12 files changed

+30
-5
lines changed

12 files changed

+30
-5
lines changed

mlir/lib/Conversion/AffineToStandard/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ add_mlir_conversion_library(MLIRAffineToStandard
77
DEPENDS
88
MLIRConversionPassIncGen
99

10+
LINK_COMPONENTS
11+
Core
12+
1013
LINK_LIBS PUBLIC
1114
MLIRAffineDialect
1215
MLIRAffineTransforms

mlir/lib/Conversion/ControlFlowToSCF/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ add_mlir_conversion_library(MLIRControlFlowToSCF
55
${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/ControlFlowToSCF
66

77
DEPENDS
8-
MLIRConversionPassIncGen
8+
MLIRConversionPassIncGen
9+
intrinsics_gen
10+
11+
LINK_COMPONENTS
12+
Core
913

1014
LINK_LIBS PUBLIC
1115
MLIRAnalysis

mlir/lib/Conversion/ControlFlowToSCF/ControlFlowToSCF.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "mlir/Dialect/ControlFlow/IR/ControlFlow.h"
1717
#include "mlir/Dialect/ControlFlow/IR/ControlFlowOps.h"
1818
#include "mlir/Dialect/Func/IR/FuncOps.h"
19+
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
1920
#include "mlir/Dialect/SCF/IR/SCF.h"
2021
#include "mlir/Dialect/UB/IR/UBOps.h"
2122
#include "mlir/Pass/Pass.h"

mlir/lib/Conversion/SCFToControlFlow/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ add_mlir_conversion_library(MLIRSCFToControlFlow
55
${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/SCFToControlFlow
66

77
DEPENDS
8-
MLIRConversionPassIncGen
8+
MLIRConversionPassIncGen
9+
10+
LINK_COMPONENTS
11+
Core
912

1013
LINK_LIBS PUBLIC
1114
MLIRArithDialect

mlir/lib/Conversion/SCFToControlFlow/SCFToControlFlow.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#include "mlir/Dialect/Arith/IR/Arith.h"
1717
#include "mlir/Dialect/ControlFlow/IR/ControlFlowOps.h"
18+
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
1819
#include "mlir/Dialect/SCF/IR/SCF.h"
1920
#include "mlir/Dialect/SCF/Transforms/Transforms.h"
2021
#include "mlir/IR/Builders.h"
@@ -378,8 +379,8 @@ LogicalResult ForLowering::matchAndRewrite(ForOp forOp,
378379
// llvm.loop_annotation attribute.
379380
SmallVector<NamedAttribute> llvmAttrs;
380381
llvm::copy_if(forOp->getAttrs(), std::back_inserter(llvmAttrs),
381-
[](NamedAttribute attr) {
382-
return attr.getValue().getDialect().getNamespace() == "llvm";
382+
[](auto attr) {
383+
return isa<LLVM::LLVMDialect>(attr.getValue().getDialect());
383384
});
384385
condBranchOp->setDiscardableAttrs(llvmAttrs);
385386
// The result of the loop operation is the values of the condition block

mlir/lib/Conversion/VectorToSCF/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ add_mlir_conversion_library(MLIRVectorToSCF
44
ADDITIONAL_HEADER_DIRS
55
${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/VectorToSCF
66

7+
LINK_COMPONENTS
8+
Core
9+
710
LINK_LIBS PUBLIC
811
MLIRArithDialect
12+
MLIRLLVMDialect
913
MLIRMemRefDialect
1014
MLIRTransforms
1115
MLIRVectorDialect

mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,6 @@ add_mlir_dialect_library(MLIRAffineTransforms
3939
MLIRValueBoundsOpInterface
4040
MLIRVectorDialect
4141
MLIRVectorUtils
42+
MLIRVectorToLLVM
4243
)
4344

mlir/lib/Dialect/Complex/IR/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ add_mlir_dialect_library(MLIRComplexDialect
1010
MLIRComplexAttributesIncGen
1111

1212
LINK_LIBS PUBLIC
13+
MLIRArithAttrToLLVMConversion
1314
MLIRArithDialect
1415
MLIRDialect
1516
MLIRInferTypeOpInterface

mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ add_mlir_dialect_library(MLIRLinalgTransforms
6060
MLIRDestinationStyleOpInterface
6161
MLIRDialectUtils
6262
MLIRFuncDialect
63+
MLIRFuncToLLVM
6364
MLIRFuncTransforms
6465
MLIRIndexDialect
6566
MLIRInferTypeOpInterface
@@ -86,5 +87,6 @@ add_mlir_dialect_library(MLIRLinalgTransforms
8687
MLIRVectorDialect
8788
MLIRVectorTransforms
8889
MLIRVectorUtils
90+
MLIRX86VectorTransforms
8991
MLIRVectorToSCF
9092
)

mlir/lib/Dialect/MemRef/IR/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ add_mlir_dialect_library(MLIRMemRefDialect
1010
DEPENDS
1111
MLIRMemRefOpsIncGen
1212

13+
LINK_COMPONENTS
14+
Core
15+
1316
LINK_LIBS PUBLIC
1417
MLIRArithDialect
1518
MLIRArithUtils

mlir/lib/Dialect/MemRef/TransformOps/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,4 @@ add_mlir_dialect_library(MLIRMemRefTransformOps
1919
MLIRNVGPUDialect
2020
MLIRTransformDialect
2121
MLIRVectorDialect
22-
MLIRVectorTransforms
2322
)

mlir/lib/Dialect/Tensor/IR/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ add_mlir_dialect_library(MLIRTensorDialect
1717
DEPENDS
1818
MLIRTensorOpsIncGen
1919

20+
LINK_COMPONENTS
21+
Core
22+
2023
LINK_LIBS PUBLIC
2124
MLIRAffineDialect
2225
MLIRArithDialect

0 commit comments

Comments
 (0)