Skip to content

Commit c9c1b01

Browse files
author
Simon Camphausen
committed
[mlir][EmitC] Add builders for call_opaque op
1 parent a628f68 commit c9c1b01

File tree

1 file changed

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

1 file changed

+34
-0
lines changed

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

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,40 @@ 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::ArrayRef<Attribute>":$args,
130+
"::mlir::ArrayRef<Attribute>":$template_args,
131+
"::mlir::ValueRange":$operands), [{
132+
build($_builder, $_state, resultTypes, callee,
133+
$_builder.getArrayAttr(args), $_builder.getArrayAttr(template_args),
134+
operands);
135+
}]
136+
>,
137+
OpBuilder<(ins
138+
"::mlir::TypeRange":$resultTypes,
139+
"::llvm::StringRef":$callee,
140+
"::mlir::ValueRange":$operands,
141+
CArg<"::mlir::ArrayAttr", "{}">:$args,
142+
CArg<"::mlir::ArrayAttr", "{}">:$template_args), [{
143+
build($_builder, $_state, resultTypes, callee, args, template_args,
144+
operands);
145+
}]
146+
>,
147+
OpBuilder<(ins
148+
"::mlir::TypeRange":$resultTypes,
149+
"::llvm::StringRef":$callee,
150+
"::mlir::ValueRange":$operands,
151+
CArg<"::mlir::ArrayRef<Attribute>", "{}">:$args,
152+
CArg<"::mlir::ArrayRef<Attribute>", "{}">:$template_args), [{
153+
build($_builder, $_state, resultTypes, callee, args, template_args,
154+
operands);
155+
}]
156+
>
157+
];
158+
125159
let assemblyFormat = [{
126160
$callee `(` $operands `)` attr-dict `:` functional-type($operands, results)
127161
}];

0 commit comments

Comments
 (0)