Skip to content

Commit 8f2378d

Browse files
author
Simon Camphausen
authored
[mlir][EmitC] Add builders for call_opaque op (#80879)
This allows to omit the default valued attributes and therefore write more compact code.
1 parent b85fe40 commit 8f2378d

File tree

1 file changed

+13
-0
lines changed
  • mlir/include/mlir/Dialect/EmitC/IR

1 file changed

+13
-0
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,19 @@ def EmitC_CallOpaqueOp : EmitC_Op<"call_opaque", []> {
122122
Variadic<AnyType>:$operands
123123
);
124124
let results = (outs Variadic<AnyType>);
125+
let builders = [
126+
OpBuilder<(ins
127+
"::mlir::TypeRange":$resultTypes,
128+
"::llvm::StringRef":$callee,
129+
"::mlir::ValueRange":$operands,
130+
CArg<"::mlir::ArrayAttr", "{}">:$args,
131+
CArg<"::mlir::ArrayAttr", "{}">:$template_args), [{
132+
build($_builder, $_state, resultTypes, callee, args, template_args,
133+
operands);
134+
}]
135+
>
136+
];
137+
125138
let assemblyFormat = [{
126139
$callee `(` $operands `)` attr-dict `:` functional-type($operands, results)
127140
}];

0 commit comments

Comments
 (0)