diff --git a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel --- a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel @@ -123,7 +123,10 @@ strip_include_prefix = "include", tbl_outs = [ ( - ["-gen-bytecode", "-bytecode-dialect=Builtin"], + [ + "-gen-bytecode", + "-bytecode-dialect=Builtin", + ], "include/mlir/IR/BuiltinDialectBytecode.cpp.inc", ), ], @@ -1219,7 +1222,7 @@ td_library( name = "AMDGPUTdFiles", - srcs = ["include/mlir/Dialect/AMDGPU/AMDGPU.td"], + srcs = ["include/mlir/Dialect/AMDGPU/IR/AMDGPU.td"], includes = ["include"], deps = [ ":SideEffectInterfacesTdFiles", @@ -1235,59 +1238,59 @@ "-gen-attrdef-decls", "-dialect=amdgpu", ], - "include/mlir/Dialect/AMDGPU/AMDGPUAttributes.h.inc", + "include/mlir/Dialect/AMDGPU/IR/AMDGPUAttributes.h.inc", ), ( [ "-gen-attrdef-defs", "-dialect=amdgpu", ], - "include/mlir/Dialect/AMDGPU/AMDGPUAttributes.cpp.inc", + "include/mlir/Dialect/AMDGPU/IR/AMDGPUAttributes.cpp.inc", ), ( [ "-gen-dialect-decls", "-dialect=amdgpu", ], - "include/mlir/Dialect/AMDGPU/AMDGPUDialect.h.inc", + "include/mlir/Dialect/AMDGPU/IR/AMDGPUDialect.h.inc", ), ( [ "-gen-dialect-defs", "-dialect=amdgpu", ], - "include/mlir/Dialect/AMDGPU/AMDGPUDialect.cpp.inc", + "include/mlir/Dialect/AMDGPU/IR/AMDGPUDialect.cpp.inc", ), ( ["-gen-enum-decls"], - "include/mlir/Dialect/AMDGPU/AMDGPUEnums.h.inc", + "include/mlir/Dialect/AMDGPU/IR/AMDGPUEnums.h.inc", ), ( ["-gen-enum-defs"], - "include/mlir/Dialect/AMDGPU/AMDGPUEnums.cpp.inc", + "include/mlir/Dialect/AMDGPU/IR/AMDGPUEnums.cpp.inc", ), ( ["-gen-op-decls"], - "include/mlir/Dialect/AMDGPU/AMDGPU.h.inc", + "include/mlir/Dialect/AMDGPU/IR/AMDGPU.h.inc", ), ( ["-gen-op-defs"], - "include/mlir/Dialect/AMDGPU/AMDGPU.cpp.inc", + "include/mlir/Dialect/AMDGPU/IR/AMDGPU.cpp.inc", ), ( ["-gen-op-doc"], - "g3doc/Dialects/AMDGPU/AMDGPU.md", + "g3doc/Dialects/AMDGPU/IR/AMDGPU.md", ), ], tblgen = ":mlir-tblgen", - td_file = "include/mlir/Dialect/AMDGPU/AMDGPU.td", + td_file = "include/mlir/Dialect/AMDGPU/IR/AMDGPU.td", deps = [":AMDGPUTdFiles"], ) cc_library( name = "AMDGPUDialect", srcs = ["lib/Dialect/AMDGPU/IR/AMDGPUDialect.cpp"], - hdrs = ["include/mlir/Dialect/AMDGPU/AMDGPUDialect.h"], + hdrs = ["include/mlir/Dialect/AMDGPU/IR/AMDGPUDialect.h"], includes = ["include"], deps = [ ":AMDGPUIncGen", @@ -1300,6 +1303,58 @@ ], ) +gentbl_cc_library( + name = "AMDGPUPassIncGen", + strip_include_prefix = "include", + tbl_outs = [ + ( + [ + "-gen-pass-decls", + "-name=AMDGPU", + ], + "include/mlir/Dialect/AMDGPU/Transforms/Passes.h.inc", + ), + ], + tblgen = ":mlir-tblgen", + td_file = "include/mlir/Dialect/AMDGPU/Transforms/Passes.td", + deps = [":PassBaseTdFiles"], +) + +cc_library( + name = "AMDGPUTransforms", + srcs = glob( + [ + "lib/Dialect/AMDGPU/Transforms/*.cpp", + "lib/Dialect/AMDGPU/Transforms/*.h", + ], + ), + hdrs = glob(["include/mlir/Dialect/AMDGPU/Transforms/*.h"]), + includes = ["include"], + deps = [ + ":AMDGPUDialect", + ":AMDGPUPassIncGen", + ":AMDGPUUtils", + ":ArithDialect", + ":ControlFlowDialect", + ":IR", + ":Pass", + ":TransformUtils", + ":Transforms", + ], +) + +cc_library( + name = "AMDGPUUtils", + srcs = glob(["lib/Dialect/AMDGPU/Utils/*.cpp"]), + hdrs = glob(["include/mlir/Dialect/AMDGPU/Utils/*.h"]), + includes = ["include"], + deps = [ + ":AMDGPUDialect", + ":Support", + "//llvm:Support", + ], +) + ##---------------------------------------------------------------------------## # EmitC dialect. ##---------------------------------------------------------------------------## @@ -1901,7 +1956,7 @@ ":InferTypeOpInterfaceTdFiles", ":OpBaseTdFiles", ":SideEffectInterfacesTdFiles", - ] + ], ) gentbl_cc_library( @@ -1988,11 +2043,11 @@ includes = ["include"], deps = [ ":Dialect", - ":InferTypeOpInterface", ":IR", ":IRDLIncGen", ":IRDLOpsIncGen", ":IRDLTypesIncGen", + ":InferTypeOpInterface", ":Support", "//llvm:Core", "//llvm:Support", @@ -3970,8 +4025,8 @@ ":CallOpInterfaces", ":ControlFlowInterfaces", ":DataLayoutInterfaces", - ":InferTypeOpInterface", ":IR", + ":InferTypeOpInterface", ":LLVMDialectInterfaceIncGen", ":LLVMIntrinsicOpsIncGen", ":LLVMOpsIncGen", @@ -4469,6 +4524,7 @@ includes = ["include"], deps = [ ":AMDGPUDialect", + ":AMDGPUUtils", ":ConversionPassIncGen", ":IR", ":LLVMCommonConversion", @@ -7300,6 +7356,7 @@ deps = [ ":AMDGPUDialect", ":AMDGPUToROCDL", + ":AMDGPUTransforms", ":AMXDialect", ":AMXTransforms", ":AffineDialect",