Skip to content

Commit 89ef313

Browse files
authored
[mlir][bazel] Create a separate target for BytecodeOpInterface. (#86655)
This matches the CMake targets and reduces the number of headers that need to be included in multiple targets.
1 parent ca594fe commit 89ef313

File tree

2 files changed

+38
-10
lines changed

2 files changed

+38
-10
lines changed

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

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -326,16 +326,15 @@ cc_library(
326326
"lib/IR/*.h",
327327
"lib/IR/PDL/*.cpp",
328328
"lib/Bytecode/Writer/*.h",
329+
"include/mlir/Bytecode/*.h",
329330
]) + [
330331
"include/mlir/IR/PDLPatternMatch.h.inc",
331332
"include/mlir/Interfaces/CallInterfaces.h",
332333
"include/mlir/Interfaces/DataLayoutInterfaces.h",
333334
"include/mlir/Interfaces/SideEffectInterfaces.h",
334-
"lib/Bytecode/BytecodeOpInterface.cpp",
335335
],
336336
hdrs = glob([
337337
"include/mlir/IR/*.h",
338-
"include/mlir/Bytecode/*.h",
339338
]) + [
340339
"include/mlir/Interfaces/FoldInterfaces.h",
341340
],
@@ -3123,6 +3122,7 @@ cc_library(
31233122
deps = [
31243123
":ArithDialect",
31253124
":BufferizationInterfaces",
3125+
":BytecodeOpInterface",
31263126
":DialectUtils",
31273127
":IR",
31283128
":InferTypeOpInterface",
@@ -3755,6 +3755,7 @@ cc_library(
37553755
hdrs = ["include/mlir/Dialect/XeGPU/IR/XeGPU.h"],
37563756
includes = ["include"],
37573757
deps = [
3758+
":BytecodeOpInterface",
37583759
":DialectUtils",
37593760
":IR",
37603761
":ShapedOpInterfaces",
@@ -4700,6 +4701,7 @@ cc_library(
47004701
deps = [
47014702
":ArithDialect",
47024703
":BufferizationInterfaces",
4704+
":BytecodeOpInterface",
47034705
":CommonFolders",
47044706
":ControlFlowInterfaces",
47054707
":ControlFlowOpsIncGen",
@@ -5222,13 +5224,11 @@ cc_library(
52225224
srcs = glob([
52235225
"lib/Bytecode/Reader/*.cpp",
52245226
]),
5225-
hdrs = glob([
5226-
"include/mlir/Bytecode/*.h",
5227-
]),
5227+
hdrs = ["include/mlir/Bytecode/BytecodeReader.h"],
52285228
includes = ["include"],
52295229
deps = [
52305230
":AsmParser",
5231-
":BytecodeOpInterfaceIncGen",
5231+
":BytecodeOpInterface",
52325232
":IR",
52335233
":Support",
52345234
"//llvm:Support",
@@ -5241,12 +5241,10 @@ cc_library(
52415241
"lib/Bytecode/Writer/*.cpp",
52425242
"lib/Bytecode/Writer/*.h",
52435243
]),
5244-
hdrs = glob([
5245-
"include/mlir/Bytecode/*.h",
5246-
]),
5244+
hdrs = ["include/mlir/Bytecode/BytecodeWriter.h"],
52475245
includes = ["include"],
52485246
deps = [
5249-
":BytecodeOpInterfaceIncGen",
5247+
":BytecodeOpInterface",
52505248
":IR",
52515249
":Support",
52525250
"//llvm:Support",
@@ -6608,6 +6606,7 @@ cc_library(
66086606
]),
66096607
includes = ["include"],
66106608
deps = [
6609+
":BytecodeOpInterface",
66116610
":IR",
66126611
":InferTypeOpInterface",
66136612
":PDLOpsIncGen",
@@ -7308,6 +7307,7 @@ cc_library(
73087307
":ArithDialect",
73097308
":ArithUtils",
73107309
":BufferizationInterfaces",
7310+
":BytecodeOpInterface",
73117311
":CastInterfaces",
73127312
":ComplexDialect",
73137313
":ControlFlowInterfaces",
@@ -8436,6 +8436,23 @@ gentbl_cc_library(
84368436
deps = [":BytecodeOpInterfaceTdFiles"],
84378437
)
84388438

8439+
cc_library(
8440+
name = "BytecodeOpInterface",
8441+
srcs = ["lib/Bytecode/BytecodeOpInterface.cpp"],
8442+
hdrs = [
8443+
"include/mlir/Bytecode/BytecodeImplementation.h",
8444+
"include/mlir/Bytecode/BytecodeOpInterface.h",
8445+
"include/mlir/Bytecode/Encoding.h",
8446+
],
8447+
includes = ["include"],
8448+
deps = [
8449+
":BytecodeOpInterfaceIncGen",
8450+
":IR",
8451+
":Support",
8452+
"//llvm:Support",
8453+
],
8454+
)
8455+
84398456
gentbl_cc_library(
84408457
name = "CallOpInterfacesIncGen",
84418458
tbl_outs = [
@@ -10386,6 +10403,7 @@ cc_library(
1038610403
includes = ["include"],
1038710404
deps = [
1038810405
":ArithDialect",
10406+
":BytecodeOpInterface",
1038910407
":FuncDialect",
1039010408
":IR",
1039110409
":InferTypeOpInterface",
@@ -10970,6 +10988,7 @@ cc_library(
1097010988
":AsmParser",
1097110989
":BufferizationDialect",
1097210990
":BufferizationInterfaces",
10991+
":BytecodeOpInterface",
1097310992
":ComplexDialect",
1097410993
":ControlFlowInterfaces",
1097510994
":CopyOpInterface",
@@ -12356,6 +12375,7 @@ cc_library(
1235612375
includes = ["include"],
1235712376
deps = [
1235812377
":ArithDialect",
12378+
":BytecodeOpInterface",
1235912379
":ComplexAttributesIncGen",
1236012380
":ComplexBaseIncGen",
1236112381
":ComplexOpsIncGen",
@@ -12621,6 +12641,7 @@ cc_library(
1262112641
":ArithOpsIncGen",
1262212642
":ArithOpsInterfacesIncGen",
1262312643
":BufferizationInterfaces",
12644+
":BytecodeOpInterface",
1262412645
":CallOpInterfaces",
1262512646
":CastInterfaces",
1262612647
":CommonFolders",
@@ -12791,6 +12812,7 @@ cc_library(
1279112812
includes = ["include"],
1279212813
deps = [
1279312814
":ArithDialect",
12815+
":BytecodeOpInterface",
1279412816
":CommonFolders",
1279512817
":ConvertToLLVMInterface",
1279612818
":IR",
@@ -12935,6 +12957,7 @@ cc_library(
1293512957
":ArithDialect",
1293612958
":ArithUtils",
1293712959
":BufferizationInterfaces",
12960+
":BytecodeOpInterface",
1293812961
":CallOpInterfaces",
1293912962
":CastInterfaces",
1294012963
":ComplexDialect",
@@ -13199,6 +13222,7 @@ cc_library(
1319913222
hdrs = glob(["include/mlir/Dialect/MLProgram/IR/*.h"]),
1320013223
includes = ["include"],
1320113224
deps = [
13225+
":BytecodeOpInterface",
1320213226
":CallOpInterfaces",
1320313227
":ControlFlowInterfaces",
1320413228
":FunctionInterfaces",
@@ -13595,6 +13619,7 @@ cc_library(
1359513619
":BufferizationBaseIncGen",
1359613620
":BufferizationInterfaces",
1359713621
":BufferizationOpsIncGen",
13622+
":BytecodeOpInterface",
1359813623
":CallOpInterfaces",
1359913624
":ControlFlowInterfaces",
1360013625
":CopyOpInterface",

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ cc_library(
358358
deps = [
359359
":TestTransformDialectExtensionIncGen",
360360
"//llvm:Support",
361+
"//mlir:BytecodeOpInterface",
361362
"//mlir:IR",
362363
"//mlir:PDLDialect",
363364
"//mlir:Pass",
@@ -388,6 +389,7 @@ cc_library(
388389
":TestTypeDefsIncGen",
389390
"//llvm:Support",
390391
"//mlir:ArithDialect",
392+
"//mlir:BytecodeOpInterface",
391393
"//mlir:CallOpInterfaces",
392394
"//mlir:ControlFlowInterfaces",
393395
"//mlir:CopyOpInterface",
@@ -439,6 +441,7 @@ cc_library(
439441
"//llvm:Support",
440442
"//mlir:Analysis",
441443
"//mlir:ArithDialect",
444+
"//mlir:BytecodeOpInterface",
442445
"//mlir:BytecodeReader",
443446
"//mlir:BytecodeWriter",
444447
"//mlir:FuncDialect",

0 commit comments

Comments
 (0)