Skip to content

Commit dd04cf0

Browse files
authored
MLIR BUILD.bazel: fold BasicPtxBuilderInterface into NVVMDialect (#111172)
While doing an integrate into downstream https://github.com/iree-org/iree, I ran into a typical Bazel error with `BasicPtxBuilderInterface.cpp` including `NVVMDialect.h` which was not exposed as a header by a declared dependency. I tried fixing this the straightforward way, by letting `:BasicPtxBuilderInterface` depend on `:NVVMDialect` , but that caused another Bazel error: circular dependency between these two targets, as `:NVVMDialect` was already depending on `:BasicPtxBuilderInterface`. I tried breaking that circle by dropping the latter dependency, but it was a real dependency in the code, specifically in the TableGen-generated code. So in the end it seems that these two targets just need to be fused, which this PR does. Signed-off-by: Benoit Jacob <[email protected]>
1 parent 87c799a commit dd04cf0

File tree

1 file changed

+9
-18
lines changed

1 file changed

+9
-18
lines changed

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

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6302,11 +6302,17 @@ gentbl_cc_library(
63026302

63036303
cc_library(
63046304
name = "NVVMDialect",
6305-
srcs = ["lib/Dialect/LLVMIR/IR/NVVMDialect.cpp"],
6306-
hdrs = ["include/mlir/Dialect/LLVMIR/NVVMDialect.h"],
6305+
srcs = [
6306+
"lib/Dialect/LLVMIR/IR/BasicPtxBuilderInterface.cpp",
6307+
"lib/Dialect/LLVMIR/IR/NVVMDialect.cpp",
6308+
],
6309+
hdrs = [
6310+
"include/mlir/Dialect/LLVMIR/BasicPtxBuilderInterface.h",
6311+
"include/mlir/Dialect/LLVMIR/NVVMDialect.h",
6312+
],
63076313
includes = ["include"],
63086314
deps = [
6309-
":BasicPtxBuilderInterface",
6315+
":BasicPtxBuilderIntGen",
63106316
":BytecodeOpInterface",
63116317
":ConvertToLLVMInterface",
63126318
":DialectUtils",
@@ -6507,21 +6513,6 @@ gentbl_cc_library(
65076513
deps = [":NVVMOpsTdFiles"],
65086514
)
65096515

6510-
cc_library(
6511-
name = "BasicPtxBuilderInterface",
6512-
srcs = ["lib/Dialect/LLVMIR/IR/BasicPtxBuilderInterface.cpp"],
6513-
hdrs = [
6514-
"include/mlir/Dialect/LLVMIR/BasicPtxBuilderInterface.h",
6515-
],
6516-
includes = ["include"],
6517-
deps = [
6518-
":BasicPtxBuilderIntGen",
6519-
":IR",
6520-
":LLVMDialect",
6521-
":Support",
6522-
],
6523-
)
6524-
65256516
cc_library(
65266517
name = "NVVMToLLVM",
65276518
srcs = ["lib/Conversion/NVVMToLLVM/NVVMToLLVM.cpp"],

0 commit comments

Comments
 (0)