Skip to content

Commit 083f80f

Browse files
committed
[mlir][bazel] Remove implementation from LinalgInterfaces target.
Move LinalgInterfaces.cpp from LinalgInterfaces to LinalgDialect target. This allows TensorDialect to use header-only RelayoutOpInterface without introducing a hidden dependency on LinalgDialect (producing an `no-allow-shlib-undefined` error if a target depends on TensorDialect but not LinalgDialect). Also reverts d64f177 because it's no longer needed.
1 parent ed14745 commit 083f80f

File tree

2 files changed

+5
-19
lines changed

2 files changed

+5
-19
lines changed

utils/bazel/llvm-project-overlay/mlir/BUILD.bazel

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11547,41 +11547,28 @@ cc_library(
1154711547

1154811548
cc_library(
1154911549
name = "LinalgInterfaces",
11550-
srcs = [
11551-
"include/mlir/Dialect/Linalg/IR/Linalg.h",
11552-
"lib/Dialect/Linalg/IR/LinalgInterfaces.cpp",
11553-
],
11550+
# Note: LinalgInterfaces.cpp is part of LinalgDialect, not this target.
11551+
# This allows TensorDialect to use the header-only RelayOpInterface without
11552+
# an implicit dependency on the LinalgDialect.
1155411553
hdrs = ["include/mlir/Dialect/Linalg/IR/LinalgInterfaces.h"],
1155511554
includes = ["include"],
1155611555
deps = [
11557-
":AffineDialect",
11558-
":ArithDialect",
11559-
":ArithUtils",
11560-
":BytecodeOpInterface",
11561-
":ComplexDialect",
11562-
":ControlFlowInterfaces",
11563-
":CopyOpInterface",
1156411556
":DestinationStyleOpInterface",
1156511557
":DialectUtils",
1156611558
":IR",
1156711559
":InferTypeOpInterface",
11568-
":LinalgEnumsIncGen",
1156911560
":LinalgInterfacesIncGen",
11570-
":LinalgOpsIncGen",
11571-
":LinalgRelayoutOpsIncGen",
1157211561
":LinalgStructuredOpsIncGen",
11573-
":SideEffectInterfaces",
1157411562
":Support",
11575-
":TilingInterface",
1157611563
":ViewLikeInterface",
11577-
"//llvm:Support",
1157811564
],
1157911565
)
1158011566

1158111567
cc_library(
1158211568
name = "LinalgDialect",
1158311569
srcs = [
1158411570
"lib/Dialect/Linalg/IR/LinalgDialect.cpp",
11571+
"lib/Dialect/Linalg/IR/LinalgInterfaces.cpp",
1158511572
"lib/Dialect/Linalg/IR/LinalgOps.cpp",
1158611573
"lib/Dialect/Linalg/IR/ValueBoundsOpInterfaceImpl.cpp",
1158711574
],
@@ -11608,6 +11595,7 @@ cc_library(
1160811595
":InliningUtils",
1160911596
":LinalgEnumsIncGen",
1161011597
":LinalgInterfaces",
11598+
":LinalgInterfacesIncGen",
1161111599
":LinalgNamedStructuredOpsYamlIncGen",
1161211600
":LinalgOpsIncGen",
1161311601
":LinalgRelayoutOpsIncGen",

utils/bazel/llvm-project-overlay/mlir/unittests/BUILD.bazel

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ cc_test(
176176
"//mlir:ArithDialect",
177177
"//mlir:FuncDialect",
178178
"//mlir:IR",
179-
"//mlir:LinalgDialect",
180179
"//mlir:Parser",
181180
"//mlir:SCFDialect",
182181
"//mlir:SideEffectInterfaces",
@@ -212,7 +211,6 @@ cc_test(
212211
"//llvm:Support",
213212
"//llvm:TestingSupport",
214213
"//mlir:IR",
215-
"//mlir:LinalgDialect",
216214
"//mlir:SPIRVBinaryUtils",
217215
"//mlir:SPIRVDeserialization",
218216
"//mlir:SPIRVDialect",

0 commit comments

Comments
 (0)