From 9673c5213afebebf26abca6d67dd81546a39a136 Mon Sep 17 00:00:00 2001 From: Mircea Trofin Date: Thu, 1 May 2025 08:45:10 -0700 Subject: [PATCH] [mlir][EmitC] Add Bazel rules for conversions --- .../llvm-project-overlay/mlir/BUILD.bazel | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel index 1e8be2b8b94cb..8e732f67748d8 100644 --- a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel @@ -3801,6 +3801,7 @@ cc_library( ":ControlFlowToSCF", ":ControlFlowToSPIRV", ":ConversionPassIncGen", + ":ConvertToEmitC", ":ConvertToLLVM", ":FuncToEmitC", ":FuncToLLVM", @@ -3919,6 +3920,7 @@ cc_library( ":BufferizationInterfaces", ":ControlFlowDialect", ":ControlFlowInterfaces", + ":ConvertToEmitCInterface", ":DestinationStyleOpInterface", ":FunctionInterfaces", ":IR", @@ -4332,6 +4334,7 @@ cc_library( ":BytecodeOpInterface", ":CallOpInterfaces", ":ControlFlowInterfaces", + ":ConvertToEmitCInterface", ":ConvertToLLVMInterface", ":FuncIncGen", ":FunctionInterfaces", @@ -6755,6 +6758,7 @@ cc_library( ], deps = [ ":ConversionPassIncGen", + ":ConvertToEmitCInterface", ":EmitCDialect", ":FuncDialect", ":Pass", @@ -7506,6 +7510,7 @@ cc_library( deps = [ ":ArithDialect", ":ConversionPassIncGen", + ":ConvertToEmitCInterface", ":EmitCDialect", ":EmitCTransforms", ":IR", @@ -7657,6 +7662,34 @@ cc_library( ], ) +cc_library( + name = "ConvertToEmitCInterface", + hdrs = ["include/mlir/Conversion/ConvertToEmitC/ToEmitCInterface.h"], + includes = ["include"], + deps = [ + ":ConversionPassIncGen", + ":IR", + "//llvm:Support", + ], +) + +cc_library( + name = "ConvertToEmitC", + srcs = ["lib/Conversion/ConvertToEmitC/ConvertToEmitCPass.cpp"], + hdrs = ["include/mlir/Conversion/ConvertToEmitC/ConvertToEmitCPass.h"], + includes = ["include"], + deps = [ + ":ConversionPassIncGen", + ":ConvertToEmitCInterface", + ":EmitCDialect", + ":IR", + ":LLVMCommonConversion", + ":Pass", + ":TransformUtils", + "//llvm:Support", + ], +) + cc_library( name = "FuncToLLVM", srcs = [ @@ -7789,6 +7822,7 @@ cc_library( ], deps = [ ":ConversionPassIncGen", + ":ConvertToEmitCInterface", ":EmitCDialect", ":IR", ":MemRefDialect", @@ -7908,6 +7942,7 @@ cc_library( deps = [ ":ArithDialect", ":ConversionPassIncGen", + ":ConvertToEmitCInterface", ":EmitCDialect", ":EmitCTransforms", ":IR", @@ -8764,6 +8799,7 @@ cc_library( ":ControlFlowDialect", ":ControlFlowTransforms", ":ConversionPasses", + ":ConvertToEmitC", ":ConvertToLLVM", ":DLTIDialect", ":EmitCDialect", @@ -11768,6 +11804,7 @@ cc_library( ":CastInterfaces", ":CommonFolders", ":ControlFlowInterfaces", + ":ConvertToEmitCInterface", ":ConvertToLLVMInterface", ":DestinationStyleOpInterface", ":IR", @@ -12044,6 +12081,7 @@ cc_library( ":CallOpInterfaces", ":CastInterfaces", ":ControlFlowInterfaces", + ":ConvertToEmitCInterface", ":ConvertToLLVMInterface", ":CopyOpInterface", ":DialectUtils",