Skip to content

Commit

Permalink
Revert "[mlir] NFC: fix dependence of (Tensor|Linalg|MemRef|Complex) …
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
christopherbate committed Aug 20, 2024
1 parent 52bfb26 commit 06fd808
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 5 deletions.
3 changes: 3 additions & 0 deletions mlir/lib/Conversion/AffineToStandard/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ add_mlir_conversion_library(MLIRAffineToStandard
DEPENDS
MLIRConversionPassIncGen

LINK_COMPONENTS
Core

LINK_LIBS PUBLIC
MLIRAffineDialect
MLIRAffineTransforms
Expand Down
6 changes: 5 additions & 1 deletion mlir/lib/Conversion/ControlFlowToSCF/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ add_mlir_conversion_library(MLIRControlFlowToSCF
${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/ControlFlowToSCF

DEPENDS
MLIRConversionPassIncGen
MLIRConversionPassIncGen
intrinsics_gen

LINK_COMPONENTS
Core

LINK_LIBS PUBLIC
MLIRAnalysis
Expand Down
1 change: 1 addition & 0 deletions mlir/lib/Conversion/ControlFlowToSCF/ControlFlowToSCF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#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"
Expand Down
5 changes: 4 additions & 1 deletion mlir/lib/Conversion/SCFToControlFlow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ add_mlir_conversion_library(MLIRSCFToControlFlow
${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/SCFToControlFlow

DEPENDS
MLIRConversionPassIncGen
MLIRConversionPassIncGen

LINK_COMPONENTS
Core

LINK_LIBS PUBLIC
MLIRArithDialect
Expand Down
5 changes: 3 additions & 2 deletions mlir/lib/Conversion/SCFToControlFlow/SCFToControlFlow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

#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"
Expand Down Expand Up @@ -378,8 +379,8 @@ LogicalResult ForLowering::matchAndRewrite(ForOp forOp,
// llvm.loop_annotation attribute.
SmallVector<NamedAttribute> llvmAttrs;
llvm::copy_if(forOp->getAttrs(), std::back_inserter(llvmAttrs),
[](NamedAttribute attr) {
return attr.getValue().getDialect().getNamespace() == "llvm";
[](auto attr) {
return isa<LLVM::LLVMDialect>(attr.getValue().getDialect());
});
condBranchOp->setDiscardableAttrs(llvmAttrs);
// The result of the loop operation is the values of the condition block
Expand Down
4 changes: 4 additions & 0 deletions mlir/lib/Conversion/VectorToSCF/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ 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
Expand Down
1 change: 1 addition & 0 deletions mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@ add_mlir_dialect_library(MLIRAffineTransforms
MLIRValueBoundsOpInterface
MLIRVectorDialect
MLIRVectorUtils
MLIRVectorToLLVM
)

1 change: 1 addition & 0 deletions mlir/lib/Dialect/Complex/IR/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ add_mlir_dialect_library(MLIRComplexDialect
MLIRComplexAttributesIncGen

LINK_LIBS PUBLIC
MLIRArithAttrToLLVMConversion
MLIRArithDialect
MLIRDialect
MLIRInferTypeOpInterface
Expand Down
2 changes: 2 additions & 0 deletions mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ add_mlir_dialect_library(MLIRLinalgTransforms
MLIRDestinationStyleOpInterface
MLIRDialectUtils
MLIRFuncDialect
MLIRFuncToLLVM
MLIRFuncTransforms
MLIRIndexDialect
MLIRInferTypeOpInterface
Expand All @@ -86,5 +87,6 @@ add_mlir_dialect_library(MLIRLinalgTransforms
MLIRVectorDialect
MLIRVectorTransforms
MLIRVectorUtils
MLIRX86VectorTransforms
MLIRVectorToSCF
)
3 changes: 3 additions & 0 deletions mlir/lib/Dialect/MemRef/IR/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ add_mlir_dialect_library(MLIRMemRefDialect
DEPENDS
MLIRMemRefOpsIncGen

LINK_COMPONENTS
Core

LINK_LIBS PUBLIC
MLIRArithDialect
MLIRArithUtils
Expand Down
1 change: 0 additions & 1 deletion mlir/lib/Dialect/MemRef/TransformOps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,4 @@ add_mlir_dialect_library(MLIRMemRefTransformOps
MLIRNVGPUDialect
MLIRTransformDialect
MLIRVectorDialect
MLIRVectorTransforms
)
3 changes: 3 additions & 0 deletions mlir/lib/Dialect/Tensor/IR/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ add_mlir_dialect_library(MLIRTensorDialect
DEPENDS
MLIRTensorOpsIncGen

LINK_COMPONENTS
Core

LINK_LIBS PUBLIC
MLIRAffineDialect
MLIRArithDialect
Expand Down

0 comments on commit 06fd808

Please sign in to comment.