Skip to content

Commit 83e5a12

Browse files
authored
[mlir][bazel] Don't expose interface headers from //mlir:IR. (#85867)
Move 3 interface headers in `//mlir:IR` from `hdrs` to `srcs`. Header files should not be added to multiple targets, but this is hard to avoid because CMake is less strict with headers. But we should at least avoid exposing them as headers by multiple targets because it confuses tooling.
1 parent 7e72caf commit 83e5a12

File tree

6 files changed

+27
-3
lines changed

6 files changed

+27
-3
lines changed

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

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,16 +330,16 @@ cc_library(
330330
"lib/Bytecode/*.h",
331331
]) + [
332332
"include/mlir/IR/PDLPatternMatch.h.inc",
333+
"include/mlir/Interfaces/CallInterfaces.h",
334+
"include/mlir/Interfaces/DataLayoutInterfaces.h",
335+
"include/mlir/Interfaces/SideEffectInterfaces.h",
333336
"lib/Bytecode/BytecodeOpInterface.cpp",
334337
],
335338
hdrs = glob([
336339
"include/mlir/IR/*.h",
337340
"include/mlir/Bytecode/*.h",
338341
]) + [
339-
"include/mlir/Interfaces/CallInterfaces.h",
340-
"include/mlir/Interfaces/DataLayoutInterfaces.h",
341342
"include/mlir/Interfaces/FoldInterfaces.h",
342-
"include/mlir/Interfaces/SideEffectInterfaces.h",
343343
],
344344
includes = ["include"],
345345
deps = [
@@ -1646,6 +1646,7 @@ cc_library(
16461646
":IR",
16471647
":MemRefDialect",
16481648
":Pass",
1649+
":SideEffectInterfaces",
16491650
":Support",
16501651
":TransformUtils",
16511652
":Transforms",
@@ -3131,6 +3132,7 @@ cc_library(
31313132
":DialectUtils",
31323133
":IR",
31333134
":InferTypeOpInterface",
3135+
":SideEffectInterfaces",
31343136
":SparseTensorAttrDefsIncGen",
31353137
":SparseTensorEnums",
31363138
":SparseTensorInterfacesIncGen",
@@ -4017,6 +4019,7 @@ cc_library(
40174019
":AffineDialect",
40184020
":Analysis",
40194021
":ArithDialect",
4022+
":CallOpInterfaces",
40204023
":DialectUtils",
40214024
":FuncDialect",
40224025
":IR",
@@ -4100,6 +4103,7 @@ cc_library(
41004103
":Pass",
41014104
":SCFDialect",
41024105
":SCFUtils",
4106+
":SideEffectInterfaces",
41034107
":Support",
41044108
":TensorDialect",
41054109
":Transforms",
@@ -6947,6 +6951,7 @@ cc_library(
69476951
]),
69486952
includes = ["include"],
69496953
deps = [
6954+
":CallOpInterfaces",
69506955
":CommonFolders",
69516956
":ControlFlowInterfaces",
69526957
":FunctionInterfaces",
@@ -7591,6 +7596,7 @@ cc_library(
75917596
includes = ["include"],
75927597
deps = [
75937598
":Analysis",
7599+
":CallOpInterfaces",
75947600
":ControlFlowInterfaces",
75957601
":FunctionInterfaces",
75967602
":IR",
@@ -7921,6 +7927,7 @@ cc_library(
79217927
includes = ["include"],
79227928
deps = [
79237929
":Analysis",
7930+
":CallOpInterfaces",
79247931
":ControlFlowInterfaces",
79257932
":FunctionInterfaces",
79267933
":IR",
@@ -7930,6 +7937,7 @@ cc_library(
79307937
":Pass",
79317938
":Rewrite",
79327939
":RuntimeVerifiableOpInterface",
7940+
":SideEffectInterfaces",
79337941
":Support",
79347942
":TransformUtils",
79357943
":TransformsPassIncGen",
@@ -8081,6 +8089,7 @@ cc_library(
80818089
hdrs = glob(["include/mlir/Conversion/LLVMCommon/*.h"]),
80828090
includes = ["include"],
80838091
deps = [
8092+
":DataLayoutInterfaces",
80848093
":IR",
80858094
":LLVMDialect",
80868095
":Support",
@@ -9052,6 +9061,7 @@ cc_library(
90529061
includes = ["include"],
90539062
deps = [
90549063
":DLTIDialect",
9064+
":DataLayoutInterfaces",
90559065
":IR",
90569066
":LLVMConversionIncGen",
90579067
":LLVMDialect",
@@ -12681,6 +12691,7 @@ cc_library(
1268112691
":ArithOpsIncGen",
1268212692
":ArithOpsInterfacesIncGen",
1268312693
":BufferizationInterfaces",
12694+
":CallOpInterfaces",
1268412695
":CastInterfaces",
1268512696
":CommonFolders",
1268612697
":ControlFlowInterfaces",
@@ -12692,6 +12703,7 @@ cc_library(
1269212703
":InferTypeOpInterface",
1269312704
":InliningUtils",
1269412705
":Pass",
12706+
":SideEffectInterfaces",
1269512707
":Support",
1269612708
":UBDialect",
1269712709
":ValueBoundsOpInterfaceIncGen",
@@ -12998,6 +13010,7 @@ cc_library(
1299813010
":ArithDialect",
1299913011
":ArithUtils",
1300013012
":BufferizationInterfaces",
13013+
":CallOpInterfaces",
1300113014
":CastInterfaces",
1300213015
":ComplexDialect",
1300313016
":ControlFlowInterfaces",
@@ -13012,6 +13025,7 @@ cc_library(
1301213025
":MemorySlotInterfaces",
1301313026
":RuntimeVerifiableOpInterface",
1301413027
":ShapedOpInterfaces",
13028+
":SideEffectInterfaces",
1301513029
":Support",
1301613030
":ValueBoundsOpInterface",
1301713031
":ViewLikeInterface",
@@ -13259,6 +13273,7 @@ cc_library(
1325913273
hdrs = glob(["include/mlir/Dialect/MLProgram/IR/*.h"]),
1326013274
includes = ["include"],
1326113275
deps = [
13276+
":CallOpInterfaces",
1326213277
":ControlFlowInterfaces",
1326313278
":FunctionInterfaces",
1326413279
":IR",
@@ -13267,6 +13282,7 @@ cc_library(
1326713282
":MLProgramOpsIncGen",
1326813283
":MLProgramTypesIncGen",
1326913284
":Pass",
13285+
":SideEffectInterfaces",
1327013286
":Support",
1327113287
":Transforms",
1327213288
"//llvm:Support",

utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch5/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ cc_binary(
102102
"//mlir:Analysis",
103103
"//mlir:ArithDialect",
104104
"//mlir:BytecodeReader",
105+
"//mlir:CallOpInterfaces",
105106
"//mlir:CastInterfaces",
106107
"//mlir:FuncDialect",
107108
"//mlir:FuncExtensions",

utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch6/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ cc_binary(
108108
"//mlir:ArithToLLVM",
109109
"//mlir:BuiltinToLLVMIRTranslation",
110110
"//mlir:BytecodeReader",
111+
"//mlir:CallOpInterfaces",
111112
"//mlir:CastInterfaces",
112113
"//mlir:ControlFlowToLLVM",
113114
"//mlir:ExecutionEngine",

utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch7/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ cc_binary(
108108
"//mlir:ArithToLLVM",
109109
"//mlir:BuiltinToLLVMIRTranslation",
110110
"//mlir:BytecodeReader",
111+
"//mlir:CallOpInterfaces",
111112
"//mlir:CastInterfaces",
112113
"//mlir:ControlFlowToLLVM",
113114
"//mlir:ExecutionEngine",

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,14 @@ cc_library(
9494
"//mlir:AffineAnalysis",
9595
"//mlir:AffineDialect",
9696
"//mlir:Analysis",
97+
"//mlir:CallOpInterfaces",
9798
"//mlir:ControlFlowInterfaces",
9899
"//mlir:FuncDialect",
99100
"//mlir:FunctionInterfaces",
100101
"//mlir:IR",
101102
"//mlir:MemRefDialect",
102103
"//mlir:Pass",
104+
"//mlir:SideEffectInterfaces",
103105
"//mlir:Support",
104106
],
105107
)
@@ -386,6 +388,7 @@ cc_library(
386388
":TestTypeDefsIncGen",
387389
"//llvm:Support",
388390
"//mlir:ArithDialect",
391+
"//mlir:CallOpInterfaces",
389392
"//mlir:ControlFlowInterfaces",
390393
"//mlir:CopyOpInterface",
391394
"//mlir:DLTIDialect",
@@ -571,6 +574,7 @@ cc_library(
571574
"//mlir:Pass",
572575
"//mlir:SCFDialect",
573576
"//mlir:SPIRVDialect",
577+
"//mlir:SideEffectInterfaces",
574578
"//mlir:Support",
575579
"//mlir:Transforms",
576580
],

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ cc_test(
4040
deps = [
4141
"//llvm:Support",
4242
"//mlir:BytecodeReader",
43+
"//mlir:CallOpInterfaces",
4344
"//mlir:FunctionInterfaces",
4445
"//mlir:IR",
4546
"//mlir:Parser",

0 commit comments

Comments
 (0)