Skip to content

Commit f1dff83

Browse files
authored
[mlir][bazel] Expose GPUCommonPass.h only by a single target. (#86730)
Move `GPUOpsLowering.cpp` from `//mlir:GPUCommonTransforms` to `//mlir:GPUToGPURuntimeTransforms` to match the CMake setup. Ideally, header files should be used by only one target, but this is hard because CMake is less strict with headers (no layering check). But even with bazel, headers should only be exported once in the `hdrs` attribute. Other targets may use them in the `srcs` attribute to avoid circular dependencies.
1 parent da3e58e commit f1dff83

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3567,6 +3567,7 @@ cc_library(
35673567
":GPUCommonTransforms",
35683568
":GPUCompilationAttrInterfacesIncGen",
35693569
":GPUDialect",
3570+
":GPUToGPURuntimeTransforms",
35703571
":IR",
35713572
":LLVMCommonConversion",
35723573
":LinalgDialect",
@@ -5603,6 +5604,7 @@ cc_library(
56035604
":FuncToLLVM",
56045605
":GPUCommonTransforms",
56055606
":GPUDialect",
5607+
":GPUToGPURuntimeTransforms",
56065608
":GPUToNVVMTransforms",
56075609
":GPUTransforms",
56085610
":IndexToLLVM",
@@ -5727,6 +5729,7 @@ cc_library(
57275729
":FuncDialect",
57285730
":GPUCommonTransforms",
57295731
":GPUDialect",
5732+
":GPUToGPURuntimeTransforms",
57305733
":GPUToNVVMTransforms",
57315734
":GPUTransformOpsIncGen",
57325735
":GPUTransforms",
@@ -5774,11 +5777,7 @@ td_library(
57745777

57755778
cc_library(
57765779
name = "GPUCommonTransforms",
5777-
srcs = [
5778-
"lib/Conversion/GPUCommon/GPUOpsLowering.cpp",
5779-
],
57805780
hdrs = [
5781-
"include/mlir/Conversion/GPUCommon/GPUCommonPass.h",
57825781
"lib/Conversion/GPUCommon/GPUOpsLowering.h",
57835782
"lib/Conversion/GPUCommon/IndexIntrinsicsOpLowering.h",
57845783
"lib/Conversion/GPUCommon/OpToFuncCallLowering.h",
@@ -5832,6 +5831,7 @@ cc_library(
58325831
":FuncToLLVM",
58335832
":GPUCommonTransforms",
58345833
":GPUDialect",
5834+
":GPUToGPURuntimeTransforms",
58355835
":GPUToNVVMGen",
58365836
":GPUTransforms",
58375837
":IR",
@@ -5958,6 +5958,7 @@ cc_library(
59585958
":FuncToLLVM",
59595959
":GPUCommonTransforms",
59605960
":GPUDialect",
5961+
":GPUToGPURuntimeTransforms",
59615962
":GPUToROCDLTGen",
59625963
":GPUTransforms",
59635964
":IR",
@@ -6001,6 +6002,7 @@ cc_library(
60016002
cc_library(
60026003
name = "GPUToGPURuntimeTransforms",
60036004
srcs = [
6005+
"lib/Conversion/GPUCommon/GPUOpsLowering.cpp",
60046006
"lib/Conversion/GPUCommon/GPUToLLVMConversion.cpp",
60056007
],
60066008
hdrs = ["include/mlir/Conversion/GPUCommon/GPUCommonPass.h"],
@@ -6014,6 +6016,7 @@ cc_library(
60146016
":ConvertToLLVM",
60156017
":ConvertToLLVMInterface",
60166018
":FuncToLLVM",
6019+
":GPUCommonTransforms",
60176020
":GPUDialect",
60186021
":GPUTransforms",
60196022
":IR",

0 commit comments

Comments
 (0)