diff options
author | Christian Sigg <chsigg@users.noreply.github.com> | 2024-03-28 20:12:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-28 20:12:27 +0100 |
commit | 6e58efac16958ccb99060f4329b48737be7d8d36 (patch) | |
tree | 22f987faf07717bfc7d62696dad080079df53fb9 | |
parent | c2f3a11dbe1a6bc2fc46b35c3fb4398e1d6a90c4 (diff) | |
download | llvm-6e58efac16958ccb99060f4329b48737be7d8d36.zip llvm-6e58efac16958ccb99060f4329b48737be7d8d36.tar.gz llvm-6e58efac16958ccb99060f4329b48737be7d8d36.tar.bz2 |
[mlir][bazel] Export headers either from :Transforms or :TransformUtils (#86819)
Split them according to their implementation.
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.
6 files changed, 116 insertions, 12 deletions
diff --git a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel index 041db6a..6c3ea17 100644 --- a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel @@ -1463,6 +1463,7 @@ cc_library( ":IR", ":TransformDialect", ":TransformDialectInterfaces", + ":TransformUtils", ":Transforms", ":VectorDialect", ], @@ -1941,6 +1942,7 @@ cc_library( ":IR", ":LLVMDialect", ":Support", + ":TransformUtils", ":Transforms", ":VectorDialect", ], @@ -1978,6 +1980,7 @@ cc_library( ":Pass", ":SCFDialect", ":Support", + ":TransformUtils", ":Transforms", ":VectorDialect", ], @@ -2216,6 +2219,7 @@ cc_library( ":Pass", ":SCFDialect", ":SCFTransforms", + ":TransformUtils", ":Transforms", ":VectorDialect", "//llvm:Support", @@ -2233,6 +2237,7 @@ cc_library( ":ConversionPassIncGen", ":Pass", ":SCFDialect", + ":TransformUtils", ":Transforms", ], ) @@ -2252,6 +2257,7 @@ cc_library( ":LLVMDialect", ":MemRefDialect", ":Pass", + ":TransformUtils", ":Transforms", ":VectorDialect", ], @@ -2863,6 +2869,7 @@ cc_library( ":TensorDialect", ":TensorTransforms", ":TilingInterface", + ":TransformUtils", ":Transforms", "//llvm:Support", ], @@ -3220,6 +3227,7 @@ cc_library( ":SparseTensorUtils", ":Support", ":TensorDialect", + ":TransformUtils", ":Transforms", ":VectorDialect", "//llvm:Support", @@ -3441,6 +3449,7 @@ cc_library( ":Support", ":TensorDialect", ":TransformUtils", + ":Transforms", "//llvm:Support", ], ) @@ -4097,6 +4106,7 @@ cc_library( ":SideEffectInterfaces", ":Support", ":TensorDialect", + ":TransformUtils", ":Transforms", ":ValueBoundsOpInterface", ":VectorDialect", @@ -4229,6 +4239,7 @@ cc_library( ":LLVMDialect", ":Pass", ":Support", + ":TransformUtils", ":Transforms", "//llvm:Support", ], @@ -4253,6 +4264,7 @@ cc_library( ":Pass", ":SCFDialect", ":Support", + ":TransformUtils", ":Transforms", ":VectorDialect", ], @@ -4322,6 +4334,7 @@ cc_library( ":SCFDialect", ":SideEffectInterfaces", ":Support", + ":TransformUtils", ":Transforms", "//llvm:Support", ], @@ -4588,6 +4601,7 @@ cc_library( ":ShapeToStandardGen", ":Support", ":TensorDialect", + ":TransformUtils", ":Transforms", "//llvm:Support", ], @@ -4630,6 +4644,7 @@ cc_library( ":ShapeDialect", ":ShapeTransformsPassIncGen", ":TensorDialect", + ":TransformUtils", ":Transforms", "//llvm:Support", ], @@ -4906,6 +4921,7 @@ cc_library( ":Pass", ":SCFDialect", ":Support", + ":TransformUtils", ":Transforms", "//llvm:Support", ], @@ -5055,6 +5071,7 @@ cc_library( ":SubsetOpInterface", ":Support", ":TensorDialect", + ":TransformUtils", ":Transforms", ":VectorDialect", ":VectorEnumsIncGen", @@ -5395,6 +5412,7 @@ cc_library( ":LLVMPassIncGen", ":NVVMDialect", ":Pass", + ":TransformUtils", ":Transforms", "//llvm:BinaryFormat", "//llvm:Support", @@ -5667,6 +5685,7 @@ cc_library( ":SideEffectInterfaces", ":Support", ":ToLLVMIRTranslation", + ":TransformUtils", ":Transforms", ":VCIXToLLVMIRTranslation", ":VectorDialect", @@ -5842,6 +5861,7 @@ cc_library( ":MemRefToLLVM", ":NVVMDialect", ":Pass", + ":TransformUtils", ":Transforms", ":VectorToLLVM", "//llvm:Support", @@ -5916,6 +5936,7 @@ cc_library( ":SPIRVConversion", ":SPIRVDialect", ":Support", + ":TransformUtils", ":Transforms", ":VectorDialect", "//llvm:Support", @@ -5969,6 +5990,7 @@ cc_library( ":MemRefToLLVM", ":Pass", ":ROCDLDialect", + ":TransformUtils", ":Transforms", ":VectorDialect", ":VectorToLLVM", @@ -6056,6 +6078,7 @@ cc_library( ":SPIRVConversion", ":SPIRVDialect", ":Support", + ":TransformUtils", ":Transforms", ":VectorToSPIRV", "//llvm:Support", @@ -6108,6 +6131,7 @@ cc_library( ":SPIRVDialect", ":SPIRVUtils", ":Support", + ":TransformUtils", ":Transforms", "//llvm:Support", ], @@ -6992,6 +7016,7 @@ cc_library( ":SPIRVPassIncGen", ":SPIRVUtils", ":Support", + ":TransformUtils", ":Transforms", "//llvm:Support", ], @@ -7004,6 +7029,7 @@ cc_library( deps = [ ":IR", ":SPIRVDialect", + ":TransformUtils", ":Transforms", "//llvm:Support", ], @@ -7030,6 +7056,7 @@ cc_library( ":SPIRVConversion", ":SPIRVDialect", ":Support", + ":TransformUtils", ":Transforms", "//llvm:Support", ], @@ -7085,6 +7112,7 @@ cc_library( ":SPIRVUtils", ":Support", ":TensorDialect", + ":TransformUtils", ":Transforms", ":VectorDialect", "//llvm:Support", @@ -7113,6 +7141,7 @@ cc_library( ":Pass", ":Support", ":TensorDialect", + ":TransformUtils", ":Transforms", ":VectorDialect", "//llvm:Support", @@ -7146,6 +7175,7 @@ cc_library( ":SPIRVUtils", ":Support", ":TensorDialect", + ":TransformUtils", ":Transforms", ":VectorDialect", "//llvm:Support", @@ -7434,6 +7464,7 @@ cc_library( ":TensorPassIncGen", ":TensorUtils", ":TilingInterface", + ":TransformUtils", ":Transforms", ":ValueBoundsOpInterface", ":VectorDialect", @@ -7513,18 +7544,23 @@ cc_library( cc_library( name = "TransformUtils", srcs = glob( - include = [ - "lib/Transforms/Utils/*.cpp", - ], + include = ["lib/Transforms/Utils/*.cpp"], exclude = ["lib/Transforms/Utils/InliningUtils.cpp"], - ), - hdrs = glob( - include = ["include/mlir/Transforms/*.h"], - exclude = [ - "include/mlir/Transforms/InliningUtils.h", - "include/mlir/Transforms/Passes.h", - ], - ), + ) + [ + ], + hdrs = [ + "include/mlir/Transforms/CFGToSCF.h", + "include/mlir/Transforms/CommutativityUtils.h", + "include/mlir/Transforms/ControlFlowSinkUtils.h", + "include/mlir/Transforms/DialectConversion.h", + "include/mlir/Transforms/FoldUtils.h", + "include/mlir/Transforms/GreedyPatternRewriteDriver.h", + "include/mlir/Transforms/Inliner.h", + "include/mlir/Transforms/LoopInvariantCodeMotionUtils.h", + "include/mlir/Transforms/OneToNTypeConversion.h", + "include/mlir/Transforms/RegionUtils.h", + "include/mlir/Transforms/TopologicalSortUtils.h", + ], includes = ["include"], deps = [ ":Analysis", @@ -7854,7 +7890,16 @@ cc_library( srcs = glob([ "lib/Transforms/*.cpp", ]), - hdrs = glob(["include/mlir/Transforms/*.h"]), + hdrs = [ + "include/mlir/Transforms/CSE.h", + "include/mlir/Transforms/EndomorphismSimplification.h", + "include/mlir/Transforms/HomomorphismSimplification.h", + "include/mlir/Transforms/LocationSnapshot.h", + "include/mlir/Transforms/Mem2Reg.h", + "include/mlir/Transforms/Passes.h", + "include/mlir/Transforms/SROA.h", + "include/mlir/Transforms/ViewOpGraph.h", + ], includes = ["include"], deps = [ ":Analysis", @@ -7985,6 +8030,7 @@ cc_library( ":Pass", ":SCFDialect", ":Support", + ":TransformUtils", ":Transforms", ], ) @@ -8023,6 +8069,7 @@ cc_library( ":IR", ":LLVMDialect", ":Support", + ":TransformUtils", ":Transforms", "//llvm:Core", "//llvm:Support", @@ -8126,6 +8173,7 @@ cc_library( ":LLVMDialect", ":Pass", ":SCFDialect", + ":TransformUtils", ":Transforms", ":UBDialect", "//llvm:Core", @@ -8180,6 +8228,7 @@ cc_library( ":SPIRVDialect", ":SPIRVUtils", ":Support", + ":TransformUtils", ":Transforms", "//llvm:Support", ], @@ -8257,6 +8306,7 @@ cc_library( ":SPIRVConversion", ":SPIRVDialect", ":Support", + ":TransformUtils", ":Transforms", "//llvm:Support", ], @@ -8288,6 +8338,7 @@ cc_library( ":LLVMDialect", ":Pass", ":Support", + ":TransformUtils", ":Transforms", ":VectorDialect", ], @@ -8308,6 +8359,7 @@ cc_library( ":ConversionPassIncGen", ":IR", ":Pass", + ":TransformUtils", ":Transforms", "//llvm:Support", ], @@ -8415,6 +8467,7 @@ cc_library( ":MathDialect", ":Pass", ":SCFDialect", + ":TransformUtils", ":Transforms", ":VectorDialect", ":VectorUtils", @@ -8961,6 +9014,7 @@ cc_library( ":OpenMPDialect", ":Support", ":ToLLVMIRTranslation", + ":TransformUtils", ":Transforms", "//llvm:Core", "//llvm:FrontendOpenMP", @@ -10054,6 +10108,7 @@ cc_library( ":OpenACCOpsInterfacesIncGen", ":OpenACCTypeInterfacesIncGen", ":OpenACCTypesIncGen", + ":TransformUtils", ":Transforms", "//llvm:Support", ], @@ -10293,6 +10348,7 @@ cc_library( ":OpenACCTypesIncGen", ":Pass", ":SCFDialect", + ":TransformUtils", ":Transforms", ], ) @@ -10973,6 +11029,7 @@ cc_library( ":Pass", ":SCFDialect", ":Support", + ":TransformUtils", ":Transforms", "//llvm:Core", "//llvm:Support", @@ -11508,6 +11565,7 @@ cc_library( ":Pass", ":Support", ":ToLLVMIRTranslation", + ":TransformUtils", ":Transforms", ":VectorDialect", ":VectorTransforms", @@ -11533,6 +11591,7 @@ cc_library( ":IR", ":MemRefDialect", ":Pass", + ":TransformUtils", ":Transforms", "//llvm:Support", ], @@ -11565,6 +11624,7 @@ cc_library( ":Pass", ":SCFDialect", ":Support", + ":TransformUtils", ":Transforms", ":VectorDialect", ":VectorTransforms", @@ -11597,6 +11657,7 @@ cc_library( ":SCFDialect", ":Support", ":TensorDialect", + ":TransformUtils", ":Transforms", ":VectorDialect", ":VectorTransforms", @@ -11781,6 +11842,7 @@ cc_library( ":IR", ":Pass", ":TosaDialect", + ":TransformUtils", ":Transforms", ], ) @@ -11812,6 +11874,7 @@ cc_library( ":TensorDialect", ":TensorUtils", ":TosaDialect", + ":TransformUtils", ":Transforms", "//llvm:Support", ], @@ -11836,6 +11899,7 @@ cc_library( ":MLProgramDialect", ":Pass", ":TosaDialect", + ":TransformUtils", ":Transforms", ], ) @@ -11860,6 +11924,7 @@ cc_library( ":SCFDialect", ":TensorDialect", ":TosaDialect", + ":TransformUtils", ":Transforms", ], ) @@ -11886,6 +11951,7 @@ cc_library( ":TensorDialect", ":TensorUtils", ":TosaDialect", + ":TransformUtils", ":Transforms", ], ) @@ -12062,6 +12128,7 @@ cc_library( ":TransformDialectInterfacesIncGen", ":TransformDialectMatchInterfacesIncGen", ":TransformDialectUtils", + ":TransformUtils", ":Transforms", "//llvm:Support", ], @@ -12092,6 +12159,7 @@ cc_library( ":TransformDialectUtils", ":TransformOpsIncGen", ":TransformTypesIncGen", + ":TransformUtils", ":Transforms", "//llvm:Support", ], @@ -12230,6 +12298,7 @@ cc_library( ":TransformDialect", ":TransformDialectInterfaces", ":TransformLoopExtensionOpsIncGen", + ":TransformUtils", ":Transforms", "//llvm:Support", ], @@ -12435,6 +12504,7 @@ cc_library( ":IR", ":Pass", ":Support", + ":TransformUtils", ":Transforms", "//llvm:Core", "//llvm:Support", @@ -12459,6 +12529,7 @@ cc_library( ":SPIRVConversion", ":SPIRVDialect", ":Support", + ":TransformUtils", ":Transforms", "//llvm:Core", "//llvm:Support", @@ -12482,6 +12553,7 @@ cc_library( ":IR", ":MathDialect", ":Pass", + ":TransformUtils", ":Transforms", ], ) @@ -12845,6 +12917,7 @@ cc_library( ":MathPassIncGen", ":Pass", ":SCFDialect", + ":TransformUtils", ":Transforms", ":VectorDialect", ":VectorUtils", @@ -12872,6 +12945,7 @@ cc_library( ":MathDialect", ":Pass", ":Support", + ":TransformUtils", ":Transforms", ":VectorDialect", ":VectorUtils", @@ -13056,6 +13130,7 @@ cc_library( ":SCFDialect", ":Support", ":TensorDialect", + ":TransformUtils", ":Transforms", ":ValueBoundsOpInterface", ":VectorDialect", @@ -13688,6 +13763,7 @@ cc_library( ":SubsetOpInterface", ":Support", ":TensorDialect", + ":TransformUtils", ":Transforms", ":ViewLikeInterface", "//llvm:Support", @@ -13714,6 +13790,7 @@ cc_library( ":Pass", ":SCFDialect", ":Support", + ":TransformUtils", ":Transforms", ], ) diff --git a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch4/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch4/BUILD.bazel index b8c5a59..68639df 100644 --- a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch4/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch4/BUILD.bazel @@ -101,6 +101,7 @@ cc_binary( "//mlir:CastInterfaces", "//mlir:FunctionInterfaces", "//mlir:IR", + "//mlir:InliningUtils", "//mlir:Parser", "//mlir:Pass", "//mlir:SideEffectInterfaces", diff --git a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch5/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch5/BUILD.bazel index 2c49d52..9ce23b5 100644 --- a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch5/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch5/BUILD.bazel @@ -108,6 +108,7 @@ cc_binary( "//mlir:FuncExtensions", "//mlir:FunctionInterfaces", "//mlir:IR", + "//mlir:InliningUtils", "//mlir:MemRefDialect", "//mlir:Parser", "//mlir:Pass", diff --git a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch6/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch6/BUILD.bazel index cd7f7f0..86925aa 100644 --- a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch6/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch6/BUILD.bazel @@ -118,6 +118,7 @@ cc_binary( "//mlir:FuncToLLVM", "//mlir:FunctionInterfaces", "//mlir:IR", + "//mlir:InliningUtils", "//mlir:LLVMCommonConversion", "//mlir:LLVMDialect", "//mlir:LLVMIRTransforms", diff --git a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch7/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch7/BUILD.bazel index c03672e..bf9ab79 100644 --- a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch7/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch7/BUILD.bazel @@ -118,6 +118,7 @@ cc_binary( "//mlir:FuncToLLVM", "//mlir:FunctionInterfaces", "//mlir:IR", + "//mlir:InliningUtils", "//mlir:LLVMCommonConversion", "//mlir:LLVMDialect", "//mlir:LLVMIRTransforms", diff --git a/utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel index 821b044..3013013 100644 --- a/utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel @@ -414,6 +414,7 @@ cc_library( "//mlir:SideEffectInterfaces", "//mlir:Support", "//mlir:TensorDialect", + "//mlir:TransformUtils", "//mlir:Transforms", "//mlir:ViewLikeInterface", ], @@ -540,6 +541,7 @@ cc_library( "//mlir:PDLInterpDialect", "//mlir:Pass", "//mlir:Support", + "//mlir:TransformUtils", "//mlir:Transforms", ], ) @@ -570,6 +572,7 @@ cc_library( "//mlir:ArithDialect", "//mlir:FuncDialect", "//mlir:IR", + "//mlir:InliningUtils", "//mlir:MathDialect", "//mlir:PDLDialect", "//mlir:PDLInterpDialect", @@ -579,6 +582,7 @@ cc_library( "//mlir:SPIRVDialect", "//mlir:SideEffectInterfaces", "//mlir:Support", + "//mlir:TransformUtils", "//mlir:Transforms", ], ) @@ -609,6 +613,7 @@ cc_library( "//mlir:Pass", "//mlir:SCFDialect", "//mlir:SCFTransforms", + "//mlir:TransformUtils", "//mlir:Transforms", ], ) @@ -621,6 +626,7 @@ cc_library( "//mlir:FuncDialect", "//mlir:Pass", "//mlir:SPIRVDialect", + "//mlir:TransformUtils", "//mlir:Transforms", "//mlir:VectorDialect", "//mlir:VectorToSPIRV", @@ -648,6 +654,7 @@ cc_library( "//mlir:SCFDialect", "//mlir:Support", "//mlir:TensorDialect", + "//mlir:TransformUtils", "//mlir:Transforms", "//mlir:ValueBoundsOpInterface", "//mlir:VectorDialect", @@ -704,6 +711,7 @@ cc_library( "//mlir:SCFToControlFlow", "//mlir:SPIRVDialect", "//mlir:ToLLVMIRTranslation", + "//mlir:TransformUtils", "//mlir:Transforms", "//mlir:VectorDialect", "//mlir:VectorToLLVM", @@ -736,6 +744,7 @@ cc_library( "//mlir:SCFTransforms", "//mlir:TensorDialect", "//mlir:TensorTransforms", + "//mlir:TransformUtils", "//mlir:Transforms", "//mlir:VectorDialect", "//mlir:VectorToSCF", @@ -777,6 +786,7 @@ cc_library( "//mlir:MathTransforms", "//mlir:Pass", "//mlir:SCFDialect", + "//mlir:TransformUtils", "//mlir:Transforms", "//mlir:VectorDialect", "//mlir:X86VectorDialect", @@ -793,6 +803,7 @@ cc_library( "//mlir:IR", "//mlir:MathDialect", "//mlir:Pass", + "//mlir:TransformUtils", "//mlir:Transforms", "//mlir:VCIXDialect", "//mlir:VectorDialect", @@ -812,6 +823,7 @@ cc_library( "//mlir:MemRefDialect", "//mlir:MemRefTransforms", "//mlir:Pass", + "//mlir:TransformUtils", "//mlir:Transforms", "//mlir:VectorDialect", "//mlir:VectorTransforms", @@ -833,6 +845,7 @@ cc_library( "//mlir:Pass", "//mlir:SPIRVDialect", "//mlir:Support", + "//mlir:TransformUtils", "//mlir:Transforms", ], ) @@ -856,6 +869,7 @@ cc_library( "//mlir:Pass", "//mlir:SCFDialect", "//mlir:Support", + "//mlir:TransformUtils", "//mlir:Transforms", ], ) @@ -875,6 +889,7 @@ cc_library( "//mlir:SCFDialect", "//mlir:SCFTransforms", "//mlir:SCFUtils", + "//mlir:TransformUtils", "//mlir:Transforms", ], ) @@ -890,6 +905,7 @@ cc_library( "//mlir:LLVMDialect", "//mlir:MathDialect", "//mlir:Pass", + "//mlir:TransformUtils", "//mlir:Transforms", "//mlir:VectorDialect", ], @@ -906,6 +922,7 @@ cc_library( "//mlir:IR", "//mlir:Pass", "//mlir:Support", + "//mlir:TransformUtils", "//mlir:Transforms", ], ) @@ -951,6 +968,7 @@ cc_library( "//mlir:LLVMCommonConversion", "//mlir:LLVMDialect", "//mlir:Pass", + "//mlir:TransformUtils", "//mlir:Transforms", ], ) @@ -1000,6 +1018,7 @@ cc_library( "//mlir:FuncTransforms", "//mlir:IR", "//mlir:Pass", + "//mlir:TransformUtils", "//mlir:Transforms", ], ) @@ -1017,6 +1036,7 @@ cc_library( "//mlir:TensorTransforms", "//mlir:TransformDialect", "//mlir:TransformDialectInterfaces", + "//mlir:TransformUtils", "//mlir:Transforms", ], ) @@ -1040,6 +1060,7 @@ cc_library( "//mlir:SCFDialect", "//mlir:Support", "//mlir:TensorDialect", + "//mlir:TransformUtils", "//mlir:Transforms", "//mlir:VectorDialect", "//mlir:VectorToSCF", @@ -1059,6 +1080,7 @@ cc_library( "//mlir:Pass", "//mlir:TensorDialect", "//mlir:TosaDialect", + "//mlir:TransformUtils", "//mlir:Transforms", ], ) @@ -1114,6 +1136,7 @@ cc_library( "//mlir:Parser", "//mlir:Pass", "//mlir:Support", + "//mlir:TransformUtils", "//mlir:Transforms", ], ) |