[Mlir-commits] [mlir] 8f2378d - [mlir][EmitC] Add builders for call_opaque op (#80879)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Feb 8 02:27:12 PST 2024


Author: Simon Camphausen
Date: 2024-02-08T11:27:08+01:00
New Revision: 8f2378d7fcf19ea00fbd3366c2125569ef084f93

URL: https://github.com/llvm/llvm-project/commit/8f2378d7fcf19ea00fbd3366c2125569ef084f93
DIFF: https://github.com/llvm/llvm-project/commit/8f2378d7fcf19ea00fbd3366c2125569ef084f93.diff

LOG: [mlir][EmitC] Add builders for call_opaque op (#80879)

This allows to omit the default valued attributes and therefore write
more compact code.

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/EmitC/IR/EmitC.td

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/EmitC/IR/EmitC.td b/mlir/include/mlir/Dialect/EmitC/IR/EmitC.td
index 39cc360cef41d4..c50fdf397a0fec 100644
--- a/mlir/include/mlir/Dialect/EmitC/IR/EmitC.td
+++ b/mlir/include/mlir/Dialect/EmitC/IR/EmitC.td
@@ -122,6 +122,19 @@ def EmitC_CallOpaqueOp : EmitC_Op<"call_opaque", []> {
     Variadic<AnyType>:$operands
   );
   let results = (outs Variadic<AnyType>);
+  let builders = [
+    OpBuilder<(ins
+      "::mlir::TypeRange":$resultTypes,
+      "::llvm::StringRef":$callee,
+      "::mlir::ValueRange":$operands,
+      CArg<"::mlir::ArrayAttr", "{}">:$args,
+      CArg<"::mlir::ArrayAttr", "{}">:$template_args), [{
+        build($_builder, $_state, resultTypes, callee, args, template_args,
+            operands);
+      }]
+    >
+  ];
+
   let assemblyFormat = [{
     $callee `(` $operands `)` attr-dict `:` functional-type($operands, results)
   }];


        


More information about the Mlir-commits mailing list