[mlir] ODS: change OpBuilderDAG to OpBuilder

We no longer have the non-DAG version.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D97856
This commit is contained in:
Alex Zinenko 2021-03-03 15:53:09 +01:00
parent 9d5af55589
commit 32c49c7d73
40 changed files with 328 additions and 328 deletions

View File

@ -36,7 +36,7 @@ class fir_SimpleOp<string mnemonic, list<OpTrait> traits>
} }
// Base builder for allocate operations // Base builder for allocate operations
def fir_AllocateOpBuilder : OpBuilderDAG<(ins def fir_AllocateOpBuilder : OpBuilder<(ins
"mlir::Type":$inType, "mlir::Type":$inType,
CArg<"mlir::ValueRange", "{}">:$lenParams, CArg<"mlir::ValueRange", "{}">:$lenParams,
CArg<"mlir::ValueRange", "{}">:$sizes, CArg<"mlir::ValueRange", "{}">:$sizes,
@ -48,7 +48,7 @@ def fir_AllocateOpBuilder : OpBuilderDAG<(ins
$_state.addAttributes(attributes); $_state.addAttributes(attributes);
}]>; }]>;
def fir_NamedAllocateOpBuilder : OpBuilderDAG<(ins def fir_NamedAllocateOpBuilder : OpBuilder<(ins
"mlir::Type":$inType, "mlir::Type":$inType,
"llvm::StringRef":$name, "llvm::StringRef":$name,
CArg<"mlir::ValueRange", "{}">:$lenParams, CArg<"mlir::ValueRange", "{}">:$lenParams,
@ -63,7 +63,7 @@ def fir_NamedAllocateOpBuilder : OpBuilderDAG<(ins
$_state.addAttributes(attributes); $_state.addAttributes(attributes);
}]>; }]>;
def fir_OneResultOpBuilder : OpBuilderDAG<(ins def fir_OneResultOpBuilder : OpBuilder<(ins
"mlir::Type":$resultType, "mlir::Type":$resultType,
"mlir::ValueRange":$operands, "mlir::ValueRange":$operands,
CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attributes), CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attributes),
@ -86,8 +86,8 @@ class fir_SimpleOneResultOp<string mnemonic, list<OpTrait> traits = []> :
let builders = [fir_OneResultOpBuilder]; let builders = [fir_OneResultOpBuilder];
} }
class fir_TwoBuilders<OpBuilderDAG b1, OpBuilderDAG b2> { class fir_TwoBuilders<OpBuilder b1, OpBuilder b2> {
list<OpBuilderDAG> builders = [b1, b2]; list<OpBuilder> builders = [b1, b2];
} }
class fir_AllocatableBaseOp<string mnemonic, list<OpTrait> traits = []> : class fir_AllocatableBaseOp<string mnemonic, list<OpTrait> traits = []> :
@ -309,7 +309,7 @@ def fir_LoadOp : fir_OneResultOp<"load"> {
let arguments = (ins Arg<AnyReferenceLike, "", [MemRead]>:$memref); let arguments = (ins Arg<AnyReferenceLike, "", [MemRead]>:$memref);
let builders = [OpBuilderDAG<(ins "mlir::Value":$refVal), let builders = [OpBuilder<(ins "mlir::Value":$refVal),
[{ [{
if (!refVal) { if (!refVal) {
mlir::emitError($_state.location, "LoadOp has null argument"); mlir::emitError($_state.location, "LoadOp has null argument");
@ -571,7 +571,7 @@ class fir_IntegralSwitchTerminatorOp<string mnemonic,
list<OpTrait> traits = []> : fir_SwitchTerminatorOp<mnemonic, traits> { list<OpTrait> traits = []> : fir_SwitchTerminatorOp<mnemonic, traits> {
let skipDefaultBuilders = 1; let skipDefaultBuilders = 1;
let builders = [OpBuilderDAG<(ins "mlir::Value":$selector, let builders = [OpBuilder<(ins "mlir::Value":$selector,
"llvm::ArrayRef<int64_t>":$compareOperands, "llvm::ArrayRef<int64_t>":$compareOperands,
"llvm::ArrayRef<mlir::Block *>":$destinations, "llvm::ArrayRef<mlir::Block *>":$destinations,
CArg<"llvm::ArrayRef<mlir::ValueRange>", "{}">:$destOperands, CArg<"llvm::ArrayRef<mlir::ValueRange>", "{}">:$destOperands,
@ -760,13 +760,13 @@ def fir_SelectCaseOp : fir_SwitchTerminatorOp<"select_case"> {
let skipDefaultBuilders = 1; let skipDefaultBuilders = 1;
let builders = [ let builders = [
OpBuilderDAG<(ins "mlir::Value":$selector, OpBuilder<(ins "mlir::Value":$selector,
"llvm::ArrayRef<mlir::Attribute>":$compareAttrs, "llvm::ArrayRef<mlir::Attribute>":$compareAttrs,
"llvm::ArrayRef<mlir::ValueRange>":$cmpOperands, "llvm::ArrayRef<mlir::ValueRange>":$cmpOperands,
"llvm::ArrayRef<mlir::Block *>":$destinations, "llvm::ArrayRef<mlir::Block *>":$destinations,
CArg<"llvm::ArrayRef<mlir::ValueRange>", "{}">:$destOperands, CArg<"llvm::ArrayRef<mlir::ValueRange>", "{}">:$destOperands,
CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attributes)>, CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attributes)>,
OpBuilderDAG<(ins "mlir::Value":$selector, OpBuilder<(ins "mlir::Value":$selector,
"llvm::ArrayRef<mlir::Attribute>":$compareAttrs, "llvm::ArrayRef<mlir::Attribute>":$compareAttrs,
"llvm::ArrayRef<mlir::Value>":$cmpOpList, "llvm::ArrayRef<mlir::Value>":$cmpOpList,
"llvm::ArrayRef<mlir::Block *>":$destinations, "llvm::ArrayRef<mlir::Block *>":$destinations,
@ -856,7 +856,7 @@ def fir_SelectTypeOp : fir_SwitchTerminatorOp<"select_type"> {
}]; }];
let skipDefaultBuilders = 1; let skipDefaultBuilders = 1;
let builders = [OpBuilderDAG<(ins "mlir::Value":$selector, let builders = [OpBuilder<(ins "mlir::Value":$selector,
"llvm::ArrayRef<mlir::Attribute>":$typeOperands, "llvm::ArrayRef<mlir::Attribute>":$typeOperands,
"llvm::ArrayRef<mlir::Block *>":$destinations, "llvm::ArrayRef<mlir::Block *>":$destinations,
CArg<"llvm::ArrayRef<mlir::ValueRange>", "{}">:$destOperands, CArg<"llvm::ArrayRef<mlir::ValueRange>", "{}">:$destOperands,
@ -1027,7 +1027,7 @@ def fir_EmboxOp : fir_Op<"embox", [NoSideEffect, AttrSizedOperandSegments]> {
let results = (outs fir_BoxType); let results = (outs fir_BoxType);
let builders = [ let builders = [
OpBuilderDAG<(ins "llvm::ArrayRef<mlir::Type>":$resultTypes, OpBuilder<(ins "llvm::ArrayRef<mlir::Type>":$resultTypes,
"mlir::Value":$memref, CArg<"mlir::Value", "{}">:$shape, "mlir::Value":$memref, CArg<"mlir::Value", "{}">:$shape,
CArg<"mlir::Value", "{}">:$slice, CArg<"mlir::Value", "{}">:$slice,
CArg<"mlir::ValueRange", "{}">:$lenParams), CArg<"mlir::ValueRange", "{}">:$lenParams),
@ -1812,7 +1812,7 @@ def fir_CoordinateOp : fir_Op<"coordinate_of", [NoSideEffect]> {
let verifier = [{ return ::verify(*this); }]; let verifier = [{ return ::verify(*this); }];
let builders = [ let builders = [
OpBuilderDAG<(ins "mlir::Type":$resultType, OpBuilder<(ins "mlir::Type":$resultType,
"mlir::Value":$ref, "mlir::ValueRange":$coor), "mlir::Value":$ref, "mlir::ValueRange":$coor),
[{ return build($_builder, $_state, resultType, ref, coor, [{ return build($_builder, $_state, resultType, ref, coor,
mlir::TypeAttr::get(ref.getType())); }]>, mlir::TypeAttr::get(ref.getType())); }]>,
@ -1924,7 +1924,7 @@ def fir_FieldIndexOp : fir_OneResultOp<"field_index", [NoSideEffect]> {
} }
}]; }];
let builders = [OpBuilderDAG<(ins "llvm::StringRef":$fieldName, let builders = [OpBuilder<(ins "llvm::StringRef":$fieldName,
"mlir::Type":$recTy, CArg<"mlir::ValueRange","{}">:$operands), "mlir::Type":$recTy, CArg<"mlir::ValueRange","{}">:$operands),
[{ [{
$_state.addAttribute(fieldAttrName(), $_state.addAttribute(fieldAttrName(),
@ -2233,7 +2233,7 @@ def fir_LenParamIndexOp : fir_OneResultOp<"len_param_index", [NoSideEffect]> {
<< ", " << (*this)->getAttr(typeAttrName()); << ", " << (*this)->getAttr(typeAttrName());
}]; }];
let builders = [OpBuilderDAG<(ins "llvm::StringRef":$fieldName, let builders = [OpBuilder<(ins "llvm::StringRef":$fieldName,
"mlir::Type":$recTy), "mlir::Type":$recTy),
[{ [{
$_state.addAttribute(fieldAttrName(), $_builder.getStringAttr(fieldName)); $_state.addAttribute(fieldAttrName(), $_builder.getStringAttr(fieldName));
@ -2267,7 +2267,7 @@ def fir_ResultOp : fir_Op<"result",
}]; }];
let arguments = (ins Variadic<AnyType>:$results); let arguments = (ins Variadic<AnyType>:$results);
let builders = [OpBuilderDAG<(ins), [{ /* do nothing */ }]>]; let builders = [OpBuilder<(ins), [{ /* do nothing */ }]>];
let assemblyFormat = "($results^ `:` type($results))? attr-dict"; let assemblyFormat = "($results^ `:` type($results))? attr-dict";
@ -2320,7 +2320,7 @@ def fir_DoLoopOp : region_Op<"do_loop",
let skipDefaultBuilders = 1; let skipDefaultBuilders = 1;
let builders = [ let builders = [
OpBuilderDAG<(ins "mlir::Value":$lowerBound, "mlir::Value":$upperBound, OpBuilder<(ins "mlir::Value":$lowerBound, "mlir::Value":$upperBound,
"mlir::Value":$step, CArg<"bool", "false">:$unordered, "mlir::Value":$step, CArg<"bool", "false">:$unordered,
CArg<"bool", "false">:$finalCountValue, CArg<"bool", "false">:$finalCountValue,
CArg<"mlir::ValueRange", "llvm::None">:$iterArgs, CArg<"mlir::ValueRange", "llvm::None">:$iterArgs,
@ -2405,8 +2405,8 @@ def fir_IfOp : region_Op<"if", [NoRegionArguments]> {
let skipDefaultBuilders = 1; let skipDefaultBuilders = 1;
let builders = [ let builders = [
OpBuilderDAG<(ins "mlir::Value":$cond, "bool":$withElseRegion)>, OpBuilder<(ins "mlir::Value":$cond, "bool":$withElseRegion)>,
OpBuilderDAG<(ins "mlir::TypeRange":$resultTypes, "mlir::Value":$cond, OpBuilder<(ins "mlir::TypeRange":$resultTypes, "mlir::Value":$cond,
"bool":$withElseRegion)> "bool":$withElseRegion)>
]; ];
@ -2470,7 +2470,7 @@ def fir_IterWhileOp : region_Op<"iterate_while",
let skipDefaultBuilders = 1; let skipDefaultBuilders = 1;
let builders = [ let builders = [
OpBuilderDAG<(ins "mlir::Value":$lowerBound, "mlir::Value":$upperBound, OpBuilder<(ins "mlir::Value":$lowerBound, "mlir::Value":$upperBound,
"mlir::Value":$step, "mlir::Value":$iterate, "mlir::Value":$step, "mlir::Value":$iterate,
CArg<"bool", "false">:$finalCountValue, CArg<"bool", "false">:$finalCountValue,
CArg<"mlir::ValueRange", "llvm::None">:$iterArgs, CArg<"mlir::ValueRange", "llvm::None">:$iterArgs,
@ -2549,7 +2549,7 @@ def fir_CallOp : fir_Op<"call", [CallOpInterface]> {
let printer = "printCallOp(p, *this);"; let printer = "printCallOp(p, *this);";
let builders = [ let builders = [
OpBuilderDAG<(ins "mlir::FuncOp":$callee, OpBuilder<(ins "mlir::FuncOp":$callee,
CArg<"mlir::ValueRange", "{}">:$operands), CArg<"mlir::ValueRange", "{}">:$operands),
[{ [{
$_state.addOperands(operands); $_state.addOperands(operands);
@ -2557,7 +2557,7 @@ def fir_CallOp : fir_Op<"call", [CallOpInterface]> {
$_builder.getSymbolRefAttr(callee)); $_builder.getSymbolRefAttr(callee));
$_state.addTypes(callee.getType().getResults()); $_state.addTypes(callee.getType().getResults());
}]>, }]>,
OpBuilderDAG<(ins "mlir::SymbolRefAttr":$callee, OpBuilder<(ins "mlir::SymbolRefAttr":$callee,
"llvm::ArrayRef<mlir::Type>":$results, "llvm::ArrayRef<mlir::Type>":$results,
CArg<"mlir::ValueRange", "{}">:$operands), CArg<"mlir::ValueRange", "{}">:$operands),
[{ [{
@ -2565,7 +2565,7 @@ def fir_CallOp : fir_Op<"call", [CallOpInterface]> {
$_state.addAttribute(calleeAttrName(), callee); $_state.addAttribute(calleeAttrName(), callee);
$_state.addTypes(results); $_state.addTypes(results);
}]>, }]>,
OpBuilderDAG<(ins "llvm::StringRef":$callee, OpBuilder<(ins "llvm::StringRef":$callee,
"llvm::ArrayRef<mlir::Type>":$results, "llvm::ArrayRef<mlir::Type>":$results,
CArg<"mlir::ValueRange", "{}">:$operands), CArg<"mlir::ValueRange", "{}">:$operands),
[{ [{
@ -2821,7 +2821,7 @@ def fir_CmpfOp : fir_Op<"cmpf",
let results = (outs AnyLogicalLike); let results = (outs AnyLogicalLike);
let builders = [OpBuilderDAG<(ins "mlir::CmpFPredicate":$predicate, let builders = [OpBuilder<(ins "mlir::CmpFPredicate":$predicate,
"mlir::Value":$lhs, "mlir::Value":$rhs), [{ "mlir::Value":$lhs, "mlir::Value":$rhs), [{
buildCmpFOp($_builder, $_state, predicate, lhs, rhs); buildCmpFOp($_builder, $_state, predicate, lhs, rhs);
}]>]; }]>];
@ -2929,7 +2929,7 @@ def fir_CmpcOp : fir_Op<"cmpc",
let printer = "printCmpcOp(p, *this);"; let printer = "printCmpcOp(p, *this);";
let builders = [OpBuilderDAG<(ins "mlir::CmpFPredicate":$predicate, let builders = [OpBuilder<(ins "mlir::CmpFPredicate":$predicate,
"mlir::Value":$lhs, "mlir::Value":$rhs), [{ "mlir::Value":$lhs, "mlir::Value":$rhs), [{
buildCmpCOp($_builder, $_state, predicate, lhs, rhs); buildCmpCOp($_builder, $_state, predicate, lhs, rhs);
}]>]; }]>];
@ -3062,7 +3062,7 @@ def fir_GenTypeDescOp : fir_OneResultOp<"gentypedesc", [NoSideEffect]> {
p.printOptionalAttrDict((*this)->getAttrs(), {"in_type"}); p.printOptionalAttrDict((*this)->getAttrs(), {"in_type"});
}]; }];
let builders = [OpBuilderDAG<(ins "mlir::TypeAttr":$inty)>]; let builders = [OpBuilder<(ins "mlir::TypeAttr":$inty)>];
let verifier = [{ let verifier = [{
mlir::Type resultTy = getType(); mlir::Type resultTy = getType();
@ -3166,21 +3166,21 @@ def fir_GlobalOp : fir_Op<"global", [IsolatedFromAbove, Symbol]> {
let skipDefaultBuilders = 1; let skipDefaultBuilders = 1;
let builders = [ let builders = [
OpBuilderDAG<(ins "llvm::StringRef":$name, "mlir::Type":$type, OpBuilder<(ins "llvm::StringRef":$name, "mlir::Type":$type,
CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attrs)>, CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attrs)>,
OpBuilderDAG<(ins "llvm::StringRef":$name, "bool":$isConstant, OpBuilder<(ins "llvm::StringRef":$name, "bool":$isConstant,
"mlir::Type":$type, "mlir::Type":$type,
CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attrs)>, CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attrs)>,
OpBuilderDAG<(ins "llvm::StringRef":$name, "mlir::Type":$type, OpBuilder<(ins "llvm::StringRef":$name, "mlir::Type":$type,
CArg<"mlir::StringAttr", "{}">:$linkage, CArg<"mlir::StringAttr", "{}">:$linkage,
CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attrs)>, CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attrs)>,
OpBuilderDAG<(ins "llvm::StringRef":$name, "bool":$isConstant, OpBuilder<(ins "llvm::StringRef":$name, "bool":$isConstant,
"mlir::Type":$type, CArg<"mlir::StringAttr", "{}">:$linkage, "mlir::Type":$type, CArg<"mlir::StringAttr", "{}">:$linkage,
CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attrs)>, CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attrs)>,
OpBuilderDAG<(ins "llvm::StringRef":$name, "mlir::Type":$type, OpBuilder<(ins "llvm::StringRef":$name, "mlir::Type":$type,
"mlir::Attribute":$initVal, CArg<"mlir::StringAttr", "{}">:$linkage, "mlir::Attribute":$initVal, CArg<"mlir::StringAttr", "{}">:$linkage,
CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attrs)>, CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attrs)>,
OpBuilderDAG<(ins "llvm::StringRef":$name, "bool":$isConstant, OpBuilder<(ins "llvm::StringRef":$name, "bool":$isConstant,
"mlir::Type":$type, "mlir::Attribute":$initVal, "mlir::Type":$type, "mlir::Attribute":$initVal,
CArg<"mlir::StringAttr", "{}">:$linkage, CArg<"mlir::StringAttr", "{}">:$linkage,
CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attrs)>, CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attrs)>,
@ -3344,7 +3344,7 @@ def fir_DispatchTableOp : fir_Op<"dispatch_table",
let skipDefaultBuilders = 1; let skipDefaultBuilders = 1;
let builders = [ let builders = [
OpBuilderDAG<(ins "llvm::StringRef":$name, "mlir::Type":$type, OpBuilder<(ins "llvm::StringRef":$name, "mlir::Type":$type,
CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attrs), CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attrs),
[{ [{
$_state.addAttribute(mlir::SymbolTable::getSymbolAttrName(), $_state.addAttribute(mlir::SymbolTable::getSymbolAttrName(),

View File

@ -451,7 +451,7 @@ def MyOp : Op<"my_op", []> {
let arguments = (ins F32Attr:$attr); let arguments = (ins F32Attr:$attr);
let builders = [ let builders = [
OpBuilderDAG<(ins "float":$val)> OpBuilder<(ins "float":$val)>
]; ];
} }
``` ```
@ -489,7 +489,7 @@ def MyOp : Op<"my_op", []> {
let arguments = (ins F32Attr:$attr); let arguments = (ins F32Attr:$attr);
let builders = [ let builders = [
OpBuilderDAG<(ins "float":$val), [{ OpBuilder<(ins "float":$val), [{
$_state.addAttribute("attr", $_builder.getF32FloatAttr(val)); $_state.addAttribute("attr", $_builder.getF32FloatAttr(val));
}]> }]>
]; ];
@ -511,7 +511,7 @@ def MyOp : Op<"my_op", []> {
let arguments = (ins F32Attr:$attr); let arguments = (ins F32Attr:$attr);
let builders = [ let builders = [
OpBuilderDAG<(ins CArg<"float", "0.5f">:$val), [{ OpBuilder<(ins CArg<"float", "0.5f">:$val), [{
$_state.addAttribute("attr", $_builder.getF32FloatAttr(val)); $_state.addAttribute("attr", $_builder.getF32FloatAttr(val));
}]> }]>
]; ];

View File

@ -492,14 +492,14 @@ def ConstantOp : Toy_Op<"constant"> {
// using `builder.create<ConstantOp>(...)`. // using `builder.create<ConstantOp>(...)`.
let builders = [ let builders = [
// Build a constant with a given constant tensor value. // Build a constant with a given constant tensor value.
OpBuilderDAG<(ins "DenseElementsAttr":$value), [{ OpBuilder<(ins "DenseElementsAttr":$value), [{
// Call into an autogenerated `build` method. // Call into an autogenerated `build` method.
build(builder, result, value.getType(), value); build(builder, result, value.getType(), value);
}]>, }]>,
// Build a constant with a given constant floating-point value. This builder // Build a constant with a given constant floating-point value. This builder
// creates a declaration for `ConstantOp::build` with the given parameters. // creates a declaration for `ConstantOp::build` with the given parameters.
OpBuilderDAG<(ins "double":$value)> OpBuilder<(ins "double":$value)>
]; ];
} }
``` ```

View File

@ -68,12 +68,12 @@ def ConstantOp : Toy_Op<"constant", [NoSideEffect]> {
// using `builder.create<ConstantOp>(...)`. // using `builder.create<ConstantOp>(...)`.
let builders = [ let builders = [
// Build a constant with a given constant tensor value. // Build a constant with a given constant tensor value.
OpBuilderDAG<(ins "DenseElementsAttr":$value), [{ OpBuilder<(ins "DenseElementsAttr":$value), [{
build($_builder, $_state, value.getType(), value); build($_builder, $_state, value.getType(), value);
}]>, }]>,
// Build a constant with a given constant floating-point value. // Build a constant with a given constant floating-point value.
OpBuilderDAG<(ins "double":$value)> OpBuilder<(ins "double":$value)>
]; ];
// Invoke a static verify method to verify this constant operation. // Invoke a static verify method to verify this constant operation.
@ -96,7 +96,7 @@ def AddOp : Toy_Op<"add"> {
// Allow building an AddOp with from the two input operands. // Allow building an AddOp with from the two input operands.
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$lhs, "Value":$rhs)> OpBuilder<(ins "Value":$lhs, "Value":$rhs)>
]; ];
} }
@ -131,7 +131,7 @@ def GenericCallOp : Toy_Op<"generic_call"> {
// Add custom build methods for the generic call operation. // Add custom build methods for the generic call operation.
let builders = [ let builders = [
OpBuilderDAG<(ins "StringRef":$callee, "ArrayRef<Value>":$arguments)> OpBuilder<(ins "StringRef":$callee, "ArrayRef<Value>":$arguments)>
]; ];
} }
@ -151,7 +151,7 @@ def MulOp : Toy_Op<"mul"> {
// Allow building a MulOp with from the two input operands. // Allow building a MulOp with from the two input operands.
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$lhs, "Value":$rhs)> OpBuilder<(ins "Value":$lhs, "Value":$rhs)>
]; ];
} }
@ -215,7 +215,7 @@ def ReturnOp : Toy_Op<"return", [NoSideEffect, HasParent<"FuncOp">,
// Allow building a ReturnOp with no return operand. // Allow building a ReturnOp with no return operand.
let builders = [ let builders = [
OpBuilderDAG<(ins), [{ build($_builder, $_state, llvm::None); }]> OpBuilder<(ins), [{ build($_builder, $_state, llvm::None); }]>
]; ];
// Provide extra utility definitions on the c++ operation class definition. // Provide extra utility definitions on the c++ operation class definition.
@ -239,7 +239,7 @@ def TransposeOp : Toy_Op<"transpose"> {
// Allow building a TransposeOp with from the input operand. // Allow building a TransposeOp with from the input operand.
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$input)> OpBuilder<(ins "Value":$input)>
]; ];
// Invoke a static verify method to verify this transpose operation. // Invoke a static verify method to verify this transpose operation.

View File

@ -67,12 +67,12 @@ def ConstantOp : Toy_Op<"constant", [NoSideEffect]> {
// using `builder.create<ConstantOp>(...)`. // using `builder.create<ConstantOp>(...)`.
let builders = [ let builders = [
// Build a constant with a given constant tensor value. // Build a constant with a given constant tensor value.
OpBuilderDAG<(ins "DenseElementsAttr":$value), [{ OpBuilder<(ins "DenseElementsAttr":$value), [{
build($_builder, $_state, value.getType(), value); build($_builder, $_state, value.getType(), value);
}]>, }]>,
// Build a constant with a given constant floating-point value. // Build a constant with a given constant floating-point value.
OpBuilderDAG<(ins "double":$value)> OpBuilder<(ins "double":$value)>
]; ];
// Invoke a static verify method to verify this constant operation. // Invoke a static verify method to verify this constant operation.
@ -95,7 +95,7 @@ def AddOp : Toy_Op<"add", [NoSideEffect]> {
// Allow building an AddOp with from the two input operands. // Allow building an AddOp with from the two input operands.
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$lhs, "Value":$rhs)> OpBuilder<(ins "Value":$lhs, "Value":$rhs)>
]; ];
} }
@ -130,7 +130,7 @@ def GenericCallOp : Toy_Op<"generic_call"> {
// Add custom build methods for the generic call operation. // Add custom build methods for the generic call operation.
let builders = [ let builders = [
OpBuilderDAG<(ins "StringRef":$callee, "ArrayRef<Value>":$arguments)> OpBuilder<(ins "StringRef":$callee, "ArrayRef<Value>":$arguments)>
]; ];
} }
@ -150,7 +150,7 @@ def MulOp : Toy_Op<"mul", [NoSideEffect]> {
// Allow building a MulOp with from the two input operands. // Allow building a MulOp with from the two input operands.
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$lhs, "Value":$rhs)> OpBuilder<(ins "Value":$lhs, "Value":$rhs)>
]; ];
} }
@ -217,7 +217,7 @@ def ReturnOp : Toy_Op<"return", [NoSideEffect, HasParent<"FuncOp">,
// Allow building a ReturnOp with no return operand. // Allow building a ReturnOp with no return operand.
let builders = [ let builders = [
OpBuilderDAG<(ins), [{ build($_builder, $_state, llvm::None); }]> OpBuilder<(ins), [{ build($_builder, $_state, llvm::None); }]>
]; ];
// Provide extra utility definitions on the c++ operation class definition. // Provide extra utility definitions on the c++ operation class definition.
@ -244,7 +244,7 @@ def TransposeOp : Toy_Op<"transpose", [NoSideEffect]> {
// Allow building a TransposeOp with from the input operand. // Allow building a TransposeOp with from the input operand.
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$input)> OpBuilder<(ins "Value":$input)>
]; ];
// Invoke a static verify method to verify this transpose operation. // Invoke a static verify method to verify this transpose operation.

View File

@ -70,12 +70,12 @@ def ConstantOp : Toy_Op<"constant", [NoSideEffect]> {
// using `builder.create<ConstantOp>(...)`. // using `builder.create<ConstantOp>(...)`.
let builders = [ let builders = [
// Build a constant with a given constant tensor value. // Build a constant with a given constant tensor value.
OpBuilderDAG<(ins "DenseElementsAttr":$value), [{ OpBuilder<(ins "DenseElementsAttr":$value), [{
build($_builder, $_state, value.getType(), value); build($_builder, $_state, value.getType(), value);
}]>, }]>,
// Build a constant with a given constant floating-point value. // Build a constant with a given constant floating-point value.
OpBuilderDAG<(ins "double":$value)> OpBuilder<(ins "double":$value)>
]; ];
// Invoke a static verify method to verify this constant operation. // Invoke a static verify method to verify this constant operation.
@ -99,7 +99,7 @@ def AddOp : Toy_Op<"add",
// Allow building an AddOp with from the two input operands. // Allow building an AddOp with from the two input operands.
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$lhs, "Value":$rhs)> OpBuilder<(ins "Value":$lhs, "Value":$rhs)>
]; ];
} }
@ -156,7 +156,7 @@ def GenericCallOp : Toy_Op<"generic_call",
// Add custom build methods for the generic call operation. // Add custom build methods for the generic call operation.
let builders = [ let builders = [
OpBuilderDAG<(ins "StringRef":$callee, "ArrayRef<Value>":$arguments)> OpBuilder<(ins "StringRef":$callee, "ArrayRef<Value>":$arguments)>
]; ];
} }
@ -177,7 +177,7 @@ def MulOp : Toy_Op<"mul",
// Allow building a MulOp with from the two input operands. // Allow building a MulOp with from the two input operands.
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$lhs, "Value":$rhs)> OpBuilder<(ins "Value":$lhs, "Value":$rhs)>
]; ];
} }
@ -244,7 +244,7 @@ def ReturnOp : Toy_Op<"return", [NoSideEffect, HasParent<"FuncOp">,
// Allow building a ReturnOp with no return operand. // Allow building a ReturnOp with no return operand.
let builders = [ let builders = [
OpBuilderDAG<(ins), [{ build($_builder, $_state, llvm::None); }]> OpBuilder<(ins), [{ build($_builder, $_state, llvm::None); }]>
]; ];
// Provide extra utility definitions on the c++ operation class definition. // Provide extra utility definitions on the c++ operation class definition.
@ -272,7 +272,7 @@ def TransposeOp : Toy_Op<"transpose",
// Allow building a TransposeOp with from the input operand. // Allow building a TransposeOp with from the input operand.
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$input)> OpBuilder<(ins "Value":$input)>
]; ];
// Invoke a static verify method to verify this transpose operation. // Invoke a static verify method to verify this transpose operation.

View File

@ -70,12 +70,12 @@ def ConstantOp : Toy_Op<"constant", [NoSideEffect]> {
// using `builder.create<ConstantOp>(...)`. // using `builder.create<ConstantOp>(...)`.
let builders = [ let builders = [
// Build a constant with a given constant tensor value. // Build a constant with a given constant tensor value.
OpBuilderDAG<(ins "DenseElementsAttr":$value), [{ OpBuilder<(ins "DenseElementsAttr":$value), [{
build($_builder, $_state, value.getType(), value); build($_builder, $_state, value.getType(), value);
}]>, }]>,
// Build a constant with a given constant floating-point value. // Build a constant with a given constant floating-point value.
OpBuilderDAG<(ins "double":$value)> OpBuilder<(ins "double":$value)>
]; ];
// Invoke a static verify method to verify this constant operation. // Invoke a static verify method to verify this constant operation.
@ -99,7 +99,7 @@ def AddOp : Toy_Op<"add",
// Allow building an AddOp with from the two input operands. // Allow building an AddOp with from the two input operands.
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$lhs, "Value":$rhs)> OpBuilder<(ins "Value":$lhs, "Value":$rhs)>
]; ];
} }
@ -156,7 +156,7 @@ def GenericCallOp : Toy_Op<"generic_call",
// Add custom build methods for the generic call operation. // Add custom build methods for the generic call operation.
let builders = [ let builders = [
OpBuilderDAG<(ins "StringRef":$callee, "ArrayRef<Value>":$arguments)> OpBuilder<(ins "StringRef":$callee, "ArrayRef<Value>":$arguments)>
]; ];
} }
@ -177,7 +177,7 @@ def MulOp : Toy_Op<"mul",
// Allow building a MulOp with from the two input operands. // Allow building a MulOp with from the two input operands.
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$lhs, "Value":$rhs)> OpBuilder<(ins "Value":$lhs, "Value":$rhs)>
]; ];
} }
@ -245,7 +245,7 @@ def ReturnOp : Toy_Op<"return", [NoSideEffect, HasParent<"FuncOp">,
// Allow building a ReturnOp with no return operand. // Allow building a ReturnOp with no return operand.
let builders = [ let builders = [
OpBuilderDAG<(ins), [{ build($_builder, $_state, llvm::None); }]> OpBuilder<(ins), [{ build($_builder, $_state, llvm::None); }]>
]; ];
// Provide extra utility definitions on the c++ operation class definition. // Provide extra utility definitions on the c++ operation class definition.
@ -273,7 +273,7 @@ def TransposeOp : Toy_Op<"transpose",
// Allow building a TransposeOp with from the input operand. // Allow building a TransposeOp with from the input operand.
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$input)> OpBuilder<(ins "Value":$input)>
]; ];
// Invoke a static verify method to verify this transpose operation. // Invoke a static verify method to verify this transpose operation.

View File

@ -70,12 +70,12 @@ def ConstantOp : Toy_Op<"constant", [NoSideEffect]> {
// using `builder.create<ConstantOp>(...)`. // using `builder.create<ConstantOp>(...)`.
let builders = [ let builders = [
// Build a constant with a given constant tensor value. // Build a constant with a given constant tensor value.
OpBuilderDAG<(ins "DenseElementsAttr":$value), [{ OpBuilder<(ins "DenseElementsAttr":$value), [{
build($_builder, $_state, value.getType(), value); build($_builder, $_state, value.getType(), value);
}]>, }]>,
// Build a constant with a given constant floating-point value. // Build a constant with a given constant floating-point value.
OpBuilderDAG<(ins "double":$value)> OpBuilder<(ins "double":$value)>
]; ];
// Invoke a static verify method to verify this constant operation. // Invoke a static verify method to verify this constant operation.
@ -99,7 +99,7 @@ def AddOp : Toy_Op<"add",
// Allow building an AddOp with from the two input operands. // Allow building an AddOp with from the two input operands.
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$lhs, "Value":$rhs)> OpBuilder<(ins "Value":$lhs, "Value":$rhs)>
]; ];
} }
@ -156,7 +156,7 @@ def GenericCallOp : Toy_Op<"generic_call",
// Add custom build methods for the generic call operation. // Add custom build methods for the generic call operation.
let builders = [ let builders = [
OpBuilderDAG<(ins "StringRef":$callee, "ArrayRef<Value>":$arguments)> OpBuilder<(ins "StringRef":$callee, "ArrayRef<Value>":$arguments)>
]; ];
} }
@ -177,7 +177,7 @@ def MulOp : Toy_Op<"mul",
// Allow building a MulOp with from the two input operands. // Allow building a MulOp with from the two input operands.
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$lhs, "Value":$rhs)> OpBuilder<(ins "Value":$lhs, "Value":$rhs)>
]; ];
} }
@ -245,7 +245,7 @@ def ReturnOp : Toy_Op<"return", [NoSideEffect, HasParent<"FuncOp">,
// Allow building a ReturnOp with no return operand. // Allow building a ReturnOp with no return operand.
let builders = [ let builders = [
OpBuilderDAG<(ins), [{ build($_builder, $_state, llvm::None); }]> OpBuilder<(ins), [{ build($_builder, $_state, llvm::None); }]>
]; ];
// Provide extra utility definitions on the c++ operation class definition. // Provide extra utility definitions on the c++ operation class definition.
@ -273,7 +273,7 @@ def TransposeOp : Toy_Op<"transpose",
// Allow building a TransposeOp with from the input operand. // Allow building a TransposeOp with from the input operand.
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$input)> OpBuilder<(ins "Value":$input)>
]; ];
// Invoke a static verify method to verify this transpose operation. // Invoke a static verify method to verify this transpose operation.

View File

@ -80,12 +80,12 @@ def ConstantOp : Toy_Op<"constant",
// using `builder.create<ConstantOp>(...)`. // using `builder.create<ConstantOp>(...)`.
let builders = [ let builders = [
// Build a constant with a given constant tensor value. // Build a constant with a given constant tensor value.
OpBuilderDAG<(ins "DenseElementsAttr":$value), [{ OpBuilder<(ins "DenseElementsAttr":$value), [{
build($_builder, $_state, value.getType(), value); build($_builder, $_state, value.getType(), value);
}]>, }]>,
// Build a constant with a given constant floating-point value. // Build a constant with a given constant floating-point value.
OpBuilderDAG<(ins "double":$value)> OpBuilder<(ins "double":$value)>
]; ];
// Invoke a static verify method to verify this constant operation. // Invoke a static verify method to verify this constant operation.
@ -112,7 +112,7 @@ def AddOp : Toy_Op<"add",
// Allow building an AddOp with from the two input operands. // Allow building an AddOp with from the two input operands.
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$lhs, "Value":$rhs)> OpBuilder<(ins "Value":$lhs, "Value":$rhs)>
]; ];
} }
@ -170,7 +170,7 @@ def GenericCallOp : Toy_Op<"generic_call",
// Add custom build methods for the generic call operation. // Add custom build methods for the generic call operation.
let builders = [ let builders = [
OpBuilderDAG<(ins "StringRef":$callee, "ArrayRef<Value>":$arguments)> OpBuilder<(ins "StringRef":$callee, "ArrayRef<Value>":$arguments)>
]; ];
} }
@ -191,7 +191,7 @@ def MulOp : Toy_Op<"mul",
// Allow building a MulOp with from the two input operands. // Allow building a MulOp with from the two input operands.
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$lhs, "Value":$rhs)> OpBuilder<(ins "Value":$lhs, "Value":$rhs)>
]; ];
} }
@ -259,7 +259,7 @@ def ReturnOp : Toy_Op<"return", [NoSideEffect, HasParent<"FuncOp">,
// Allow building a ReturnOp with no return operand. // Allow building a ReturnOp with no return operand.
let builders = [ let builders = [
OpBuilderDAG<(ins), [{ build($_builder, $_state, llvm::None); }]> OpBuilder<(ins), [{ build($_builder, $_state, llvm::None); }]>
]; ];
// Provide extra utility definitions on the c++ operation class definition. // Provide extra utility definitions on the c++ operation class definition.
@ -286,7 +286,7 @@ def StructAccessOp : Toy_Op<"struct_access", [NoSideEffect]> {
// Allow building a StructAccessOp with just a struct value and an index. // Allow building a StructAccessOp with just a struct value and an index.
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$input, "size_t":$index)> OpBuilder<(ins "Value":$input, "size_t":$index)>
]; ];
let verifier = [{ return ::verify(*this); }]; let verifier = [{ return ::verify(*this); }];
@ -334,7 +334,7 @@ def TransposeOp : Toy_Op<"transpose",
// Allow building a TransposeOp with from the input operand. // Allow building a TransposeOp with from the input operand.
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$input)> OpBuilder<(ins "Value":$input)>
]; ];
// Invoke a static verify method to verify this transpose operation. // Invoke a static verify method to verify this transpose operation.

View File

@ -72,7 +72,7 @@ def AffineApplyOp : Affine_Op<"apply", [NoSideEffect]> {
// has a constant builder. That way we wouldn't need to explicitly specify the // has a constant builder. That way we wouldn't need to explicitly specify the
// result types here. // result types here.
let builders = [ let builders = [
OpBuilderDAG<(ins "AffineMap":$map, "ValueRange":$mapOperands), OpBuilder<(ins "AffineMap":$map, "ValueRange":$mapOperands),
[{ [{
build($_builder, $_state, $_builder.getIndexType(), map, mapOperands); build($_builder, $_state, $_builder.getIndexType(), map, mapOperands);
}]> }]>
@ -213,11 +213,11 @@ def AffineForOp : Affine_Op<"for",
let skipDefaultBuilders = 1; let skipDefaultBuilders = 1;
let builders = [ let builders = [
OpBuilderDAG<(ins "int64_t":$lowerBound, "int64_t":$upperBound, OpBuilder<(ins "int64_t":$lowerBound, "int64_t":$upperBound,
CArg<"int64_t", "1">:$step, CArg<"ValueRange", "llvm::None">:$iterArgs, CArg<"int64_t", "1">:$step, CArg<"ValueRange", "llvm::None">:$iterArgs,
CArg<"function_ref<void(OpBuilder &, Location, Value, ValueRange)>", CArg<"function_ref<void(OpBuilder &, Location, Value, ValueRange)>",
"nullptr">:$bodyBuilder)>, "nullptr">:$bodyBuilder)>,
OpBuilderDAG<(ins "ValueRange":$lbOperands, "AffineMap":$lbMap, OpBuilder<(ins "ValueRange":$lbOperands, "AffineMap":$lbMap,
"ValueRange":$ubOperands, "AffineMap":$ubMap, CArg<"int64_t", "1">:$step, "ValueRange":$ubOperands, "AffineMap":$ubMap, CArg<"int64_t", "1">:$step,
CArg<"ValueRange", "llvm::None">:$iterArgs, CArg<"ValueRange", "llvm::None">:$iterArgs,
CArg<"function_ref<void(OpBuilder &, Location, Value, ValueRange)>", CArg<"function_ref<void(OpBuilder &, Location, Value, ValueRange)>",
@ -411,9 +411,9 @@ def AffineIfOp : Affine_Op<"if",
let skipDefaultBuilders = 1; let skipDefaultBuilders = 1;
let builders = [ let builders = [
OpBuilderDAG<(ins "IntegerSet":$set, "ValueRange":$args, OpBuilder<(ins "IntegerSet":$set, "ValueRange":$args,
"bool":$withElseRegion)>, "bool":$withElseRegion)>,
OpBuilderDAG<(ins "TypeRange":$resultTypes, "IntegerSet":$set, OpBuilder<(ins "TypeRange":$resultTypes, "IntegerSet":$set,
"ValueRange":$args, "bool":$withElseRegion)>, "ValueRange":$args, "bool":$withElseRegion)>,
]; ];
@ -506,11 +506,11 @@ def AffineLoadOp : AffineLoadOpBase<"load"> {
let builders = [ let builders = [
/// Builds an affine load op with the specified map and operands. /// Builds an affine load op with the specified map and operands.
OpBuilderDAG<(ins "AffineMap":$map, "ValueRange":$operands)>, OpBuilder<(ins "AffineMap":$map, "ValueRange":$operands)>,
/// Builds an affine load op with an identity map and operands. /// Builds an affine load op with an identity map and operands.
OpBuilderDAG<(ins "Value":$memref, CArg<"ValueRange", "{}">:$indices)>, OpBuilder<(ins "Value":$memref, CArg<"ValueRange", "{}">:$indices)>,
/// Builds an affine load op with the specified map and its operands. /// Builds an affine load op with the specified map and its operands.
OpBuilderDAG<(ins "Value":$memref, "AffineMap":$map, OpBuilder<(ins "Value":$memref, "AffineMap":$map,
"ValueRange":$mapOperands)> "ValueRange":$mapOperands)>
]; ];
@ -526,7 +526,7 @@ class AffineMinMaxOpBase<string mnemonic, list<OpTrait> traits = []> :
let results = (outs Index); let results = (outs Index);
let builders = [ let builders = [
OpBuilderDAG<(ins "AffineMap":$affineMap, "ValueRange":$mapOperands), OpBuilder<(ins "AffineMap":$affineMap, "ValueRange":$mapOperands),
[{ [{
build($_builder, $_state, $_builder.getIndexType(), affineMap, mapOperands); build($_builder, $_state, $_builder.getIndexType(), affineMap, mapOperands);
}]> }]>
@ -651,12 +651,12 @@ def AffineParallelOp : Affine_Op<"parallel",
let regions = (region SizedRegion<1>:$region); let regions = (region SizedRegion<1>:$region);
let builders = [ let builders = [
OpBuilderDAG<(ins "TypeRange":$resultTypes, OpBuilder<(ins "TypeRange":$resultTypes,
"ArrayRef<AtomicRMWKind>":$reductions, "ArrayRef<int64_t>":$ranges)>, "ArrayRef<AtomicRMWKind>":$reductions, "ArrayRef<int64_t>":$ranges)>,
OpBuilderDAG<(ins "TypeRange":$resultTypes, OpBuilder<(ins "TypeRange":$resultTypes,
"ArrayRef<AtomicRMWKind>":$reductions, "AffineMap":$lbMap, "ArrayRef<AtomicRMWKind>":$reductions, "AffineMap":$lbMap,
"ValueRange":$lbArgs, "AffineMap":$ubMap, "ValueRange":$ubArgs)>, "ValueRange":$lbArgs, "AffineMap":$ubMap, "ValueRange":$ubArgs)>,
OpBuilderDAG<(ins "TypeRange":$resultTypes, OpBuilder<(ins "TypeRange":$resultTypes,
"ArrayRef<AtomicRMWKind>":$reductions, "AffineMap":$lbMap, "ArrayRef<AtomicRMWKind>":$reductions, "AffineMap":$lbMap,
"ValueRange":$lbArgs, "AffineMap":$ubMap, "ValueRange":$ubArgs, "ValueRange":$lbArgs, "AffineMap":$ubMap, "ValueRange":$ubArgs,
"ArrayRef<int64_t>":$steps)> "ArrayRef<int64_t>":$steps)>
@ -726,7 +726,7 @@ def AffinePrefetchOp : Affine_Op<"prefetch",
BoolAttr:$isDataCache); BoolAttr:$isDataCache);
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$memref, "AffineMap":$map, OpBuilder<(ins "Value":$memref, "AffineMap":$map,
"ArrayRef<Value>":$mapOperands, "bool":$isWrite, "unsigned":$localityHint, "ArrayRef<Value>":$mapOperands, "bool":$isWrite, "unsigned":$localityHint,
"bool":$isDataCache), "bool":$isDataCache),
[{ [{
@ -830,9 +830,9 @@ def AffineStoreOp : AffineStoreOpBase<"store"> {
let skipDefaultBuilders = 1; let skipDefaultBuilders = 1;
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$valueToStore, "Value":$memref, OpBuilder<(ins "Value":$valueToStore, "Value":$memref,
"ValueRange":$indices)>, "ValueRange":$indices)>,
OpBuilderDAG<(ins "Value":$valueToStore, "Value":$memref, "AffineMap":$map, OpBuilder<(ins "Value":$valueToStore, "Value":$memref, "AffineMap":$map,
"ValueRange":$mapOperands)> "ValueRange":$mapOperands)>
]; ];
@ -861,7 +861,7 @@ def AffineYieldOp : Affine_Op<"yield", [NoSideEffect, Terminator, ReturnLike,
let arguments = (ins Variadic<AnyType>:$operands); let arguments = (ins Variadic<AnyType>:$operands);
let builders = [ let builders = [
OpBuilderDAG<(ins), [{ build($_builder, $_state, llvm::None); }]> OpBuilder<(ins), [{ build($_builder, $_state, llvm::None); }]>
]; ];
let assemblyFormat = "attr-dict ($operands^ `:` type($operands))?"; let assemblyFormat = "attr-dict ($operands^ `:` type($operands))?";
@ -911,13 +911,13 @@ def AffineVectorLoadOp : AffineLoadOpBase<"vector_load"> {
let builders = [ let builders = [
/// Builds an affine vector load op with the specified map and operands. /// Builds an affine vector load op with the specified map and operands.
OpBuilderDAG<(ins "VectorType":$resultType, "AffineMap":$map, OpBuilder<(ins "VectorType":$resultType, "AffineMap":$map,
"ValueRange":$operands)>, "ValueRange":$operands)>,
/// Builds an affine vector load op with an identity map and operands. /// Builds an affine vector load op with an identity map and operands.
OpBuilderDAG<(ins "VectorType":$resultType, "Value":$memref, OpBuilder<(ins "VectorType":$resultType, "Value":$memref,
CArg<"ValueRange", "{}">:$indices)>, CArg<"ValueRange", "{}">:$indices)>,
/// Builds an affine vector load op with the specified map and its operands. /// Builds an affine vector load op with the specified map and its operands.
OpBuilderDAG<(ins "VectorType":$resultType, "Value":$memref, OpBuilder<(ins "VectorType":$resultType, "Value":$memref,
"AffineMap":$map, "ValueRange":$mapOperands)> "AffineMap":$map, "ValueRange":$mapOperands)>
]; ];
@ -977,9 +977,9 @@ def AffineVectorStoreOp : AffineStoreOpBase<"vector_store"> {
let skipDefaultBuilders = 1; let skipDefaultBuilders = 1;
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$valueToStore, "Value":$memref, OpBuilder<(ins "Value":$valueToStore, "Value":$memref,
"ValueRange":$indices)>, "ValueRange":$indices)>,
OpBuilderDAG<(ins "Value":$valueToStore, "Value":$memref, "AffineMap":$map, OpBuilder<(ins "Value":$valueToStore, "Value":$memref, "AffineMap":$map,
"ValueRange":$mapOperands)> "ValueRange":$mapOperands)>
]; ];

View File

@ -85,7 +85,7 @@ def Async_ExecuteOp :
let skipDefaultBuilders = 1; let skipDefaultBuilders = 1;
let builders = [ let builders = [
OpBuilderDAG<(ins "TypeRange":$resultTypes, "ValueRange":$dependencies, OpBuilder<(ins "TypeRange":$resultTypes, "ValueRange":$dependencies,
"ValueRange":$operands, "ValueRange":$operands,
CArg<"function_ref<void(OpBuilder &, Location, ValueRange)>", CArg<"function_ref<void(OpBuilder &, Location, ValueRange)>",
"nullptr">:$bodyBuilder)>, "nullptr">:$bodyBuilder)>,
@ -136,7 +136,7 @@ def Async_AwaitOp : Async_Op<"await"> {
let skipDefaultBuilders = 1; let skipDefaultBuilders = 1;
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$operand, OpBuilder<(ins "Value":$operand,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>, CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>,
]; ];

View File

@ -197,7 +197,7 @@ def GPU_GPUFuncOp : GPU_Op<"func", [HasParent<"GPUModuleOp">,
let skipDefaultBuilders = 1; let skipDefaultBuilders = 1;
let builders = [ let builders = [
OpBuilderDAG<(ins "StringRef":$name, "FunctionType":$type, OpBuilder<(ins "StringRef":$name, "FunctionType":$type,
CArg<"TypeRange", "{}">:$workgroupAttributions, CArg<"TypeRange", "{}">:$workgroupAttributions,
CArg<"TypeRange", "{}">:$privateAttributions, CArg<"TypeRange", "{}">:$privateAttributions,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)> CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>
@ -377,7 +377,7 @@ def GPU_LaunchFuncOp : GPU_Op<"launch_func",
let skipDefaultBuilders = 1; let skipDefaultBuilders = 1;
let builders = [ let builders = [
OpBuilderDAG<(ins "GPUFuncOp":$kernelFunc, "KernelDim3":$gridSize, OpBuilder<(ins "GPUFuncOp":$kernelFunc, "KernelDim3":$gridSize,
"KernelDim3":$blockSize, "ValueRange":$kernelOperands)> "KernelDim3":$blockSize, "ValueRange":$kernelOperands)>
]; ];
@ -496,7 +496,7 @@ def GPU_LaunchOp : GPU_Op<"launch">,
let skipDefaultBuilders = 1; let skipDefaultBuilders = 1;
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$gridSizeX, "Value":$gridSizeY, OpBuilder<(ins "Value":$gridSizeX, "Value":$gridSizeY,
"Value":$gridSizeZ, "Value":$blockSizeX, "Value":$blockSizeY, "Value":$gridSizeZ, "Value":$blockSizeX, "Value":$blockSizeY,
"Value":$blockSizeZ)> "Value":$blockSizeZ)>
]; ];
@ -543,7 +543,7 @@ def GPU_ReturnOp : GPU_Op<"return", [HasParent<"GPUFuncOp">, NoSideEffect,
by an invocation of the `gpu.func`. by an invocation of the `gpu.func`.
}]; }];
let builders = [OpBuilderDAG<(ins), [{ // empty}]>]; let builders = [OpBuilder<(ins), [{ // empty}]>];
let parser = [{ return parseReturnOp(parser, result); }]; let parser = [{ return parseReturnOp(parser, result); }];
let printer = [{ p << getOperationName(); }]; let printer = [{ p << getOperationName(); }];
@ -722,7 +722,7 @@ def GPU_GPUModuleOp : GPU_Op<"module", [
``` ```
}]; }];
let builders = [OpBuilderDAG<(ins "StringRef":$name)>]; let builders = [OpBuilder<(ins "StringRef":$name)>];
let parser = [{ return ::parseGPUModuleOp(parser, result); }]; let parser = [{ return ::parseGPUModuleOp(parser, result); }];
let printer = [{ return ::print(p, *this); }]; let printer = [{ return ::print(p, *this); }];
let regions = (region SizedRegion<1>:$body); let regions = (region SizedRegion<1>:$body);

View File

@ -64,7 +64,7 @@ class LLVM_Builder<string builder> {
} }
def LLVM_OneResultOpBuilder : def LLVM_OneResultOpBuilder :
OpBuilderDAG<(ins "Type":$resultType, "ValueRange":$operands, OpBuilder<(ins "Type":$resultType, "ValueRange":$operands,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attributes), CArg<"ArrayRef<NamedAttribute>", "{}">:$attributes),
[{ [{
if (resultType) $_state.addTypes(resultType); if (resultType) $_state.addTypes(resultType);
@ -75,7 +75,7 @@ def LLVM_OneResultOpBuilder :
}]>; }]>;
def LLVM_ZeroResultOpBuilder : def LLVM_ZeroResultOpBuilder :
OpBuilderDAG<(ins "ValueRange":$operands, OpBuilder<(ins "ValueRange":$operands,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attributes), CArg<"ArrayRef<NamedAttribute>", "{}">:$attributes),
[{ [{
$_state.addOperands(operands); $_state.addOperands(operands);
@ -87,7 +87,7 @@ def LLVM_ZeroResultOpBuilder :
// Compatibility builder that takes an instance of wrapped llvm::VoidType // Compatibility builder that takes an instance of wrapped llvm::VoidType
// to indicate no result. // to indicate no result.
def LLVM_VoidResultTypeOpBuilder : def LLVM_VoidResultTypeOpBuilder :
OpBuilderDAG<(ins "Type":$resultType, "ValueRange":$operands, OpBuilder<(ins "Type":$resultType, "ValueRange":$operands,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attributes), CArg<"ArrayRef<NamedAttribute>", "{}">:$attributes),
[{ [{
assert(isCompatibleType(resultType) && "result must be an LLVM type"); assert(isCompatibleType(resultType) && "result must be an LLVM type");
@ -99,7 +99,7 @@ def LLVM_VoidResultTypeOpBuilder :
// Opaque builder used for terminator operations that contain successors. // Opaque builder used for terminator operations that contain successors.
def LLVM_TerminatorPassthroughOpBuilder : def LLVM_TerminatorPassthroughOpBuilder :
OpBuilderDAG<(ins "ValueRange":$operands, "SuccessorRange":$destinations, OpBuilder<(ins "ValueRange":$operands, "SuccessorRange":$destinations,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attributes), CArg<"ArrayRef<NamedAttribute>", "{}">:$attributes),
[{ [{
$_state.addOperands(operands); $_state.addOperands(operands);
@ -194,7 +194,7 @@ def LLVM_ICmpOp : LLVM_Op<"icmp", [NoSideEffect]> {
$res = builder.CreateICmp(getLLVMCmpPredicate($predicate), $lhs, $rhs); $res = builder.CreateICmp(getLLVMCmpPredicate($predicate), $lhs, $rhs);
}]; }];
let builders = [ let builders = [
OpBuilderDAG<(ins "ICmpPredicate":$predicate, "Value":$lhs, "Value":$rhs), OpBuilder<(ins "ICmpPredicate":$predicate, "Value":$lhs, "Value":$rhs),
[{ [{
build($_builder, $_state, IntegerType::get(lhs.getType().getContext(), 1), build($_builder, $_state, IntegerType::get(lhs.getType().getContext(), 1),
$_builder.getI64IntegerAttr(static_cast<int64_t>(predicate)), lhs, rhs); $_builder.getI64IntegerAttr(static_cast<int64_t>(predicate)), lhs, rhs);
@ -244,7 +244,7 @@ def LLVM_FCmpOp : LLVM_Op<"fcmp", [
$res = builder.CreateFCmp(getLLVMCmpPredicate($predicate), $lhs, $rhs); $res = builder.CreateFCmp(getLLVMCmpPredicate($predicate), $lhs, $rhs);
}]; }];
let builders = [ let builders = [
OpBuilderDAG<(ins "FCmpPredicate":$predicate, "Value":$lhs, "Value":$rhs, OpBuilder<(ins "FCmpPredicate":$predicate, "Value":$lhs, "Value":$rhs,
CArg<"FastmathFlags", "{}">:$fmf), CArg<"FastmathFlags", "{}">:$fmf),
[{ [{
build($_builder, $_state, IntegerType::get(lhs.getType().getContext(), 1), build($_builder, $_state, IntegerType::get(lhs.getType().getContext(), 1),
@ -301,7 +301,7 @@ def LLVM_AllocaOp : LLVM_Op<"alloca">, MemoryOpWithAlignmentBase {
$res = inst; $res = inst;
}]; }];
let builders = [ let builders = [
OpBuilderDAG<(ins "Type":$resultType, "Value":$arraySize, OpBuilder<(ins "Type":$resultType, "Value":$arraySize,
"unsigned":$alignment), "unsigned":$alignment),
[{ [{
if (alignment == 0) if (alignment == 0)
@ -335,13 +335,13 @@ def LLVM_LoadOp : LLVM_Op<"load">, MemoryOpWithAlignmentAndAttributes {
$res = inst; $res = inst;
}]; }];
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$addr, CArg<"unsigned", "0">:$alignment, OpBuilder<(ins "Value":$addr, CArg<"unsigned", "0">:$alignment,
CArg<"bool", "false">:$isVolatile, CArg<"bool", "false">:$isNonTemporal), CArg<"bool", "false">:$isVolatile, CArg<"bool", "false">:$isNonTemporal),
[{ [{
auto type = addr.getType().cast<LLVMPointerType>().getElementType(); auto type = addr.getType().cast<LLVMPointerType>().getElementType();
build($_builder, $_state, type, addr, alignment, isVolatile, isNonTemporal); build($_builder, $_state, type, addr, alignment, isVolatile, isNonTemporal);
}]>, }]>,
OpBuilderDAG<(ins "Type":$t, "Value":$addr, OpBuilder<(ins "Type":$t, "Value":$addr,
CArg<"unsigned", "0">:$alignment, CArg<"bool", "false">:$isVolatile, CArg<"unsigned", "0">:$alignment, CArg<"bool", "false">:$isVolatile,
CArg<"bool", "false">:$isNonTemporal)>]; CArg<"bool", "false">:$isNonTemporal)>];
let parser = [{ return parseLoadOp(parser, result); }]; let parser = [{ return parseLoadOp(parser, result); }];
@ -357,7 +357,7 @@ def LLVM_StoreOp : LLVM_Op<"store">, MemoryOpWithAlignmentAndAttributes {
auto *inst = builder.CreateStore($value, $addr, $volatile_); auto *inst = builder.CreateStore($value, $addr, $volatile_);
}] # setAlignmentCode # setNonTemporalMetadataCode; }] # setAlignmentCode # setNonTemporalMetadataCode;
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$value, "Value":$addr, OpBuilder<(ins "Value":$value, "Value":$addr,
CArg<"unsigned", "0">:$alignment, CArg<"bool", "false">:$isVolatile, CArg<"unsigned", "0">:$alignment, CArg<"bool", "false">:$isVolatile,
CArg<"bool", "false">:$isNonTemporal)> CArg<"bool", "false">:$isNonTemporal)>
]; ];
@ -429,14 +429,14 @@ def LLVM_InvokeOp : LLVM_Op<"invoke", [
AnySuccessor:$unwindDest); AnySuccessor:$unwindDest);
let builders = [ let builders = [
OpBuilderDAG<(ins "TypeRange":$tys, "FlatSymbolRefAttr":$callee, OpBuilder<(ins "TypeRange":$tys, "FlatSymbolRefAttr":$callee,
"ValueRange":$ops, "Block*":$normal, "ValueRange":$normalOps, "ValueRange":$ops, "Block*":$normal, "ValueRange":$normalOps,
"Block*":$unwind, "ValueRange":$unwindOps), "Block*":$unwind, "ValueRange":$unwindOps),
[{ [{
$_state.addAttribute("callee", callee); $_state.addAttribute("callee", callee);
build($_builder, $_state, tys, ops, normal, normalOps, unwind, unwindOps); build($_builder, $_state, tys, ops, normal, normalOps, unwind, unwindOps);
}]>, }]>,
OpBuilderDAG<(ins "TypeRange":$tys, "ValueRange":$ops, "Block*":$normal, OpBuilder<(ins "TypeRange":$tys, "ValueRange":$ops, "Block*":$normal,
"ValueRange":$normalOps, "Block*":$unwind, "ValueRange":$unwindOps), "ValueRange":$normalOps, "Block*":$unwind, "ValueRange":$unwindOps),
[{ [{
build($_builder, $_state, tys, /*callee=*/FlatSymbolRefAttr(), ops, normalOps, build($_builder, $_state, tys, /*callee=*/FlatSymbolRefAttr(), ops, normalOps,
@ -492,7 +492,7 @@ def LLVM_CallOp : LLVM_Op<"call",
DefaultValuedAttr<LLVM_FMFAttr, "{}">:$fastmathFlags); DefaultValuedAttr<LLVM_FMFAttr, "{}">:$fastmathFlags);
let results = (outs Variadic<LLVM_Type>); let results = (outs Variadic<LLVM_Type>);
let builders = [ let builders = [
OpBuilderDAG<(ins "LLVMFuncOp":$func, "ValueRange":$operands, OpBuilder<(ins "LLVMFuncOp":$func, "ValueRange":$operands,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attributes), CArg<"ArrayRef<NamedAttribute>", "{}">:$attributes),
[{ [{
Type resultType = func.getType().getReturnType(); Type resultType = func.getType().getReturnType();
@ -513,7 +513,7 @@ def LLVM_ExtractElementOp : LLVM_Op<"extractelement", [NoSideEffect]> {
$res = builder.CreateExtractElement($vector, $position); $res = builder.CreateExtractElement($vector, $position);
}]; }];
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$vector, "Value":$position, OpBuilder<(ins "Value":$vector, "Value":$position,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>]; CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>];
let parser = [{ return parseExtractElementOp(parser, result); }]; let parser = [{ return parseExtractElementOp(parser, result); }];
let printer = [{ printExtractElementOp(p, *this); }]; let printer = [{ printExtractElementOp(p, *this); }];
@ -548,7 +548,7 @@ def LLVM_InsertValueOp : LLVM_Op<"insertvalue", [NoSideEffect]> {
extractPosition($position)); extractPosition($position));
}]; }];
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$container, "Value":$value, "ArrayAttr":$position), OpBuilder<(ins "Value":$container, "Value":$value, "ArrayAttr":$position),
[{ [{
build($_builder, $_state, container.getType(), container, value, position); build($_builder, $_state, container.getType(), container, value, position);
}]>]; }]>];
@ -564,7 +564,7 @@ def LLVM_ShuffleVectorOp : LLVM_Op<"shufflevector", [NoSideEffect]> {
$res = builder.CreateShuffleVector($v1, $v2, mask); $res = builder.CreateShuffleVector($v1, $v2, mask);
}]; }];
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$v1, "Value":$v2, "ArrayAttr":$mask, OpBuilder<(ins "Value":$v1, "Value":$v2, "ArrayAttr":$mask,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>]; CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>];
let verifier = [{ let verifier = [{
auto type1 = v1().getType(); auto type1 = v1().getType();
@ -588,7 +588,7 @@ def LLVM_SelectOp
LLVM_Type:$trueValue, LLVM_Type:$falseValue); LLVM_Type:$trueValue, LLVM_Type:$falseValue);
let results = (outs LLVM_Type:$res); let results = (outs LLVM_Type:$res);
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$condition, "Value":$lhs, "Value":$rhs), OpBuilder<(ins "Value":$condition, "Value":$lhs, "Value":$rhs),
[{ [{
build($_builder, $_state, lhs.getType(), condition, lhs, rhs); build($_builder, $_state, lhs.getType(), condition, lhs, rhs);
}]>]; }]>];
@ -628,7 +628,7 @@ def LLVM_CondBrOp : LLVM_TerminatorOp<"cond_br",
}]; }];
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$condition, "Block *":$trueDest, OpBuilder<(ins "Value":$condition, "Block *":$trueDest,
"ValueRange":$trueOperands, "Block *":$falseDest, "ValueRange":$trueOperands, "Block *":$falseDest,
"ValueRange":$falseOperands, "ValueRange":$falseOperands,
CArg<"Optional<std::pair<uint32_t, uint32_t>>", "{}">:$weights), CArg<"Optional<std::pair<uint32_t, uint32_t>>", "{}">:$weights),
@ -642,7 +642,7 @@ def LLVM_CondBrOp : LLVM_TerminatorOp<"cond_br",
build($_builder, $_state, condition, trueOperands, falseOperands, weightsAttr, build($_builder, $_state, condition, trueOperands, falseOperands, weightsAttr,
trueDest, falseDest); trueDest, falseDest);
}]>, }]>,
OpBuilderDAG<(ins "Value":$condition, "Block *":$trueDest, OpBuilder<(ins "Value":$condition, "Block *":$trueDest,
"Block *":$falseDest, CArg<"ValueRange", "{}">:$falseOperands), "Block *":$falseDest, CArg<"ValueRange", "{}">:$falseOperands),
[{ [{
build($_builder, $_state, condition, trueDest, ValueRange(), falseDest, build($_builder, $_state, condition, trueDest, ValueRange(), falseDest,
@ -710,7 +710,7 @@ def LLVM_SwitchOp : LLVM_TerminatorOp<"switch",
}]; }];
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$value, OpBuilder<(ins "Value":$value,
"Block *":$defaultDestination, "Block *":$defaultDestination,
"ValueRange":$defaultOperands, "ValueRange":$defaultOperands,
CArg<"ArrayRef<int32_t>", "{}">:$caseValues, CArg<"ArrayRef<int32_t>", "{}">:$caseValues,
@ -809,7 +809,7 @@ def LLVM_AddressOfOp : LLVM_Op<"mlir.addressof"> {
}]; }];
let builders = [ let builders = [
OpBuilderDAG<(ins "GlobalOp":$global, OpBuilder<(ins "GlobalOp":$global,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs), CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs),
[{ [{
build($_builder, $_state, build($_builder, $_state,
@ -817,7 +817,7 @@ def LLVM_AddressOfOp : LLVM_Op<"mlir.addressof"> {
global.sym_name()); global.sym_name());
$_state.addAttributes(attrs); $_state.addAttributes(attrs);
}]>, }]>,
OpBuilderDAG<(ins "LLVMFuncOp":$func, OpBuilder<(ins "LLVMFuncOp":$func,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs), CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs),
[{ [{
build($_builder, $_state, build($_builder, $_state,
@ -976,7 +976,7 @@ def LLVM_GlobalOp : LLVM_Op<"mlir.global",
let regions = (region AnyRegion:$initializer); let regions = (region AnyRegion:$initializer);
let builders = [ let builders = [
OpBuilderDAG<(ins "Type":$type, "bool":$isConstant, "Linkage":$linkage, OpBuilder<(ins "Type":$type, "bool":$isConstant, "Linkage":$linkage,
"StringRef":$name, "Attribute":$value, CArg<"unsigned", "0">:$addrSpace, "StringRef":$name, "Attribute":$value, CArg<"unsigned", "0">:$addrSpace,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)> CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>
]; ];
@ -1050,7 +1050,7 @@ def LLVM_LLVMFuncOp : LLVM_Op<"func",
let skipDefaultBuilders = 1; let skipDefaultBuilders = 1;
let builders = [ let builders = [
OpBuilderDAG<(ins "StringRef":$name, "Type":$type, OpBuilder<(ins "StringRef":$name, "Type":$type,
CArg<"Linkage", "Linkage::External">:$linkage, CArg<"Linkage", "Linkage::External">:$linkage,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs, CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs,
CArg<"ArrayRef<DictionaryAttr>", "{}">:$argAttrs)> CArg<"ArrayRef<DictionaryAttr>", "{}">:$argAttrs)>

View File

@ -101,24 +101,24 @@ def Linalg_InitTensorOp : Linalg_Op<"init_tensor", [NoSideEffect]> {
}]; }];
let builders = [ let builders = [
OpBuilderDAG<(ins "ValueRange":$shape, OpBuilder<(ins "ValueRange":$shape,
"ArrayRef<int64_t>":$staticShape, "Type":$elementType), "ArrayRef<int64_t>":$staticShape, "Type":$elementType),
[{ [{
build($_builder, $_state, build($_builder, $_state,
InitTensorOp::inferResultType(staticShape, elementType), InitTensorOp::inferResultType(staticShape, elementType),
shape, $_builder.getI64ArrayAttr(staticShape)); shape, $_builder.getI64ArrayAttr(staticShape));
}]>, }]>,
OpBuilderDAG<(ins "ValueRange":$shape, "Type":$elementType), OpBuilder<(ins "ValueRange":$shape, "Type":$elementType),
[{ [{
SmallVector<int64_t, 4> staticShape( SmallVector<int64_t, 4> staticShape(
shape.size(), ShapedType::kDynamicSize); shape.size(), ShapedType::kDynamicSize);
build($_builder, $_state, shape, staticShape, elementType); build($_builder, $_state, shape, staticShape, elementType);
}]>, }]>,
OpBuilderDAG<(ins "ArrayRef<int64_t>":$staticShape, "Type":$elementType), OpBuilder<(ins "ArrayRef<int64_t>":$staticShape, "Type":$elementType),
[{ [{
build($_builder, $_state, ValueRange{}, staticShape, elementType); build($_builder, $_state, ValueRange{}, staticShape, elementType);
}]>, }]>,
OpBuilderDAG<(ins "ArrayRef<OpFoldResult>":$sizes, "Type":$elementType, OpBuilder<(ins "ArrayRef<OpFoldResult>":$sizes, "Type":$elementType,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)> CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>
]; ];
@ -260,15 +260,15 @@ def Linalg_PadTensorOp : Linalg_Op<"pad_tensor",
let builders = [ let builders = [
// Build a PadTensorOp with mixed static and dynamic entries. // Build a PadTensorOp with mixed static and dynamic entries.
OpBuilderDAG<(ins "Value":$source, "ArrayRef<int64_t>":$staticLow, OpBuilder<(ins "Value":$source, "ArrayRef<int64_t>":$staticLow,
"ArrayRef<int64_t>":$staticHigh, "ValueRange":$low, "ValueRange":$high, "ArrayRef<int64_t>":$staticHigh, "ValueRange":$low, "ValueRange":$high,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>, CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>,
// Build a PadTensorOp with all dynamic entries. // Build a PadTensorOp with all dynamic entries.
OpBuilderDAG<(ins "Value":$source, "ValueRange":$low, "ValueRange":$high, OpBuilder<(ins "Value":$source, "ValueRange":$low, "ValueRange":$high,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>, CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>,
// Build a PadTensorOp with mixed static and dynamic entries and custom // Build a PadTensorOp with mixed static and dynamic entries and custom
// result type. If the type passed is nullptr, it is inferred. // result type. If the type passed is nullptr, it is inferred.
OpBuilderDAG<(ins "Type":$resultType, "Value":$source, OpBuilder<(ins "Type":$resultType, "Value":$source,
"ArrayRef<OpFoldResult>":$low, "ArrayRef<OpFoldResult>":$high, "ArrayRef<OpFoldResult>":$low, "ArrayRef<OpFoldResult>":$high,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)> CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>
]; ];
@ -291,7 +291,7 @@ def Linalg_RangeOp :
```` ````
}]; }];
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$min, "Value":$max, "Value":$step), OpBuilder<(ins "Value":$min, "Value":$max, "Value":$step),
[{ [{
auto rangeType = RangeType::get($_builder.getContext()); auto rangeType = RangeType::get($_builder.getContext());
build($_builder, $_state, rangeType, min, max, step); build($_builder, $_state, rangeType, min, max, step);
@ -307,10 +307,10 @@ class Linalg_ReshapeLikeOp<string mnemonic, list<OpTrait> traits = []> :
let builders = [ let builders = [
// Builders for a contracting reshape whose result type is computed from // Builders for a contracting reshape whose result type is computed from
// `src` and `reassociation`. // `src` and `reassociation`.
OpBuilderDAG<(ins "Value":$src, OpBuilder<(ins "Value":$src,
"ArrayRef<ReassociationExprs>":$reassociation, "ArrayRef<ReassociationExprs>":$reassociation,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>, CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>,
OpBuilderDAG<(ins "Value":$src, OpBuilder<(ins "Value":$src,
"ArrayRef<ReassociationIndices>":$reassociation, "ArrayRef<ReassociationIndices>":$reassociation,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs), CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs),
[{ [{
@ -321,10 +321,10 @@ class Linalg_ReshapeLikeOp<string mnemonic, list<OpTrait> traits = []> :
// Builders for a reshape whose result type is passed explicitly. This may // Builders for a reshape whose result type is passed explicitly. This may
// be either a contracting or expanding reshape. // be either a contracting or expanding reshape.
OpBuilderDAG<(ins "Type":$resultType, "Value":$src, OpBuilder<(ins "Type":$resultType, "Value":$src,
"ArrayRef<ReassociationExprs>":$reassociation, "ArrayRef<ReassociationExprs>":$reassociation,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>, CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>,
OpBuilderDAG<(ins "Type":$resultType, "Value":$src, OpBuilder<(ins "Type":$resultType, "Value":$src,
"ArrayRef<ReassociationIndices>":$reassociation, "ArrayRef<ReassociationIndices>":$reassociation,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs), CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs),
[{ [{
@ -484,7 +484,7 @@ def Linalg_YieldOp : Linalg_Op<"yield", [NoSideEffect, ReturnLike, Terminator]>,
linalg.yield %f0, %f1 : f32, f32 linalg.yield %f0, %f1 : f32, f32
``` ```
}]; }];
let builders = [OpBuilderDAG<(ins), [{ /* nothing to do */ }]>]; let builders = [OpBuilder<(ins), [{ /* nothing to do */ }]>];
} }
def Linalg_TiledLoopOp : Linalg_Op<"tiled_loop", [ def Linalg_TiledLoopOp : Linalg_Op<"tiled_loop", [
@ -540,7 +540,7 @@ def Linalg_TiledLoopOp : Linalg_Op<"tiled_loop", [
let regions = (region SizedRegion<1>:$region); let regions = (region SizedRegion<1>:$region);
let builders = [ let builders = [
OpBuilderDAG<(ins "ValueRange":$lowerBounds, "ValueRange":$upperBounds, OpBuilder<(ins "ValueRange":$lowerBounds, "ValueRange":$upperBounds,
"ValueRange":$steps, "ValueRange":$inputs, "ValueRange":$outputs, "ValueRange":$steps, "ValueRange":$inputs, "ValueRange":$outputs,
"ArrayRef<StringRef>":$iteratorTypes, "ArrayRef<StringRef>":$iteratorTypes,
CArg<"function_ref<void (OpBuilder &, Location, ValueRange)>", CArg<"function_ref<void (OpBuilder &, Location, ValueRange)>",

View File

@ -113,7 +113,7 @@ def CopyOp : LinalgStructured_Op<"copy", [CopyOpInterface]> {
let regions = (region AnyRegion:$region); let regions = (region AnyRegion:$region);
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$input, "Value":$output, OpBuilder<(ins "Value":$input, "Value":$output,
CArg<"AffineMap", "AffineMap()">:$inputPermutation, CArg<"AffineMap", "AffineMap()">:$inputPermutation,
CArg<"AffineMap", "AffineMap()">:$outputPermutation, CArg<"AffineMap", "AffineMap()">:$outputPermutation,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>]; CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>];
@ -204,7 +204,7 @@ def FillOp : LinalgStructured_Op<"fill", []> {
}]; }];
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$output, "Value":$value)> OpBuilder<(ins "Value":$output, "Value":$value)>
]; ];
let verifier = [{ return ::verify(*this); }]; let verifier = [{ return ::verify(*this); }];
@ -642,20 +642,20 @@ def GenericOp : GenericOpBase<"generic"> {
}]; }];
let builders = [ let builders = [
OpBuilderDAG<(ins "TypeRange":$resultTensorTypes, "ValueRange":$inputs, OpBuilder<(ins "TypeRange":$resultTensorTypes, "ValueRange":$inputs,
"ValueRange":$outputs, "ArrayRef<AffineMap>":$indexingMaps, "ValueRange":$outputs, "ArrayRef<AffineMap>":$indexingMaps,
"ArrayRef<StringRef>":$iteratorTypes, "StringRef":$doc, "ArrayRef<StringRef>":$iteratorTypes, "StringRef":$doc,
"StringRef":$libraryCall, "StringRef":$libraryCall,
CArg<"function_ref<void(OpBuilder &, Location, ValueRange)>", "nullptr">)>, CArg<"function_ref<void(OpBuilder &, Location, ValueRange)>", "nullptr">)>,
OpBuilderDAG<(ins "ValueRange":$inputs, "ValueRange":$outputBuffers, OpBuilder<(ins "ValueRange":$inputs, "ValueRange":$outputBuffers,
"ArrayRef<AffineMap>":$indexingMaps, "ArrayRef<StringRef>":$iteratorTypes, "ArrayRef<AffineMap>":$indexingMaps, "ArrayRef<StringRef>":$iteratorTypes,
"StringRef":$doc, "StringRef":$libraryCall, "StringRef":$doc, "StringRef":$libraryCall,
CArg<"function_ref<void(OpBuilder &, Location, ValueRange)>", "nullptr">)>, CArg<"function_ref<void(OpBuilder &, Location, ValueRange)>", "nullptr">)>,
OpBuilderDAG<(ins "TypeRange":$resultTensorTypes, "ValueRange":$inputs, OpBuilder<(ins "TypeRange":$resultTensorTypes, "ValueRange":$inputs,
"ValueRange":$outputs, "ArrayRef<AffineMap>":$indexingMaps, "ValueRange":$outputs, "ArrayRef<AffineMap>":$indexingMaps,
"ArrayRef<StringRef>":$iteratorTypes, "ArrayRef<StringRef>":$iteratorTypes,
CArg<"function_ref<void(OpBuilder &, Location, ValueRange)>", "nullptr">)>, CArg<"function_ref<void(OpBuilder &, Location, ValueRange)>", "nullptr">)>,
OpBuilderDAG<(ins "ValueRange":$inputs, "ValueRange":$outputBuffers, OpBuilder<(ins "ValueRange":$inputs, "ValueRange":$outputBuffers,
"ArrayRef<AffineMap>":$indexingMaps, "ArrayRef<StringRef>":$iteratorTypes, "ArrayRef<AffineMap>":$indexingMaps, "ArrayRef<StringRef>":$iteratorTypes,
CArg<"function_ref<void(OpBuilder &, Location, ValueRange)>", "nullptr">)> CArg<"function_ref<void(OpBuilder &, Location, ValueRange)>", "nullptr">)>
]; ];
@ -774,23 +774,23 @@ def IndexedGenericOp : GenericOpBase<"indexed_generic"> {
}]; }];
let builders = [ let builders = [
OpBuilderDAG<(ins "TypeRange":$resultTensorTypes, "ValueRange":$inputs, OpBuilder<(ins "TypeRange":$resultTensorTypes, "ValueRange":$inputs,
"ValueRange":$outputs, "ArrayRef<AffineMap>":$indexingMaps, "ValueRange":$outputs, "ArrayRef<AffineMap>":$indexingMaps,
"ArrayRef<StringRef>":$iteratorTypes, "StringRef":$doc, "ArrayRef<StringRef>":$iteratorTypes, "StringRef":$doc,
"StringRef":$libraryCall, "StringRef":$libraryCall,
CArg<"function_ref<void(OpBuilder &, Location, ValueRange, ValueRange)>", CArg<"function_ref<void(OpBuilder &, Location, ValueRange, ValueRange)>",
"nullptr">)>, "nullptr">)>,
OpBuilderDAG<(ins "ValueRange":$inputs, "ValueRange":$outputBuffers, OpBuilder<(ins "ValueRange":$inputs, "ValueRange":$outputBuffers,
"ArrayRef<AffineMap>":$indexingMaps, "ArrayRef<StringRef>":$iteratorTypes, "ArrayRef<AffineMap>":$indexingMaps, "ArrayRef<StringRef>":$iteratorTypes,
"StringRef":$doc, "StringRef":$libraryCall, "StringRef":$doc, "StringRef":$libraryCall,
CArg<"function_ref<void(OpBuilder &, Location, ValueRange, ValueRange)>", CArg<"function_ref<void(OpBuilder &, Location, ValueRange, ValueRange)>",
"nullptr">)>, "nullptr">)>,
OpBuilderDAG<(ins "TypeRange":$resultTensorTypes, "ValueRange":$inputs, OpBuilder<(ins "TypeRange":$resultTensorTypes, "ValueRange":$inputs,
"ValueRange":$outputs, "ArrayRef<AffineMap>":$indexingMaps, "ValueRange":$outputs, "ArrayRef<AffineMap>":$indexingMaps,
"ArrayRef<StringRef>":$iteratorTypes, "ArrayRef<StringRef>":$iteratorTypes,
CArg<"function_ref<void(OpBuilder &, Location, ValueRange, ValueRange)>", CArg<"function_ref<void(OpBuilder &, Location, ValueRange, ValueRange)>",
"nullptr">)>, "nullptr">)>,
OpBuilderDAG<(ins "ValueRange":$inputs, "ValueRange":$outputBuffers, OpBuilder<(ins "ValueRange":$inputs, "ValueRange":$outputBuffers,
"ArrayRef<AffineMap>":$indexingMaps, "ArrayRef<StringRef>":$iteratorTypes, "ArrayRef<AffineMap>":$indexingMaps, "ArrayRef<StringRef>":$iteratorTypes,
CArg<"function_ref<void(OpBuilder &, Location, ValueRange, ValueRange)>", CArg<"function_ref<void(OpBuilder &, Location, ValueRange, ValueRange)>",
"nullptr">)> "nullptr">)>

View File

@ -382,7 +382,7 @@ def OpenACC_YieldOp : OpenACC_Op<"yield", [Terminator,
let arguments = (ins Variadic<AnyType>:$operands); let arguments = (ins Variadic<AnyType>:$operands);
let builders = [OpBuilderDAG<(ins), [{ /* nothing to do */ }]>]; let builders = [OpBuilder<(ins), [{ /* nothing to do */ }]>];
let verifier = ?; let verifier = ?;

View File

@ -93,7 +93,7 @@ def ParallelOp : OpenMP_Op<"parallel", [AttrSizedOperandSegments]> {
let regions = (region AnyRegion:$region); let regions = (region AnyRegion:$region);
let builders = [ let builders = [
OpBuilderDAG<(ins CArg<"ArrayRef<NamedAttribute>", "{}">:$attributes)> OpBuilder<(ins CArg<"ArrayRef<NamedAttribute>", "{}">:$attributes)>
]; ];
let parser = [{ return parseParallelOp(parser, result); }]; let parser = [{ return parseParallelOp(parser, result); }];
let printer = [{ return printParallelOp(p, *this); }]; let printer = [{ return printParallelOp(p, *this); }];
@ -182,7 +182,7 @@ def WsLoopOp : OpenMP_Op<"wsloop", [AttrSizedOperandSegments]> {
UnitAttr:$inclusive); UnitAttr:$inclusive);
let builders = [ let builders = [
OpBuilderDAG<(ins "ValueRange":$lowerBound, "ValueRange":$upperBound, OpBuilder<(ins "ValueRange":$lowerBound, "ValueRange":$upperBound,
"ValueRange":$step, "ValueRange":$step,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attributes)> CArg<"ArrayRef<NamedAttribute>", "{}">:$attributes)>
]; ];

View File

@ -59,7 +59,7 @@ def PDL_ApplyConstraintOp
}]; }];
let builders = [ let builders = [
OpBuilderDAG<(ins "StringRef":$name, CArg<"ValueRange", "{}">:$args, OpBuilder<(ins "StringRef":$name, CArg<"ValueRange", "{}">:$args,
CArg<"ArrayRef<Attribute>", "{}">:$params), [{ CArg<"ArrayRef<Attribute>", "{}">:$params), [{
build($_builder, $_state, $_builder.getStringAttr(name), args, build($_builder, $_state, $_builder.getStringAttr(name), args,
params.empty() ? ArrayAttr() : $_builder.getArrayAttr(params)); params.empty() ? ArrayAttr() : $_builder.getArrayAttr(params));
@ -103,11 +103,11 @@ def PDL_AttributeOp : PDL_Op<"attribute"> {
let assemblyFormat = "attr-dict (`:` $type^)? ($value^)?"; let assemblyFormat = "attr-dict (`:` $type^)? ($value^)?";
let builders = [ let builders = [
OpBuilderDAG<(ins CArg<"Value", "Value()">:$type), [{ OpBuilder<(ins CArg<"Value", "Value()">:$type), [{
build($_builder, $_state, $_builder.getType<AttributeType>(), type, build($_builder, $_state, $_builder.getType<AttributeType>(), type,
Attribute()); Attribute());
}]>, }]>,
OpBuilderDAG<(ins "Attribute":$attr), [{ OpBuilder<(ins "Attribute":$attr), [{
build($_builder, $_state, $_builder.getType<AttributeType>(), Value(), attr); build($_builder, $_state, $_builder.getType<AttributeType>(), Value(), attr);
}]>, }]>,
]; ];
@ -199,7 +199,7 @@ def PDL_OperandOp : PDL_Op<"operand", [HasParent<"pdl::PatternOp">]> {
let assemblyFormat = "(`:` $type^)? attr-dict"; let assemblyFormat = "(`:` $type^)? attr-dict";
let builders = [ let builders = [
OpBuilderDAG<(ins), [{ OpBuilder<(ins), [{
build($_builder, $_state, $_builder.getType<ValueType>(), Value()); build($_builder, $_state, $_builder.getType<ValueType>(), Value());
}]>, }]>,
]; ];
@ -253,7 +253,7 @@ def PDL_OperationOp
let results = (outs PDL_Operation:$op, let results = (outs PDL_Operation:$op,
Variadic<PDL_Value>:$results); Variadic<PDL_Value>:$results);
let builders = [ let builders = [
OpBuilderDAG<(ins CArg<"Optional<StringRef>", "llvm::None">:$name, OpBuilder<(ins CArg<"Optional<StringRef>", "llvm::None">:$name,
CArg<"ValueRange", "llvm::None">:$operandValues, CArg<"ValueRange", "llvm::None">:$operandValues,
CArg<"ArrayRef<StringRef>", "llvm::None">:$attrNames, CArg<"ArrayRef<StringRef>", "llvm::None">:$attrNames,
CArg<"ValueRange", "llvm::None">:$attrValues, CArg<"ValueRange", "llvm::None">:$attrValues,
@ -311,7 +311,7 @@ def PDL_PatternOp : PDL_Op<"pattern", [IsolatedFromAbove, Symbol]> {
}]; }];
let builders = [ let builders = [
OpBuilderDAG<(ins CArg<"Optional<StringRef>", "llvm::None">:$rootKind, OpBuilder<(ins CArg<"Optional<StringRef>", "llvm::None">:$rootKind,
CArg<"Optional<uint16_t>", "1">:$benefit, CArg<"Optional<uint16_t>", "1">:$benefit,
CArg<"Optional<StringRef>", "llvm::None">:$name)>, CArg<"Optional<StringRef>", "llvm::None">:$name)>,
]; ];
@ -452,7 +452,7 @@ def PDL_TypeOp : PDL_Op<"type"> {
let assemblyFormat = "attr-dict (`:` $type^)?"; let assemblyFormat = "attr-dict (`:` $type^)?";
let builders = [ let builders = [
OpBuilderDAG<(ins CArg<"Type", "Type()">:$ty), [{ OpBuilder<(ins CArg<"Type", "Type()">:$ty), [{
build($_builder, $_state, $_builder.getType<AttributeType>(), build($_builder, $_state, $_builder.getType<AttributeType>(),
ty ? TypeAttr::get(ty) : TypeAttr()); ty ? TypeAttr::get(ty) : TypeAttr());
}]>, }]>,

View File

@ -346,7 +346,7 @@ def PDLInterp_CreateAttributeOp
let assemblyFormat = "$value attr-dict"; let assemblyFormat = "$value attr-dict";
let builders = [ let builders = [
OpBuilderDAG<(ins "Attribute":$value), [{ OpBuilder<(ins "Attribute":$value), [{
build($_builder, $_state, $_builder.getType<pdl::AttributeType>(), value); build($_builder, $_state, $_builder.getType<pdl::AttributeType>(), value);
}]>]; }]>];
} }
@ -410,7 +410,7 @@ def PDLInterp_CreateOperationOp
let results = (outs PDL_Operation:$operation); let results = (outs PDL_Operation:$operation);
let builders = [ let builders = [
OpBuilderDAG<(ins "StringRef":$name, "ValueRange":$types, OpBuilder<(ins "StringRef":$name, "ValueRange":$types,
"ValueRange":$operands, "ValueRange":$attributes, "ValueRange":$operands, "ValueRange":$attributes,
"ArrayAttr":$attributeNames), [{ "ArrayAttr":$attributeNames), [{
build($_builder, $_state, $_builder.getType<pdl::OperationType>(), name, build($_builder, $_state, $_builder.getType<pdl::OperationType>(), name,
@ -442,7 +442,7 @@ def PDLInterp_CreateTypeOp : PDLInterp_Op<"create_type", [NoSideEffect]> {
let assemblyFormat = "$value attr-dict"; let assemblyFormat = "$value attr-dict";
let builders = [ let builders = [
OpBuilderDAG<(ins "TypeAttr":$type), [{ OpBuilder<(ins "TypeAttr":$type), [{
build($_builder, $_state, $_builder.getType<pdl::TypeType>(), type); build($_builder, $_state, $_builder.getType<pdl::TypeType>(), type);
}]> }]>
]; ];
@ -537,7 +537,7 @@ def PDLInterp_GetAttributeTypeOp
let assemblyFormat = "`of` $value attr-dict"; let assemblyFormat = "`of` $value attr-dict";
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$value), [{ OpBuilder<(ins "Value":$value), [{
build($_builder, $_state, $_builder.getType<pdl::TypeType>(), value); build($_builder, $_state, $_builder.getType<pdl::TypeType>(), value);
}]> }]>
]; ];
@ -638,7 +638,7 @@ def PDLInterp_GetValueTypeOp : PDLInterp_Op<"get_value_type", [NoSideEffect]> {
let assemblyFormat = "`of` $value attr-dict"; let assemblyFormat = "`of` $value attr-dict";
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$value), [{ OpBuilder<(ins "Value":$value), [{
build($_builder, $_state, $_builder.getType<pdl::TypeType>(), value); build($_builder, $_state, $_builder.getType<pdl::TypeType>(), value);
}]> }]>
]; ];
@ -665,7 +665,7 @@ def PDLInterp_InferredTypeOp : PDLInterp_Op<"inferred_type"> {
let assemblyFormat = "attr-dict"; let assemblyFormat = "attr-dict";
let builders = [ let builders = [
OpBuilderDAG<(ins), [{ OpBuilder<(ins), [{
build($_builder, $_state, $_builder.getType<pdl::TypeType>()); build($_builder, $_state, $_builder.getType<pdl::TypeType>());
}]>, }]>,
]; ];
@ -780,7 +780,7 @@ def PDLInterp_SwitchAttributeOp
}]; }];
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$attribute, "ArrayRef<Attribute>":$caseValues, OpBuilder<(ins "Value":$attribute, "ArrayRef<Attribute>":$caseValues,
"Block *":$defaultDest, "BlockRange":$dests), [{ "Block *":$defaultDest, "BlockRange":$dests), [{
build($_builder, $_state, attribute, $_builder.getArrayAttr(caseValues), build($_builder, $_state, attribute, $_builder.getArrayAttr(caseValues),
defaultDest, dests); defaultDest, dests);
@ -813,7 +813,7 @@ def PDLInterp_SwitchOperandCountOp
}]; }];
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$operation, "ArrayRef<int32_t>":$counts, OpBuilder<(ins "Value":$operation, "ArrayRef<int32_t>":$counts,
"Block *":$defaultDest, "BlockRange":$dests), [{ "Block *":$defaultDest, "BlockRange":$dests), [{
build($_builder, $_state, operation, $_builder.getI32VectorAttr(counts), build($_builder, $_state, operation, $_builder.getI32VectorAttr(counts),
defaultDest, dests); defaultDest, dests);
@ -847,7 +847,7 @@ def PDLInterp_SwitchOperationNameOp
}]; }];
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$operation, "ArrayRef<OperationName>":$names, OpBuilder<(ins "Value":$operation, "ArrayRef<OperationName>":$names,
"Block *":$defaultDest, "BlockRange":$dests), [{ "Block *":$defaultDest, "BlockRange":$dests), [{
auto stringNames = llvm::to_vector<8>(llvm::map_range(names, auto stringNames = llvm::to_vector<8>(llvm::map_range(names,
[](OperationName name) { return name.getStringRef(); })); [](OperationName name) { return name.getStringRef(); }));
@ -883,7 +883,7 @@ def PDLInterp_SwitchResultCountOp
}]; }];
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$operation, "ArrayRef<int32_t>":$counts, OpBuilder<(ins "Value":$operation, "ArrayRef<int32_t>":$counts,
"Block *":$defaultDest, "BlockRange":$dests), [{ "Block *":$defaultDest, "BlockRange":$dests), [{
build($_builder, $_state, operation, $_builder.getI32VectorAttr(counts), build($_builder, $_state, operation, $_builder.getI32VectorAttr(counts),
defaultDest, dests); defaultDest, dests);
@ -915,7 +915,7 @@ def PDLInterp_SwitchTypeOp : PDLInterp_SwitchOp<"switch_type", [NoSideEffect]> {
}]; }];
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$edge, "TypeRange":$types, "Block *":$defaultDest, OpBuilder<(ins "Value":$edge, "TypeRange":$types, "Block *":$defaultDest,
"BlockRange":$dests), [{ "BlockRange":$dests), [{
build($_builder, $_state, edge, $_builder.getTypeArrayAttr(types), build($_builder, $_state, edge, $_builder.getTypeArrayAttr(types),
defaultDest, dests); defaultDest, dests);

View File

@ -154,7 +154,7 @@ def ForOp : SCF_Op<"for",
let skipDefaultBuilders = 1; let skipDefaultBuilders = 1;
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$lowerBound, "Value":$upperBound, "Value":$step, OpBuilder<(ins "Value":$lowerBound, "Value":$upperBound, "Value":$step,
CArg<"ValueRange", "llvm::None">:$iterArgs, CArg<"ValueRange", "llvm::None">:$iterArgs,
CArg<"function_ref<void(OpBuilder &, Location, Value, ValueRange)>", CArg<"function_ref<void(OpBuilder &, Location, Value, ValueRange)>",
"nullptr">)> "nullptr">)>
@ -261,15 +261,15 @@ def IfOp : SCF_Op<"if",
let skipDefaultBuilders = 1; let skipDefaultBuilders = 1;
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$cond, "bool":$withElseRegion)>, OpBuilder<(ins "Value":$cond, "bool":$withElseRegion)>,
OpBuilderDAG<(ins "TypeRange":$resultTypes, "Value":$cond, OpBuilder<(ins "TypeRange":$resultTypes, "Value":$cond,
"bool":$withElseRegion)>, "bool":$withElseRegion)>,
OpBuilderDAG<(ins "TypeRange":$resultTypes, "Value":$cond, OpBuilder<(ins "TypeRange":$resultTypes, "Value":$cond,
CArg<"function_ref<void(OpBuilder &, Location)>", CArg<"function_ref<void(OpBuilder &, Location)>",
"buildTerminatedBody">:$thenBuilder, "buildTerminatedBody">:$thenBuilder,
CArg<"function_ref<void(OpBuilder &, Location)>", CArg<"function_ref<void(OpBuilder &, Location)>",
"nullptr">:$elseBuilder)>, "nullptr">:$elseBuilder)>,
OpBuilderDAG<(ins "Value":$cond, OpBuilder<(ins "Value":$cond,
CArg<"function_ref<void(OpBuilder &, Location)>", CArg<"function_ref<void(OpBuilder &, Location)>",
"buildTerminatedBody">:$thenBuilder, "buildTerminatedBody">:$thenBuilder,
CArg<"function_ref<void(OpBuilder &, Location)>", CArg<"function_ref<void(OpBuilder &, Location)>",
@ -352,11 +352,11 @@ def ParallelOp : SCF_Op<"parallel",
let skipDefaultBuilders = 1; let skipDefaultBuilders = 1;
let builders = [ let builders = [
OpBuilderDAG<(ins "ValueRange":$lowerBounds, "ValueRange":$upperBounds, OpBuilder<(ins "ValueRange":$lowerBounds, "ValueRange":$upperBounds,
"ValueRange":$steps, "ValueRange":$initVals, "ValueRange":$steps, "ValueRange":$initVals,
CArg<"function_ref<void (OpBuilder &, Location, ValueRange, ValueRange)>", CArg<"function_ref<void (OpBuilder &, Location, ValueRange, ValueRange)>",
"nullptr">:$bodyBuilderFn)>, "nullptr">:$bodyBuilderFn)>,
OpBuilderDAG<(ins "ValueRange":$lowerBounds, "ValueRange":$upperBounds, OpBuilder<(ins "ValueRange":$lowerBounds, "ValueRange":$upperBounds,
"ValueRange":$steps, "ValueRange":$steps,
CArg<"function_ref<void (OpBuilder &, Location, ValueRange)>", CArg<"function_ref<void (OpBuilder &, Location, ValueRange)>",
"nullptr">:$bodyBuilderFn)>, "nullptr">:$bodyBuilderFn)>,
@ -412,7 +412,7 @@ def ReduceOp : SCF_Op<"reduce", [HasParent<"ParallelOp">]> {
let skipDefaultBuilders = 1; let skipDefaultBuilders = 1;
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$operand, OpBuilder<(ins "Value":$operand,
CArg<"function_ref<void (OpBuilder &, Location, Value, Value)>", CArg<"function_ref<void (OpBuilder &, Location, Value, Value)>",
"nullptr">:$bodyBuilderFn)> "nullptr">:$bodyBuilderFn)>
]; ];
@ -582,7 +582,7 @@ def YieldOp : SCF_Op<"yield", [NoSideEffect, ReturnLike, Terminator,
}]; }];
let arguments = (ins Variadic<AnyType>:$results); let arguments = (ins Variadic<AnyType>:$results);
let builders = [OpBuilderDAG<(ins), [{ /* nothing to do */ }]>]; let builders = [OpBuilder<(ins), [{ /* nothing to do */ }]>];
let assemblyFormat = let assemblyFormat =
[{ attr-dict ($results^ `:` type($results))? }]; [{ attr-dict ($results^ `:` type($results))? }];

View File

@ -49,7 +49,7 @@ class SPV_AtomicUpdateWithValueOp<string mnemonic, list<OpTrait> traits = []> :
); );
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$pointer, "::mlir::spirv::Scope":$scope, OpBuilder<(ins "Value":$pointer, "::mlir::spirv::Scope":$scope,
"::mlir::spirv::MemorySemantics":$memory, "Value":$value), "::mlir::spirv::MemorySemantics":$memory, "Value":$value),
[{build($_builder, $_state, value.getType(), pointer, scope, memory, value);}]> [{build($_builder, $_state, value.getType(), pointer, scope, memory, value);}]>
]; ];

View File

@ -111,7 +111,7 @@ def SPV_CompositeExtractOp : SPV_Op<"CompositeExtract",
); );
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$composite, "ArrayRef<int32_t>":$indices)> OpBuilder<(ins "Value":$composite, "ArrayRef<int32_t>":$indices)>
]; ];
let hasFolder = 1; let hasFolder = 1;
@ -164,7 +164,7 @@ def SPV_CompositeInsertOp : SPV_Op<"CompositeInsert",
); );
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$object, "Value":$composite, OpBuilder<(ins "Value":$object, "Value":$composite,
"ArrayRef<int32_t>":$indices)> "ArrayRef<int32_t>":$indices)>
]; ];
} }

View File

@ -54,7 +54,7 @@ def SPV_BranchOp : SPV_Op<"Branch", [
let verifier = [{ return success(); }]; let verifier = [{ return success(); }];
let builders = [ let builders = [
OpBuilderDAG<(ins "Block *":$successor, CArg<"ValueRange", "{}">:$arguments), OpBuilder<(ins "Block *":$successor, CArg<"ValueRange", "{}">:$arguments),
[{ [{
$_state.addSuccessors(successor); $_state.addSuccessors(successor);
$_state.addOperands(arguments); $_state.addOperands(arguments);
@ -134,7 +134,7 @@ def SPV_BranchConditionalOp : SPV_Op<"BranchConditional", [
AnySuccessor:$falseTarget); AnySuccessor:$falseTarget);
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$condition, "Block *":$trueBlock, OpBuilder<(ins "Value":$condition, "Block *":$trueBlock,
"ValueRange":$trueArguments, "Block *":$falseBlock, "ValueRange":$trueArguments, "Block *":$falseBlock,
"ValueRange":$falseArguments, "ValueRange":$falseArguments,
CArg<"Optional<std::pair<uint32_t, uint32_t>>", "{}">:$weights), CArg<"Optional<std::pair<uint32_t, uint32_t>>", "{}">:$weights),
@ -286,7 +286,7 @@ def SPV_LoopOp : SPV_Op<"loop", [InFunctionScope]> {
let regions = (region AnyRegion:$body); let regions = (region AnyRegion:$body);
let builders = [OpBuilderDAG<(ins)>]; let builders = [OpBuilder<(ins)>];
let extraClassDeclaration = [{ let extraClassDeclaration = [{
// Returns the entry block. // Returns the entry block.

View File

@ -28,7 +28,7 @@ class SPV_LogicalBinaryOp<string mnemonic, Type operandsType,
let printer = [{ return ::printLogicalOp(getOperation(), p); }]; let printer = [{ return ::printLogicalOp(getOperation(), p); }];
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$lhs, "Value":$rhs), OpBuilder<(ins "Value":$lhs, "Value":$rhs),
[{::buildLogicalBinaryOp($_builder, $_state, lhs, rhs);}]> [{::buildLogicalBinaryOp($_builder, $_state, lhs, rhs);}]>
]; ];
} }
@ -43,7 +43,7 @@ class SPV_LogicalUnaryOp<string mnemonic, Type operandType,
let printer = [{ return ::printLogicalOp(getOperation(), p); }]; let printer = [{ return ::printLogicalOp(getOperation(), p); }];
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$value), OpBuilder<(ins "Value":$value),
[{::buildLogicalUnaryOp($_builder, $_state, value);}]> [{::buildLogicalUnaryOp($_builder, $_state, value);}]>
]; ];
} }
@ -1001,7 +1001,7 @@ def SPV_SelectOp : SPV_Op<"Select",
); );
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$cond, "Value":$trueValue, "Value":$falseValue)>]; OpBuilder<(ins "Value":$cond, "Value":$trueValue, "Value":$falseValue)>];
let assemblyFormat = [{ let assemblyFormat = [{
operands attr-dict `:` type($condition) `,` type($result) operands attr-dict `:` type($condition) `,` type($result)

View File

@ -74,7 +74,7 @@ def SPV_AccessChainOp : SPV_Op<"AccessChain", [NoSideEffect]> {
SPV_AnyPtr:$component_ptr SPV_AnyPtr:$component_ptr
); );
let builders = [OpBuilderDAG<(ins "Value":$basePtr, "ValueRange":$indices)>]; let builders = [OpBuilder<(ins "Value":$basePtr, "ValueRange":$indices)>];
let hasCanonicalizer = 1; let hasCanonicalizer = 1;
} }
@ -183,7 +183,7 @@ def SPV_LoadOp : SPV_Op<"Load", []> {
); );
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$basePtr, OpBuilder<(ins "Value":$basePtr,
CArg<"IntegerAttr", "{}">:$memory_access, CArg<"IntegerAttr", "{}">:$memory_access,
CArg<"IntegerAttr", "{}">:$alignment)> CArg<"IntegerAttr", "{}">:$alignment)>
]; ];
@ -232,7 +232,7 @@ def SPV_StoreOp : SPV_Op<"Store", []> {
let results = (outs); let results = (outs);
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$ptr, "Value":$value, OpBuilder<(ins "Value":$ptr, "Value":$value,
CArg<"ArrayRef<NamedAttribute>", "{}">:$namedAttrs), CArg<"ArrayRef<NamedAttribute>", "{}">:$namedAttrs),
[{ [{
$_state.addOperands(ptr); $_state.addOperands(ptr);

View File

@ -208,7 +208,7 @@ def SPV_GroupNonUniformElectOp : SPV_Op<"GroupNonUniformElect", []> {
SPV_Bool:$result SPV_Bool:$result
); );
let builders = [OpBuilderDAG<(ins "spirv::Scope")>]; let builders = [OpBuilder<(ins "spirv::Scope")>];
let assemblyFormat = "$execution_scope attr-dict `:` type($result)"; let assemblyFormat = "$execution_scope attr-dict `:` type($result)";
} }

View File

@ -60,7 +60,7 @@ def SPV_AddressOfOp : SPV_Op<"mlir.addressof", [InFunctionScope, NoSideEffect]>
let autogenSerialization = 0; let autogenSerialization = 0;
let builders = [OpBuilderDAG<(ins "spirv::GlobalVariableOp":$var)>]; let builders = [OpBuilder<(ins "spirv::GlobalVariableOp":$var)>];
let assemblyFormat = "$variable attr-dict `:` type($pointer)"; let assemblyFormat = "$variable attr-dict `:` type($pointer)";
} }
@ -189,7 +189,7 @@ def SPV_EntryPointOp : SPV_Op<"EntryPoint", [InModuleScope]> {
let autogenSerialization = 0; let autogenSerialization = 0;
let builders = [ let builders = [
OpBuilderDAG<(ins "spirv::ExecutionModel":$executionModel, OpBuilder<(ins "spirv::ExecutionModel":$executionModel,
"spirv::FuncOp":$function, "ArrayRef<Attribute>":$interfaceVars)>]; "spirv::FuncOp":$function, "ArrayRef<Attribute>":$interfaceVars)>];
} }
@ -239,7 +239,7 @@ def SPV_ExecutionModeOp : SPV_Op<"ExecutionMode", [InModuleScope]> {
let autogenSerialization = 0; let autogenSerialization = 0;
let builders = [ let builders = [
OpBuilderDAG<(ins "spirv::FuncOp":$function, OpBuilder<(ins "spirv::FuncOp":$function,
"spirv::ExecutionMode":$executionMode, "ArrayRef<int32_t>":$params)>]; "spirv::ExecutionMode":$executionMode, "ArrayRef<int32_t>":$params)>];
} }
@ -292,7 +292,7 @@ def SPV_FuncOp : SPV_Op<"func", [
let verifier = [{ return success(); }]; let verifier = [{ return success(); }];
let builders = [ let builders = [
OpBuilderDAG<(ins "StringRef":$name, "FunctionType":$type, OpBuilder<(ins "StringRef":$name, "FunctionType":$type,
CArg<"spirv::FunctionControl", "spirv::FunctionControl::None">:$control, CArg<"spirv::FunctionControl", "spirv::FunctionControl::None">:$control,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>]; CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>];
@ -379,14 +379,14 @@ def SPV_GlobalVariableOp : SPV_Op<"globalVariable", [InModuleScope, Symbol]> {
let results = (outs); let results = (outs);
let builders = [ let builders = [
OpBuilderDAG<(ins "TypeAttr":$type, "ArrayRef<NamedAttribute>":$namedAttrs), OpBuilder<(ins "TypeAttr":$type, "ArrayRef<NamedAttribute>":$namedAttrs),
[{ [{
$_state.addAttribute("type", type); $_state.addAttribute("type", type);
$_state.addAttributes(namedAttrs); $_state.addAttributes(namedAttrs);
}]>, }]>,
OpBuilderDAG<(ins "Type":$type, "StringRef":$name, OpBuilder<(ins "Type":$type, "StringRef":$name,
"unsigned":$descriptorSet, "unsigned":$binding)>, "unsigned":$descriptorSet, "unsigned":$binding)>,
OpBuilderDAG<(ins "Type":$type, "StringRef":$name, OpBuilder<(ins "Type":$type, "StringRef":$name,
"spirv::BuiltIn":$builtin)> "spirv::BuiltIn":$builtin)>
]; ];
@ -463,8 +463,8 @@ def SPV_ModuleOp : SPV_Op<"module",
let regions = (region SizedRegion<1>:$body); let regions = (region SizedRegion<1>:$body);
let builders = [ let builders = [
OpBuilderDAG<(ins CArg<"Optional<StringRef>", "llvm::None">:$name)>, OpBuilder<(ins CArg<"Optional<StringRef>", "llvm::None">:$name)>,
OpBuilderDAG<(ins "spirv::AddressingModel":$addressing_model, OpBuilder<(ins "spirv::AddressingModel":$addressing_model,
"spirv::MemoryModel":$memory_model, "spirv::MemoryModel":$memory_model,
CArg<"Optional<StringRef>", "llvm::None">:$name)> CArg<"Optional<StringRef>", "llvm::None">:$name)>
]; ];

View File

@ -81,7 +81,7 @@ def Shape_BroadcastOp : Shape_Op<"broadcast", [Commutative, NoSideEffect]> {
$shapes attr-dict `:` type($shapes) `->` type($result) $shapes attr-dict `:` type($shapes) `->` type($result)
}]; }];
let builders = [OpBuilderDAG<(ins "::mlir::Type":$result, let builders = [OpBuilder<(ins "::mlir::Type":$result,
"::mlir::Value":$lhs, "::mlir::Value":$rhs, "::mlir::Value":$lhs, "::mlir::Value":$rhs,
"/*optional*/ ::mlir::StringAttr":$error), [{ "/*optional*/ ::mlir::StringAttr":$error), [{
build($_builder, $_state, result, ::llvm::makeArrayRef({lhs, rhs}), error); build($_builder, $_state, result, ::llvm::makeArrayRef({lhs, rhs}), error);
@ -132,7 +132,7 @@ def Shape_ConstSizeOp : Shape_Op<"const_size", [
let arguments = (ins IndexAttr:$value); let arguments = (ins IndexAttr:$value);
let results = (outs Shape_SizeType:$result); let results = (outs Shape_SizeType:$result);
let builders = [OpBuilderDAG<(ins "int64_t":$value)>]; let builders = [OpBuilder<(ins "int64_t":$value)>];
let assemblyFormat = "$value attr-dict"; let assemblyFormat = "$value attr-dict";
let hasFolder = 1; let hasFolder = 1;
@ -184,7 +184,7 @@ def Shape_ShapeEqOp : Shape_Op<"shape_eq", [NoSideEffect, Commutative,
// Convenience builder alias for the binary version. // Convenience builder alias for the binary version.
let builders = [ let builders = [
OpBuilderDAG<(ins "::mlir::Value":$lhs, "::mlir::Value":$rhs), OpBuilder<(ins "::mlir::Value":$lhs, "::mlir::Value":$rhs),
[{ build($_builder, $_state, ::llvm::makeArrayRef({lhs, rhs})); }]>, [{ build($_builder, $_state, ::llvm::makeArrayRef({lhs, rhs})); }]>,
]; ];
let extraClassDeclaration = [{ let extraClassDeclaration = [{
@ -262,7 +262,7 @@ def Shape_IsBroadcastableOp : Shape_Op<"is_broadcastable",
let results = (outs I1:$result); let results = (outs I1:$result);
let builders = [ let builders = [
OpBuilderDAG<(ins "::mlir::Value":$lhs, "::mlir::Value":$rhs), OpBuilder<(ins "::mlir::Value":$lhs, "::mlir::Value":$rhs),
[{ build($_builder, $_state, ::llvm::makeArrayRef({lhs, rhs})); }]>, [{ build($_builder, $_state, ::llvm::makeArrayRef({lhs, rhs})); }]>,
]; ];
let extraClassDeclaration = [{ let extraClassDeclaration = [{
@ -330,7 +330,7 @@ def Shape_GetExtentOp : Shape_Op<"get_extent", [NoSideEffect]> {
let builders = [ let builders = [
// Builder that allows passing a constant dimension as a simple integer. // Builder that allows passing a constant dimension as a simple integer.
OpBuilderDAG<(ins "Value":$shape, "int64_t":$dim)> OpBuilder<(ins "Value":$shape, "int64_t":$dim)>
]; ];
let extraClassDeclaration = [{ let extraClassDeclaration = [{
@ -429,7 +429,7 @@ def Shape_NumElementsOp : Shape_Op<"num_elements", [NoSideEffect]> {
let arguments = (ins Shape_ShapeOrExtentTensorType:$shape); let arguments = (ins Shape_ShapeOrExtentTensorType:$shape);
let results = (outs Shape_SizeOrIndexType:$result); let results = (outs Shape_SizeOrIndexType:$result);
let builders = [OpBuilderDAG<(ins "Value":$shape)>]; let builders = [OpBuilder<(ins "Value":$shape)>];
let assemblyFormat = "$shape attr-dict `:` type($shape) `->` type($result)"; let assemblyFormat = "$shape attr-dict `:` type($shape) `->` type($result)";
@ -477,7 +477,7 @@ def Shape_ReduceOp : Shape_Op<"reduce",
let results = (outs Variadic<AnyType>:$result); let results = (outs Variadic<AnyType>:$result);
let regions = (region SizedRegion<1>:$region); let regions = (region SizedRegion<1>:$region);
let builders = [OpBuilderDAG<(ins "Value":$shape, "ValueRange":$initVals)>]; let builders = [OpBuilder<(ins "Value":$shape, "ValueRange":$initVals)>];
let verifier = [{ return ::verify(*this); }]; let verifier = [{ return ::verify(*this); }];
let printer = [{ return ::print(p, *this); }]; let printer = [{ return ::print(p, *this); }];
@ -497,7 +497,7 @@ def Shape_ShapeOfOp : Shape_Op<"shape_of", [NoSideEffect]> {
let assemblyFormat = "$arg attr-dict `:` type($arg) `->` type($result)"; let assemblyFormat = "$arg attr-dict `:` type($arg) `->` type($result)";
let builders = [OpBuilderDAG<(ins "Value":$arg)>]; let builders = [OpBuilder<(ins "Value":$arg)>];
let verifier = [{ return ::verifyShapeOrExtentTensorOp(*this); }]; let verifier = [{ return ::verifyShapeOrExtentTensorOp(*this); }];
let hasCanonicalizer = 1; let hasCanonicalizer = 1;
@ -574,7 +574,7 @@ def Shape_YieldOp : Shape_Op<"yield",
let arguments = (ins Variadic<AnyType>:$operands); let arguments = (ins Variadic<AnyType>:$operands);
let builders = [OpBuilderDAG<(ins), let builders = [OpBuilder<(ins),
[{ build($_builder, $_state, llvm::None); }]> [{ build($_builder, $_state, llvm::None); }]>
]; ];
@ -753,7 +753,7 @@ def Shape_AssumingYieldOp : Shape_Op<"assuming_yield",
let arguments = (ins Variadic<AnyType>:$operands); let arguments = (ins Variadic<AnyType>:$operands);
let builders = [OpBuilderDAG<(ins), [{ /* nothing to do */ }]>]; let builders = [OpBuilder<(ins), [{ /* nothing to do */ }]>];
let assemblyFormat = "attr-dict ($operands^ `:` type($operands))?"; let assemblyFormat = "attr-dict ($operands^ `:` type($operands))?";
} }
@ -781,7 +781,7 @@ def Shape_CstrBroadcastableOp : Shape_Op<"cstr_broadcastable",
let assemblyFormat = "$shapes attr-dict `:` type($shapes)"; let assemblyFormat = "$shapes attr-dict `:` type($shapes)";
let builders = [ let builders = [
OpBuilderDAG<(ins "::mlir::Value":$lhs, "::mlir::Value":$rhs), OpBuilder<(ins "::mlir::Value":$lhs, "::mlir::Value":$rhs),
[{ build($_builder, $_state, ::llvm::makeArrayRef({lhs, rhs})); }]>, [{ build($_builder, $_state, ::llvm::makeArrayRef({lhs, rhs})); }]>,
]; ];
@ -920,7 +920,7 @@ def Shape_FunctionLibraryOp : Shape_Op<"function_library",
FuncOp getShapeFunction(Operation *op); FuncOp getShapeFunction(Operation *op);
}]; }];
let builders = [OpBuilderDAG<(ins "StringRef":$name)>]; let builders = [OpBuilder<(ins "StringRef":$name)>];
let skipDefaultBuilders = 1; let skipDefaultBuilders = 1;
let printer = [{ ::print(p, *this); }]; let printer = [{ ::print(p, *this); }];

View File

@ -53,7 +53,7 @@ class CastOp<string mnemonic, list<OpTrait> traits = []> :
let results = (outs AnyType); let results = (outs AnyType);
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$source, "Type":$destType), [{ OpBuilder<(ins "Value":$source, "Type":$destType), [{
impl::buildCastOp($_builder, $_state, source, destType); impl::buildCastOp($_builder, $_state, source, destType);
}]> }]>
]; ];
@ -209,15 +209,15 @@ class AllocLikeOp<string mnemonic,
let results = (outs Res<AnyMemRef, "", [MemAlloc<resource>]>:$memref); let results = (outs Res<AnyMemRef, "", [MemAlloc<resource>]>:$memref);
let builders = [ let builders = [
OpBuilderDAG<(ins "MemRefType":$memrefType, OpBuilder<(ins "MemRefType":$memrefType,
CArg<"IntegerAttr", "IntegerAttr()">:$alignment), [{ CArg<"IntegerAttr", "IntegerAttr()">:$alignment), [{
return build($_builder, $_state, memrefType, {}, alignment); return build($_builder, $_state, memrefType, {}, alignment);
}]>, }]>,
OpBuilderDAG<(ins "MemRefType":$memrefType, "ValueRange":$dynamicSizes, OpBuilder<(ins "MemRefType":$memrefType, "ValueRange":$dynamicSizes,
CArg<"IntegerAttr", "IntegerAttr()">:$alignment), [{ CArg<"IntegerAttr", "IntegerAttr()">:$alignment), [{
return build($_builder, $_state, memrefType, dynamicSizes, {}, alignment); return build($_builder, $_state, memrefType, dynamicSizes, {}, alignment);
}]>, }]>,
OpBuilderDAG<(ins "MemRefType":$memrefType, "ValueRange":$dynamicSizes, OpBuilder<(ins "MemRefType":$memrefType, "ValueRange":$dynamicSizes,
"ValueRange":$symbolOperands, "ValueRange":$symbolOperands,
CArg<"IntegerAttr", "{}">:$alignment), [{ CArg<"IntegerAttr", "{}">:$alignment), [{
$_state.types.push_back(memrefType); $_state.types.push_back(memrefType);
@ -623,7 +623,7 @@ def GenericAtomicRMWOp : Std_Op<"generic_atomic_rmw", [
let regions = (region AnyRegion:$body); let regions = (region AnyRegion:$body);
let skipDefaultBuilders = 1; let skipDefaultBuilders = 1;
let builders = [OpBuilderDAG<(ins "Value":$memref, "ValueRange":$ivs)>]; let builders = [OpBuilder<(ins "Value":$memref, "ValueRange":$ivs)>];
let extraClassDeclaration = [{ let extraClassDeclaration = [{
// The value stored in memref[ivs]. // The value stored in memref[ivs].
@ -678,7 +678,7 @@ def BranchOp : Std_Op<"br",
let successors = (successor AnySuccessor:$dest); let successors = (successor AnySuccessor:$dest);
let builders = [ let builders = [
OpBuilderDAG<(ins "Block *":$dest, OpBuilder<(ins "Block *":$dest,
CArg<"ValueRange", "{}">:$destOperands), [{ CArg<"ValueRange", "{}">:$destOperands), [{
$_state.addSuccessors(dest); $_state.addSuccessors(dest);
$_state.addOperands(destOperands); $_state.addOperands(destOperands);
@ -726,18 +726,18 @@ def CallOp : Std_Op<"call",
let results = (outs Variadic<AnyType>); let results = (outs Variadic<AnyType>);
let builders = [ let builders = [
OpBuilderDAG<(ins "FuncOp":$callee, CArg<"ValueRange", "{}">:$operands), [{ OpBuilder<(ins "FuncOp":$callee, CArg<"ValueRange", "{}">:$operands), [{
$_state.addOperands(operands); $_state.addOperands(operands);
$_state.addAttribute("callee",$_builder.getSymbolRefAttr(callee)); $_state.addAttribute("callee",$_builder.getSymbolRefAttr(callee));
$_state.addTypes(callee.getType().getResults()); $_state.addTypes(callee.getType().getResults());
}]>, }]>,
OpBuilderDAG<(ins "SymbolRefAttr":$callee, "TypeRange":$results, OpBuilder<(ins "SymbolRefAttr":$callee, "TypeRange":$results,
CArg<"ValueRange", "{}">:$operands), [{ CArg<"ValueRange", "{}">:$operands), [{
$_state.addOperands(operands); $_state.addOperands(operands);
$_state.addAttribute("callee", callee); $_state.addAttribute("callee", callee);
$_state.addTypes(results); $_state.addTypes(results);
}]>, }]>,
OpBuilderDAG<(ins "StringRef":$callee, "TypeRange":$results, OpBuilder<(ins "StringRef":$callee, "TypeRange":$results,
CArg<"ValueRange", "{}">:$operands), [{ CArg<"ValueRange", "{}">:$operands), [{
build($_builder, $_state, $_builder.getSymbolRefAttr(callee), results, build($_builder, $_state, $_builder.getSymbolRefAttr(callee), results,
operands); operands);
@ -802,7 +802,7 @@ def CallIndirectOp : Std_Op<"call_indirect", [
let results = (outs Variadic<AnyType>:$results); let results = (outs Variadic<AnyType>:$results);
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$callee, CArg<"ValueRange", "{}">:$operands), [{ OpBuilder<(ins "Value":$callee, CArg<"ValueRange", "{}">:$operands), [{
$_state.operands.push_back(callee); $_state.operands.push_back(callee);
$_state.addOperands(operands); $_state.addOperands(operands);
$_state.addTypes(callee.getType().cast<FunctionType>().getResults()); $_state.addTypes(callee.getType().cast<FunctionType>().getResults());
@ -966,7 +966,7 @@ def CmpFOp : Std_Op<"cmpf", [NoSideEffect, SameTypeOperands,
let results = (outs BoolLike:$result); let results = (outs BoolLike:$result);
let builders = [ let builders = [
OpBuilderDAG<(ins "CmpFPredicate":$predicate, "Value":$lhs, OpBuilder<(ins "CmpFPredicate":$predicate, "Value":$lhs,
"Value":$rhs), [{ "Value":$rhs), [{
::buildCmpFOp($_builder, $_state, predicate, lhs, rhs); ::buildCmpFOp($_builder, $_state, predicate, lhs, rhs);
}]>]; }]>];
@ -1087,7 +1087,7 @@ def CmpIOp : Std_Op<"cmpi", [NoSideEffect, SameTypeOperands,
let results = (outs BoolLike:$result); let results = (outs BoolLike:$result);
let builders = [ let builders = [
OpBuilderDAG<(ins "CmpIPredicate":$predicate, "Value":$lhs, OpBuilder<(ins "CmpIPredicate":$predicate, "Value":$lhs,
"Value":$rhs), [{ "Value":$rhs), [{
::buildCmpIOp($_builder, $_state, predicate, lhs, rhs); ::buildCmpIOp($_builder, $_state, predicate, lhs, rhs);
}]>]; }]>];
@ -1151,13 +1151,13 @@ def CondBranchOp : Std_Op<"cond_br",
let successors = (successor AnySuccessor:$trueDest, AnySuccessor:$falseDest); let successors = (successor AnySuccessor:$trueDest, AnySuccessor:$falseDest);
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$condition, "Block *":$trueDest, OpBuilder<(ins "Value":$condition, "Block *":$trueDest,
"ValueRange":$trueOperands, "Block *":$falseDest, "ValueRange":$trueOperands, "Block *":$falseDest,
"ValueRange":$falseOperands), [{ "ValueRange":$falseOperands), [{
build($_builder, $_state, condition, trueOperands, falseOperands, trueDest, build($_builder, $_state, condition, trueOperands, falseOperands, trueDest,
falseDest); falseDest);
}]>, }]>,
OpBuilderDAG<(ins "Value":$condition, "Block *":$trueDest, OpBuilder<(ins "Value":$condition, "Block *":$trueDest,
"Block *":$falseDest, CArg<"ValueRange", "{}">:$falseOperands), [{ "Block *":$falseDest, CArg<"ValueRange", "{}">:$falseOperands), [{
build($_builder, $_state, condition, trueDest, ValueRange(), falseDest, build($_builder, $_state, condition, trueDest, ValueRange(), falseDest,
falseOperands); falseOperands);
@ -1285,7 +1285,7 @@ def ConstantOp : Std_Op<"constant",
let results = (outs AnyType); let results = (outs AnyType);
let builders = [ let builders = [
OpBuilderDAG<(ins "Attribute":$value), OpBuilder<(ins "Attribute":$value),
[{ build($_builder, $_state, value.getType(), value); }]>]; [{ build($_builder, $_state, value.getType(), value); }]>];
let extraClassDeclaration = [{ let extraClassDeclaration = [{
@ -1401,8 +1401,8 @@ def DimOp : Std_Op<"dim", [NoSideEffect]> {
}]; }];
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$memrefOrTensor, "int64_t":$index)>, OpBuilder<(ins "Value":$memrefOrTensor, "int64_t":$index)>,
OpBuilderDAG<(ins "Value":$memrefOrTensor, "Value":$index)> OpBuilder<(ins "Value":$memrefOrTensor, "Value":$index)>
]; ];
let extraClassDeclaration = [{ let extraClassDeclaration = [{
@ -1672,7 +1672,7 @@ def LoadOp : Std_Op<"load",
let results = (outs AnyType:$result); let results = (outs AnyType:$result);
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$memref, CArg<"ValueRange", "{}">:$indices), [{ OpBuilder<(ins "Value":$memref, CArg<"ValueRange", "{}">:$indices), [{
auto memrefType = memref.getType().cast<MemRefType>(); auto memrefType = memref.getType().cast<MemRefType>();
$_state.addOperands(memref); $_state.addOperands(memref);
$_state.addOperands(indices); $_state.addOperands(indices);
@ -1819,17 +1819,17 @@ def MemRefReinterpretCastOp:
let builders = [ let builders = [
// Build a ReinterpretCastOp with mixed static and dynamic entries. // Build a ReinterpretCastOp with mixed static and dynamic entries.
OpBuilderDAG<(ins "MemRefType":$resultType, "Value":$source, OpBuilder<(ins "MemRefType":$resultType, "Value":$source,
"OpFoldResult":$offset, "ArrayRef<OpFoldResult>":$sizes, "OpFoldResult":$offset, "ArrayRef<OpFoldResult>":$sizes,
"ArrayRef<OpFoldResult>":$strides, "ArrayRef<OpFoldResult>":$strides,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>, CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>,
// Build a ReinterpretCastOp with static entries. // Build a ReinterpretCastOp with static entries.
OpBuilderDAG<(ins "MemRefType":$resultType, "Value":$source, OpBuilder<(ins "MemRefType":$resultType, "Value":$source,
"int64_t":$offset, "ArrayRef<int64_t>":$sizes, "int64_t":$offset, "ArrayRef<int64_t>":$sizes,
"ArrayRef<int64_t>":$strides, "ArrayRef<int64_t>":$strides,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>, CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>,
// Build a ReinterpretCastOp with dynamic entries. // Build a ReinterpretCastOp with dynamic entries.
OpBuilderDAG<(ins "MemRefType":$resultType, "Value":$source, OpBuilder<(ins "MemRefType":$resultType, "Value":$source,
"Value":$offset, "ValueRange":$sizes, "Value":$offset, "ValueRange":$sizes,
"ValueRange":$strides, "ValueRange":$strides,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)> CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>
@ -1905,7 +1905,7 @@ def MemRefReshapeOp: Std_Op<"memref_reshape", [
); );
let results = (outs AnyRankedOrUnrankedMemRef:$result); let results = (outs AnyRankedOrUnrankedMemRef:$result);
let builders = [OpBuilderDAG< let builders = [OpBuilder<
(ins "MemRefType":$resultType, "Value":$operand, "Value":$shape), [{ (ins "MemRefType":$resultType, "Value":$operand, "Value":$shape), [{
$_state.addOperands(operand); $_state.addOperands(operand);
$_state.addOperands(shape); $_state.addOperands(shape);
@ -2099,7 +2099,7 @@ def RankOp : Std_Op<"rank", [NoSideEffect]> {
let verifier = ?; let verifier = ?;
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$tensor), [{ OpBuilder<(ins "Value":$tensor), [{
auto indexType = $_builder.getIndexType(); auto indexType = $_builder.getIndexType();
build($_builder, $_state, indexType, tensor); build($_builder, $_state, indexType, tensor);
}]>]; }]>];
@ -2142,7 +2142,7 @@ def ReturnOp : Std_Op<"return", [NoSideEffect, HasParent<"FuncOp">,
let arguments = (ins Variadic<AnyType>:$operands); let arguments = (ins Variadic<AnyType>:$operands);
let builders = [ let builders = [
OpBuilderDAG<(ins), OpBuilder<(ins),
[{ build($_builder, $_state, llvm::None); }]>]; [{ build($_builder, $_state, llvm::None); }]>];
let assemblyFormat = "attr-dict ($operands^ `:` type($operands))?"; let assemblyFormat = "attr-dict ($operands^ `:` type($operands))?";
@ -2195,7 +2195,7 @@ def SelectOp : Std_Op<"select", [NoSideEffect,
let results = (outs AnyType:$result); let results = (outs AnyType:$result);
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$condition, "Value":$trueValue, OpBuilder<(ins "Value":$condition, "Value":$trueValue,
"Value":$falseValue), [{ "Value":$falseValue), [{
$_state.addOperands({condition, trueValue, falseValue}); $_state.addOperands({condition, trueValue, falseValue});
$_state.addTypes(trueValue.getType()); $_state.addTypes(trueValue.getType());
@ -2412,7 +2412,7 @@ def SignExtendIOp : Std_Op<"sexti", [NoSideEffect,
let results = (outs SignlessIntegerLike); let results = (outs SignlessIntegerLike);
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$value, "Type":$destType), [{ OpBuilder<(ins "Value":$value, "Type":$destType), [{
$_state.addOperands(value); $_state.addOperands(value);
$_state.addTypes(destType); $_state.addTypes(destType);
}]>]; }]>];
@ -2478,7 +2478,7 @@ def SplatOp : Std_Op<"splat", [NoSideEffect,
let results = (outs AnyTypeOf<[AnyVector, AnyStaticShapeTensor]>:$aggregate); let results = (outs AnyTypeOf<[AnyVector, AnyStaticShapeTensor]>:$aggregate);
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$element, "Type":$aggregateType), OpBuilder<(ins "Value":$element, "Type":$aggregateType),
[{ build($_builder, $_state, aggregateType, element); }]>]; [{ build($_builder, $_state, aggregateType, element); }]>];
let hasFolder = 1; let hasFolder = 1;
@ -2531,7 +2531,7 @@ def StoreOp : Std_Op<"store",
Variadic<Index>:$indices); Variadic<Index>:$indices);
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$valueToStore, "Value":$memref), [{ OpBuilder<(ins "Value":$valueToStore, "Value":$memref), [{
$_state.addOperands(valueToStore); $_state.addOperands(valueToStore);
$_state.addOperands(memref); $_state.addOperands(memref);
}]>]; }]>];
@ -2732,32 +2732,32 @@ def SubViewOp : BaseOpWithOffsetSizesAndStrides<
let builders = [ let builders = [
// Build a SubViewOp with mixed static and dynamic entries and custom // Build a SubViewOp with mixed static and dynamic entries and custom
// result type. If the type passed is nullptr, it is inferred. // result type. If the type passed is nullptr, it is inferred.
OpBuilderDAG<(ins "Value":$source, "ArrayRef<OpFoldResult>":$offsets, OpBuilder<(ins "Value":$source, "ArrayRef<OpFoldResult>":$offsets,
"ArrayRef<OpFoldResult>":$sizes, "ArrayRef<OpFoldResult>":$strides, "ArrayRef<OpFoldResult>":$sizes, "ArrayRef<OpFoldResult>":$strides,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>, CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>,
// Build a SubViewOp with mixed static and dynamic entries and inferred // Build a SubViewOp with mixed static and dynamic entries and inferred
// result type. // result type.
OpBuilderDAG<(ins "MemRefType":$resultType, "Value":$source, OpBuilder<(ins "MemRefType":$resultType, "Value":$source,
"ArrayRef<OpFoldResult>":$offsets, "ArrayRef<OpFoldResult>":$sizes, "ArrayRef<OpFoldResult>":$offsets, "ArrayRef<OpFoldResult>":$sizes,
"ArrayRef<OpFoldResult>":$strides, "ArrayRef<OpFoldResult>":$strides,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>, CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>,
// Build a SubViewOp with static entries and custom result type. If the // Build a SubViewOp with static entries and custom result type. If the
// type passed is nullptr, it is inferred. // type passed is nullptr, it is inferred.
OpBuilderDAG<(ins "Value":$source, "ArrayRef<int64_t>":$offsets, OpBuilder<(ins "Value":$source, "ArrayRef<int64_t>":$offsets,
"ArrayRef<int64_t>":$sizes, "ArrayRef<int64_t>":$strides, "ArrayRef<int64_t>":$sizes, "ArrayRef<int64_t>":$strides,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>, CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>,
// Build a SubViewOp with static entries and inferred result type. // Build a SubViewOp with static entries and inferred result type.
OpBuilderDAG<(ins "MemRefType":$resultType, "Value":$source, OpBuilder<(ins "MemRefType":$resultType, "Value":$source,
"ArrayRef<int64_t>":$offsets, "ArrayRef<int64_t>":$sizes, "ArrayRef<int64_t>":$offsets, "ArrayRef<int64_t>":$sizes,
"ArrayRef<int64_t>":$strides, "ArrayRef<int64_t>":$strides,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>, CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>,
// Build a SubViewOp with dynamic entries and custom result type. If the // Build a SubViewOp with dynamic entries and custom result type. If the
// type passed is nullptr, it is inferred. // type passed is nullptr, it is inferred.
OpBuilderDAG<(ins "Value":$source, "ValueRange":$offsets, OpBuilder<(ins "Value":$source, "ValueRange":$offsets,
"ValueRange":$sizes, "ValueRange":$strides, "ValueRange":$sizes, "ValueRange":$strides,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>, CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>,
// Build a SubViewOp with dynamic entries and inferred result type. // Build a SubViewOp with dynamic entries and inferred result type.
OpBuilderDAG<(ins "MemRefType":$resultType, "Value":$source, OpBuilder<(ins "MemRefType":$resultType, "Value":$source,
"ValueRange":$offsets, "ValueRange":$sizes, "ValueRange":$strides, "ValueRange":$offsets, "ValueRange":$sizes, "ValueRange":$strides,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)> CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>
]; ];
@ -2876,22 +2876,22 @@ def SubTensorOp : BaseOpWithOffsetSizesAndStrides<
let builders = [ let builders = [
// Build a SubTensorOp with mixed static and dynamic entries and inferred // Build a SubTensorOp with mixed static and dynamic entries and inferred
// result type. // result type.
OpBuilderDAG<(ins "Value":$source, "ArrayRef<OpFoldResult>":$offsets, OpBuilder<(ins "Value":$source, "ArrayRef<OpFoldResult>":$offsets,
"ArrayRef<OpFoldResult>":$sizes, "ArrayRef<OpFoldResult>":$strides, "ArrayRef<OpFoldResult>":$sizes, "ArrayRef<OpFoldResult>":$strides,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>, CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>,
// Build a SubTensorOp with mixed static and dynamic entries and custom // Build a SubTensorOp with mixed static and dynamic entries and custom
// result type. If the type passed is nullptr, it is inferred. // result type. If the type passed is nullptr, it is inferred.
OpBuilderDAG<(ins "RankedTensorType":$resultType, "Value":$source, OpBuilder<(ins "RankedTensorType":$resultType, "Value":$source,
"ArrayRef<OpFoldResult>":$offsets, "ArrayRef<OpFoldResult>":$sizes, "ArrayRef<OpFoldResult>":$offsets, "ArrayRef<OpFoldResult>":$sizes,
"ArrayRef<OpFoldResult>":$strides, "ArrayRef<OpFoldResult>":$strides,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>, CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>,
// Build a SubTensorOp with dynamic entries and custom result type. If the // Build a SubTensorOp with dynamic entries and custom result type. If the
// type passed is nullptr, it is inferred. // type passed is nullptr, it is inferred.
OpBuilderDAG<(ins "Value":$source, "ValueRange":$offsets, OpBuilder<(ins "Value":$source, "ValueRange":$offsets,
"ValueRange":$sizes, "ValueRange":$strides, "ValueRange":$sizes, "ValueRange":$strides,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>, CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>,
// Build a SubTensorOp with dynamic entries and inferred result type. // Build a SubTensorOp with dynamic entries and inferred result type.
OpBuilderDAG<(ins "RankedTensorType":$resultType, "Value":$source, OpBuilder<(ins "RankedTensorType":$resultType, "Value":$source,
"ValueRange":$offsets, "ValueRange":$sizes, "ValueRange":$strides, "ValueRange":$offsets, "ValueRange":$sizes, "ValueRange":$strides,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)> CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>
]; ];
@ -3009,12 +3009,12 @@ def SubTensorInsertOp : BaseOpWithOffsetSizesAndStrides<
let builders = [ let builders = [
// Build a SubTensorInsertOp with mixed static and dynamic entries. // Build a SubTensorInsertOp with mixed static and dynamic entries.
OpBuilderDAG<(ins "Value":$source, "Value":$dest, OpBuilder<(ins "Value":$source, "Value":$dest,
"ArrayRef<OpFoldResult>":$offsets, "ArrayRef<OpFoldResult>":$sizes, "ArrayRef<OpFoldResult>":$offsets, "ArrayRef<OpFoldResult>":$sizes,
"ArrayRef<OpFoldResult>":$strides, "ArrayRef<OpFoldResult>":$strides,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>, CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>,
// Build a SubTensorInsertOp with dynamic entries. // Build a SubTensorInsertOp with dynamic entries.
OpBuilderDAG<(ins "Value":$source, "Value":$dest, OpBuilder<(ins "Value":$source, "Value":$dest,
"ValueRange":$offsets, "ValueRange":$sizes, "ValueRange":$strides, "ValueRange":$offsets, "ValueRange":$sizes, "ValueRange":$strides,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)> CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>
]; ];
@ -3080,7 +3080,7 @@ def TensorLoadOp : Std_Op<"tensor_load",
let verifier = ?; let verifier = ?;
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$memref), [{ OpBuilder<(ins "Value":$memref), [{
$_state.addOperands(memref); $_state.addOperands(memref);
$_state.addTypes(getTensorTypeFromMemRefType(memref.getType())); $_state.addTypes(getTensorTypeFromMemRefType(memref.getType()));
}]>]; }]>];
@ -3199,7 +3199,7 @@ def TransposeOp : Std_Op<"transpose", [NoSideEffect]>,
}]; }];
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$in, "AffineMapAttr":$permutation, OpBuilder<(ins "Value":$in, "AffineMapAttr":$permutation,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>]; CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>];
let extraClassDeclaration = [{ let extraClassDeclaration = [{
@ -3239,7 +3239,7 @@ def TruncateIOp : Std_Op<"trunci", [NoSideEffect,
let results = (outs SignlessIntegerLike); let results = (outs SignlessIntegerLike);
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$value, "Type":$destType), [{ OpBuilder<(ins "Value":$value, "Type":$destType), [{
$_state.addOperands(value); $_state.addOperands(value);
$_state.addTypes(destType); $_state.addTypes(destType);
}]>]; }]>];
@ -3483,7 +3483,7 @@ def ZeroExtendIOp : Std_Op<"zexti", [NoSideEffect,
let results = (outs SignlessIntegerLike); let results = (outs SignlessIntegerLike);
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$value, "Type":$destType), [{ OpBuilder<(ins "Value":$value, "Type":$destType), [{
$_state.addOperands(value); $_state.addOperands(value);
$_state.addTypes(destType); $_state.addTypes(destType);
}]>]; }]>];

View File

@ -91,7 +91,7 @@ def Tensor_ExtractOp : Tensor_Op<"extract",
let assemblyFormat = "$tensor `[` $indices `]` attr-dict `:` type($tensor)"; let assemblyFormat = "$tensor `[` $indices `]` attr-dict `:` type($tensor)";
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$tensor, CArg<"ValueRange", "{}">:$indices), [{ OpBuilder<(ins "Value":$tensor, CArg<"ValueRange", "{}">:$indices), [{
auto resType = tensor.getType().cast<ShapedType>().getElementType(); auto resType = tensor.getType().cast<ShapedType>().getElementType();
build($_builder, $_state, resType, tensor, indices); build($_builder, $_state, resType, tensor, indices);
}]>]; }]>];
@ -131,9 +131,9 @@ def Tensor_FromElementsOp : Tensor_Op<"from_elements", [
let skipDefaultBuilders = 1; let skipDefaultBuilders = 1;
let builders = [ let builders = [
OpBuilderDAG<(ins "Type":$elementType, "ValueRange":$elements)>, OpBuilder<(ins "Type":$elementType, "ValueRange":$elements)>,
// Special case builder for when `elements` has size >=1. // Special case builder for when `elements` has size >=1.
OpBuilderDAG<(ins "ValueRange":$elements)> OpBuilder<(ins "ValueRange":$elements)>
]; ];
let hasCanonicalizer = 1; let hasCanonicalizer = 1;
@ -175,7 +175,7 @@ def Tensor_GenerateOp : Tensor_Op<"generate",
let builders = [ let builders = [
// Build op and populate its body per callback function. // Build op and populate its body per callback function.
OpBuilderDAG<(ins "Type":$resultTy, "ValueRange":$dynamicExtents, OpBuilder<(ins "Type":$resultTy, "ValueRange":$dynamicExtents,
"function_ref<void(OpBuilder &, Location, ValueRange)>")>, "function_ref<void(OpBuilder &, Location, ValueRange)>")>,
]; ];
@ -200,7 +200,7 @@ def Tensor_YieldOp : Tensor_Op<"yield",
let assemblyFormat = "$value attr-dict `:` type($value)"; let assemblyFormat = "$value attr-dict `:` type($value)";
// Dummy builder to appease code in templated ensureTerminator that // Dummy builder to appease code in templated ensureTerminator that
// GenerateOp's auto-generated parser calls. // GenerateOp's auto-generated parser calls.
let builders = [OpBuilderDAG<(ins), [{ /* nothing to do */ }]>]; let builders = [OpBuilder<(ins), [{ /* nothing to do */ }]>];
let verifier = ?; let verifier = ?;
} }

View File

@ -111,7 +111,7 @@ def Tosa_PadOpQuantizationAttr : StructAttr<"PadOpQuantizationAttr",
// This builder is called on all convolution operators except for TransposeConv, // This builder is called on all convolution operators except for TransposeConv,
// which has specialized output shape semantics. The builder also defines the // which has specialized output shape semantics. The builder also defines the
// bitwidth of the output given the bit width of the input & weight content. // bitwidth of the output given the bit width of the input & weight content.
def Tosa_ConvOpQuantInfoBuilder : OpBuilderDAG< def Tosa_ConvOpQuantInfoBuilder : OpBuilder<
(ins "Type":$outputType, "Value":$input, "Value":$weight, "Value":$bias, (ins "Type":$outputType, "Value":$input, "Value":$weight, "Value":$bias,
"ArrayAttr":$pad, "ArrayAttr":$stride, "ArrayAttr":$dilation), "ArrayAttr":$pad, "ArrayAttr":$stride, "ArrayAttr":$dilation),
[{ [{
@ -121,7 +121,7 @@ def Tosa_ConvOpQuantInfoBuilder : OpBuilderDAG<
}]>; }]>;
// Handles tosa.transpose_conv2d which has an outpad and output shape attribute. // Handles tosa.transpose_conv2d which has an outpad and output shape attribute.
def Tosa_TransConvOpQuantInfoBuilder : OpBuilderDAG< def Tosa_TransConvOpQuantInfoBuilder : OpBuilder<
(ins "Type":$outputType, "Value":$input, "Value":$weight, "Value":$bias, (ins "Type":$outputType, "Value":$input, "Value":$weight, "Value":$bias,
"ArrayAttr":$outpad, "ArrayAttr":$stride, "ArrayAttr":$dilation, "ArrayAttr":$outpad, "ArrayAttr":$stride, "ArrayAttr":$dilation,
"ArrayAttr":$outputShape), "ArrayAttr":$outputShape),
@ -134,7 +134,7 @@ def Tosa_TransConvOpQuantInfoBuilder : OpBuilderDAG<
// The tosa.fully_connected op has its own builder as it does not have // The tosa.fully_connected op has its own builder as it does not have
// strides/dilation/padding. // strides/dilation/padding.
def Tosa_FCOpQuantInfoBuilder : OpBuilderDAG< def Tosa_FCOpQuantInfoBuilder : OpBuilder<
(ins "Type":$outputType, "Value":$input, "Value":$weight, "Value":$bias), (ins "Type":$outputType, "Value":$input, "Value":$weight, "Value":$bias),
[{ [{
buildFCOpWithQuantInfo($_builder, $_state, outputType, buildFCOpWithQuantInfo($_builder, $_state, outputType,
@ -145,7 +145,7 @@ def Tosa_FCOpQuantInfoBuilder : OpBuilderDAG<
// op must be constructed where the weight is not a constant. In this case, // op must be constructed where the weight is not a constant. In this case,
// the fully_connected op must be expressed using matmul. // the fully_connected op must be expressed using matmul.
// TODO: Add link to the leglization document explaining this. // TODO: Add link to the leglization document explaining this.
def Tosa_MatMulOpQuantInfoBuilder : OpBuilderDAG< def Tosa_MatMulOpQuantInfoBuilder : OpBuilder<
(ins "Type":$outputType, "Value":$a, "Value":$b), (ins "Type":$outputType, "Value":$a, "Value":$b),
[{ [{
buildMatMulOpWithQuantInfo($_builder, $_state, outputType, buildMatMulOpWithQuantInfo($_builder, $_state, outputType,
@ -155,7 +155,7 @@ def Tosa_MatMulOpQuantInfoBuilder : OpBuilderDAG<
// Both the tosa.avg_pool2d and unary ops use the same // Both the tosa.avg_pool2d and unary ops use the same
// UnaruOpQuantizationAttr but the avg_pool operator has its own builder as it // UnaruOpQuantizationAttr but the avg_pool operator has its own builder as it
// has additional parameters not part of the unary ops. // has additional parameters not part of the unary ops.
def Tosa_AvgPool2dOpQuantInfoBuilder : OpBuilderDAG< def Tosa_AvgPool2dOpQuantInfoBuilder : OpBuilder<
(ins "Type":$outputType, "Value":$input, "ArrayAttr":$kernel, (ins "Type":$outputType, "Value":$input, "ArrayAttr":$kernel,
"ArrayAttr":$stride, "ArrayAttr":$pad), "ArrayAttr":$stride, "ArrayAttr":$pad),
[{ [{
@ -166,7 +166,7 @@ def Tosa_AvgPool2dOpQuantInfoBuilder : OpBuilderDAG<
// This builder is called on single-parameter unary operators that have a scale // This builder is called on single-parameter unary operators that have a scale
// relationship between their input and output, expressed by the // relationship between their input and output, expressed by the
// UnaryOpQuantizationAttr. // UnaryOpQuantizationAttr.
def Tosa_UnaryOpQuantInfoBuilder : OpBuilderDAG< def Tosa_UnaryOpQuantInfoBuilder : OpBuilder<
(ins "Type":$outputType, "Value":$input), (ins "Type":$outputType, "Value":$input),
[{ [{
buildUnaryOpWithQuantInfo($_builder, $_state, outputType, input); buildUnaryOpWithQuantInfo($_builder, $_state, outputType, input);
@ -175,7 +175,7 @@ def Tosa_UnaryOpQuantInfoBuilder : OpBuilderDAG<
// This builder is called on the TOSA pad operator that needs to create its own // This builder is called on the TOSA pad operator that needs to create its own
// OptionalAttr quantization_attr parameter to scale the padding values // OptionalAttr quantization_attr parameter to scale the padding values
// correctly. // correctly.
def Tosa_PadOpQuantInfoBuilder : OpBuilderDAG< def Tosa_PadOpQuantInfoBuilder : OpBuilder<
(ins "Type":$outputType, "Value":$input, "Value":$paddings), (ins "Type":$outputType, "Value":$input, "Value":$paddings),
[{ [{
buildPadOpWithQuantInfo($_builder, $_state, outputType, buildPadOpWithQuantInfo($_builder, $_state, outputType,

View File

@ -199,9 +199,9 @@ def Vector_ContractionOp :
``` ```
}]; }];
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$lhs, "Value":$rhs, "Value":$acc, OpBuilder<(ins "Value":$lhs, "Value":$rhs, "Value":$acc,
"ArrayAttr":$indexingMaps, "ArrayAttr":$iteratorTypes)>, "ArrayAttr":$indexingMaps, "ArrayAttr":$iteratorTypes)>,
OpBuilderDAG<(ins "Value":$lhs, "Value":$rhs, "Value":$acc, OpBuilder<(ins "Value":$lhs, "Value":$rhs, "Value":$acc,
"ArrayRef<ArrayRef<AffineExpr>>":$indexingExprs, "ArrayRef<ArrayRef<AffineExpr>>":$indexingExprs,
"ArrayRef<StringRef>":$iteratorTypes)> "ArrayRef<StringRef>":$iteratorTypes)>
]; ];
@ -371,7 +371,7 @@ def Vector_ShuffleOp :
``` ```
}]; }];
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$v1, "Value":$v2, "ArrayRef<int64_t>")> OpBuilder<(ins "Value":$v1, "Value":$v2, "ArrayRef<int64_t>")>
]; ];
let extraClassDeclaration = [{ let extraClassDeclaration = [{
static StringRef getMaskAttrName() { return "mask"; } static StringRef getMaskAttrName() { return "mask"; }
@ -414,8 +414,8 @@ def Vector_ExtractElementOp :
}]; }];
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$source, "int64_t":$position)>, OpBuilder<(ins "Value":$source, "int64_t":$position)>,
OpBuilderDAG<(ins "Value":$source, "Value":$position)> OpBuilder<(ins "Value":$source, "Value":$position)>
]; ];
let extraClassDeclaration = [{ let extraClassDeclaration = [{
VectorType getVectorType() { VectorType getVectorType() {
@ -443,10 +443,10 @@ def Vector_ExtractOp :
``` ```
}]; }];
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$source, "ArrayRef<int64_t>":$position)>, OpBuilder<(ins "Value":$source, "ArrayRef<int64_t>":$position)>,
// Convenience builder which assumes the values in `position` are defined by // Convenience builder which assumes the values in `position` are defined by
// ConstantIndexOp. // ConstantIndexOp.
OpBuilderDAG<(ins "Value":$source, "ValueRange":$position)> OpBuilder<(ins "Value":$source, "ValueRange":$position)>
]; ];
let extraClassDeclaration = [{ let extraClassDeclaration = [{
static StringRef getPositionAttrName() { return "position"; } static StringRef getPositionAttrName() { return "position"; }
@ -493,7 +493,7 @@ def Vector_ExtractSlicesOp :
``` ```
}]; }];
let builders = [ let builders = [
OpBuilderDAG<(ins "TupleType":$tupleType, "Value":$vector, OpBuilder<(ins "TupleType":$tupleType, "Value":$vector,
"ArrayRef<int64_t>":$sizes, "ArrayRef<int64_t>":$strides)> "ArrayRef<int64_t>":$sizes, "ArrayRef<int64_t>":$strides)>
]; ];
let extraClassDeclaration = [{ let extraClassDeclaration = [{
@ -562,7 +562,7 @@ def Vector_ExtractMapOp :
``` ```
}]; }];
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$vector, "ValueRange":$ids, OpBuilder<(ins "Value":$vector, "ValueRange":$ids,
"ArrayRef<int64_t>":$multiplicity, "ArrayRef<int64_t>":$multiplicity,
"AffineMap":$map)>]; "AffineMap":$map)>];
let extraClassDeclaration = [{ let extraClassDeclaration = [{
@ -609,7 +609,7 @@ def Vector_FMAOp :
let verifier = ?; let verifier = ?;
let assemblyFormat = "$lhs `,` $rhs `,` $acc attr-dict `:` type($lhs)"; let assemblyFormat = "$lhs `,` $rhs `,` $acc attr-dict `:` type($lhs)";
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$lhs, "Value":$rhs, "Value":$acc), OpBuilder<(ins "Value":$lhs, "Value":$rhs, "Value":$acc),
[{build($_builder, $_state, lhs.getType(), lhs, rhs, acc);}]> [{build($_builder, $_state, lhs.getType(), lhs, rhs, acc);}]>
]; ];
let extraClassDeclaration = [{ let extraClassDeclaration = [{
@ -649,8 +649,8 @@ def Vector_InsertElementOp :
}]; }];
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$source, "Value":$dest, "int64_t":$position)>, OpBuilder<(ins "Value":$source, "Value":$dest, "int64_t":$position)>,
OpBuilderDAG<(ins "Value":$source, "Value":$dest, "Value":$position)> OpBuilder<(ins "Value":$source, "Value":$dest, "Value":$position)>
]; ];
let extraClassDeclaration = [{ let extraClassDeclaration = [{
Type getSourceType() { return source().getType(); } Type getSourceType() { return source().getType(); }
@ -686,10 +686,10 @@ def Vector_InsertOp :
}]; }];
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$source, "Value":$dest, OpBuilder<(ins "Value":$source, "Value":$dest,
"ArrayRef<int64_t>":$position)>, "ArrayRef<int64_t>":$position)>,
// Convenience builder which assumes all values are constant indices. // Convenience builder which assumes all values are constant indices.
OpBuilderDAG<(ins "Value":$source, "Value":$dest, "ValueRange":$position)> OpBuilder<(ins "Value":$source, "Value":$dest, "ValueRange":$position)>
]; ];
let extraClassDeclaration = [{ let extraClassDeclaration = [{
static StringRef getPositionAttrName() { return "position"; } static StringRef getPositionAttrName() { return "position"; }
@ -806,7 +806,7 @@ def Vector_InsertMapOp :
into vector<64x4x32xf32> into vector<64x4x32xf32>
``` ```
}]; }];
let builders = [OpBuilderDAG<(ins "Value":$vector, "Value":$dest, let builders = [OpBuilder<(ins "Value":$vector, "Value":$dest,
"ValueRange":$ids)>]; "ValueRange":$ids)>];
let extraClassDeclaration = [{ let extraClassDeclaration = [{
VectorType getSourceVectorType() { VectorType getSourceVectorType() {
@ -859,7 +859,7 @@ def Vector_InsertStridedSliceOp :
}]; }];
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$source, "Value":$dest, OpBuilder<(ins "Value":$source, "Value":$dest,
"ArrayRef<int64_t>":$offsets, "ArrayRef<int64_t>":$strides)> "ArrayRef<int64_t>":$offsets, "ArrayRef<int64_t>":$strides)>
]; ];
let extraClassDeclaration = [{ let extraClassDeclaration = [{
@ -935,7 +935,7 @@ def Vector_OuterProductOp :
}]; }];
let builders = [ let builders = [
// Build an op without mask, use the type of `acc` as the return type. // Build an op without mask, use the type of `acc` as the return type.
OpBuilderDAG<(ins "Value":$lhs, "Value":$rhs, "Value":$acc)> OpBuilder<(ins "Value":$lhs, "Value":$rhs, "Value":$acc)>
]; ];
let extraClassDeclaration = [{ let extraClassDeclaration = [{
VectorType getOperandVectorTypeLHS() { VectorType getOperandVectorTypeLHS() {
@ -1115,7 +1115,7 @@ def Vector_ExtractStridedSliceOp :
``` ```
}]; }];
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$source, "ArrayRef<int64_t>":$offsets, OpBuilder<(ins "Value":$source, "ArrayRef<int64_t>":$offsets,
"ArrayRef<int64_t>":$sizes, "ArrayRef<int64_t>":$strides)> "ArrayRef<int64_t>":$sizes, "ArrayRef<int64_t>":$strides)>
]; ];
let extraClassDeclaration = [{ let extraClassDeclaration = [{
@ -1288,16 +1288,16 @@ def Vector_TransferReadOp :
let builders = [ let builders = [
// Builder that sets padding to zero. // Builder that sets padding to zero.
OpBuilderDAG<(ins "VectorType":$vector, "Value":$source, OpBuilder<(ins "VectorType":$vector, "Value":$source,
"ValueRange":$indices, "AffineMap":$permutationMap, "ValueRange":$indices, "AffineMap":$permutationMap,
CArg<"ArrayRef<bool>", "{}">:$maybeMasked)>, CArg<"ArrayRef<bool>", "{}">:$maybeMasked)>,
// Builder that sets padding to 'getMinorIdentityMap'. // Builder that sets padding to 'getMinorIdentityMap'.
OpBuilderDAG<(ins "VectorType":$vector, "Value":$source, OpBuilder<(ins "VectorType":$vector, "Value":$source,
"ValueRange":$indices, "Value":$padding, "ValueRange":$indices, "Value":$padding,
CArg<"ArrayRef<bool>", "{}">:$maybeMasked)>, CArg<"ArrayRef<bool>", "{}">:$maybeMasked)>,
// Builder that sets permutation map (resp. padding) to // Builder that sets permutation map (resp. padding) to
// 'getMinorIdentityMap' (resp. zero). // 'getMinorIdentityMap' (resp. zero).
OpBuilderDAG<(ins "VectorType":$vector, "Value":$source, OpBuilder<(ins "VectorType":$vector, "Value":$source,
"ValueRange":$indices, CArg<"ArrayRef<bool>", "{}">:$maybeMasked)> "ValueRange":$indices, CArg<"ArrayRef<bool>", "{}">:$maybeMasked)>
]; ];
@ -1385,13 +1385,13 @@ def Vector_TransferWriteOp :
let builders = [ let builders = [
// Builder that sets permutation map to 'getMinorIdentityMap'. // Builder that sets permutation map to 'getMinorIdentityMap'.
OpBuilderDAG<(ins "Value":$vector, "Value":$source, "ValueRange":$indices, OpBuilder<(ins "Value":$vector, "Value":$source, "ValueRange":$indices,
CArg<"ArrayRef<bool>", "{}">:$maybeMasked)>, CArg<"ArrayRef<bool>", "{}">:$maybeMasked)>,
OpBuilderDAG<(ins "Value":$vector, "Value":$source, "ValueRange":$indices, OpBuilder<(ins "Value":$vector, "Value":$source, "ValueRange":$indices,
"AffineMap":$permutationMap)>, "AffineMap":$permutationMap)>,
OpBuilderDAG<(ins "Value":$vector, "Value":$source, "ValueRange":$indices, OpBuilder<(ins "Value":$vector, "Value":$source, "ValueRange":$indices,
"AffineMapAttr":$permutationMap, "ArrayAttr":$masked)>, "AffineMapAttr":$permutationMap, "ArrayAttr":$masked)>,
OpBuilderDAG<(ins "Value":$vector, "Value":$source, "ValueRange":$indices, OpBuilder<(ins "Value":$vector, "Value":$source, "ValueRange":$indices,
"AffineMap":$permutationMap, "ArrayAttr":$masked)>, "AffineMap":$permutationMap, "ArrayAttr":$masked)>,
]; ];
@ -2016,7 +2016,7 @@ def Vector_TypeCastOp :
/// Build the canonical memRefType with a single vector. /// Build the canonical memRefType with a single vector.
/// E.g. memref<4 x 5 x vector<6 x f32>> -> memref<vector<4 x 5 x 6 x f32>>. /// E.g. memref<4 x 5 x vector<6 x f32>> -> memref<vector<4 x 5 x 6 x f32>>.
let builders = [OpBuilderDAG<(ins "Value":$source)>]; let builders = [OpBuilder<(ins "Value":$source)>];
let extraClassDeclaration = [{ let extraClassDeclaration = [{
MemRefType getMemRefType() { MemRefType getMemRefType() {
@ -2172,7 +2172,7 @@ def Vector_TransposeOp :
``` ```
}]; }];
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$vector, "ArrayRef<int64_t>":$transp)> OpBuilder<(ins "Value":$vector, "ArrayRef<int64_t>":$transp)>
]; ];
let extraClassDeclaration = [{ let extraClassDeclaration = [{
VectorType getVectorType() { VectorType getVectorType() {
@ -2318,7 +2318,7 @@ def Vector_MatmulOp : Vector_Op<"matrix_multiply", [NoSideEffect,
``` ```
}]; }];
let builders = [ let builders = [
OpBuilderDAG<(ins "Value":$lhs, "Value":$rhs, "unsigned":$lhsRows, OpBuilder<(ins "Value":$lhs, "Value":$rhs, "unsigned":$lhsRows,
"unsigned":$lhsColumns, "unsigned":$rhsColumns), "unsigned":$lhsColumns, "unsigned":$rhsColumns),
[{ [{
$_state.addOperands({lhs, rhs}); $_state.addOperands({lhs, rhs});

View File

@ -76,7 +76,7 @@ def FuncOp : Builtin_Op<"func", [
OptionalAttr<StrAttr>:$sym_visibility); OptionalAttr<StrAttr>:$sym_visibility);
let regions = (region AnyRegion:$body); let regions = (region AnyRegion:$body);
let builders = [OpBuilderDAG<(ins let builders = [OpBuilder<(ins
"StringRef":$name, "FunctionType":$type, "StringRef":$name, "FunctionType":$type,
CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs, CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs,
CArg<"ArrayRef<DictionaryAttr>", "{}">:$argAttrs) CArg<"ArrayRef<DictionaryAttr>", "{}">:$argAttrs)
@ -184,7 +184,7 @@ def ModuleOp : Builtin_Op<"module", [
let regions = (region SizedRegion<1>:$body); let regions = (region SizedRegion<1>:$body);
let assemblyFormat = "($sym_name^)? attr-dict-with-keyword $body"; let assemblyFormat = "($sym_name^)? attr-dict-with-keyword $body";
let builders = [OpBuilderDAG<(ins CArg<"Optional<StringRef>", "{}">:$name)>]; let builders = [OpBuilder<(ins CArg<"Optional<StringRef>", "{}">:$name)>];
let extraClassDeclaration = [{ let extraClassDeclaration = [{
/// Construct a module from the given location with an optional name. /// Construct a module from the given location with an optional name.
static ModuleOp create(Location loc, Optional<StringRef> name = llvm::None); static ModuleOp create(Location loc, Optional<StringRef> name = llvm::None);

View File

@ -2015,7 +2015,7 @@ def successor;
// type. For example, the following signature specification // type. For example, the following signature specification
// //
// ``` // ```
// OpBuilderDAG<(ins "int":$integerArg, CArg<"float", "3.0f">:$floatArg)> // OpBuilder<(ins "int":$integerArg, CArg<"float", "3.0f">:$floatArg)>
// ``` // ```
// //
// has an integer parameter and a float parameter with a default value. // has an integer parameter and a float parameter with a default value.
@ -2023,7 +2023,7 @@ def successor;
// If an empty string is passed in for `body`, then *only* the builder // If an empty string is passed in for `body`, then *only* the builder
// declaration will be generated; this provides a way to define complicated // declaration will be generated; this provides a way to define complicated
// builders entirely in C++. // builders entirely in C++.
class OpBuilderDAG<dag p, code b = ""> { class OpBuilder<dag p, code b = ""> {
dag dagParams = p; dag dagParams = p;
code body = b; code body = b;
} }
@ -2103,7 +2103,7 @@ class Op<Dialect dialect, string mnemonic, list<OpTrait> props = []> {
// ValueRange operands, // ValueRange operands,
// ArrayRef<NamedAttribute> attributes); // ArrayRef<NamedAttribute> attributes);
// ``` // ```
list<OpBuilderDAG> builders = ?; list<OpBuilder> builders = ?;
// Avoid generating default build functions. Custom builders must be // Avoid generating default build functions. Custom builders must be
// provided. // provided.

View File

@ -674,7 +674,7 @@ def OpFuncRef : TEST_Op<"op_funcref"> {
let description = [{ let description = [{
The "test.op_funcref" is a test op with a reference to a function symbol. The "test.op_funcref" is a test op with a reference to a function symbol.
}]; }];
let builders = [OpBuilderDAG<(ins "FuncOp":$function)>]; let builders = [OpBuilder<(ins "FuncOp":$function)>];
} }
// Pattern add the argument plus a increasing static number hidden in // Pattern add the argument plus a increasing static number hidden in
@ -1162,7 +1162,7 @@ def MixedVResultOp3 : TEST_Op<"mixed_variadic_out3",
// We will use this op in a nested result pattern, where we cannot deduce the // We will use this op in a nested result pattern, where we cannot deduce the
// result type. So need to provide a builder not requiring result types. // result type. So need to provide a builder not requiring result types.
let builders = [ let builders = [
OpBuilderDAG<(ins "IntegerAttr":$count), OpBuilder<(ins "IntegerAttr":$count),
[{ [{
auto i32Type = $_builder.getIntegerType(32); auto i32Type = $_builder.getIntegerType(32);
$_state.addTypes(i32Type); // $output1 $_state.addTypes(i32Type); // $output1
@ -1221,7 +1221,7 @@ def LegalOpB : TEST_Op<"legal_op_b">, Results<(outs I32)>;
def IllegalOpTerminator : TEST_Op<"illegal_op_terminator", [Terminator]>; def IllegalOpTerminator : TEST_Op<"illegal_op_terminator", [Terminator]>;
def IllegalOpWithRegion : TEST_Op<"illegal_op_with_region"> { def IllegalOpWithRegion : TEST_Op<"illegal_op_with_region"> {
let skipDefaultBuilders = 1; let skipDefaultBuilders = 1;
let builders = [OpBuilderDAG<(ins), let builders = [OpBuilder<(ins),
[{ [{
Region *bodyRegion = $_state.addRegion(); Region *bodyRegion = $_state.addRegion();
OpBuilder::InsertionGuard g($_builder); OpBuilder::InsertionGuard g($_builder);
@ -1265,7 +1265,7 @@ def TestRecursiveRewriteOp : TEST_Op<"recursive_rewrite"> {
def TestRegionBuilderOp : TEST_Op<"region_builder">; def TestRegionBuilderOp : TEST_Op<"region_builder">;
def TestReturnOp : TEST_Op<"return", [ReturnLike, Terminator]> { def TestReturnOp : TEST_Op<"return", [ReturnLike, Terminator]> {
let arguments = (ins Variadic<AnyType>); let arguments = (ins Variadic<AnyType>);
let builders = [OpBuilderDAG<(ins), let builders = [OpBuilder<(ins),
[{ build($_builder, $_state, {}); }]> [{ build($_builder, $_state, {}); }]>
]; ];
} }
@ -1830,7 +1830,7 @@ def RegionYieldOp : TEST_Op<"region_yield",
let assemblyFormat = [{ let assemblyFormat = [{
$result `:` type($result) attr-dict $result `:` type($result) attr-dict
}]; }];
let builders = [OpBuilderDAG<(ins), let builders = [OpBuilder<(ins),
[{ build($_builder, $_state, {}); }]> [{ build($_builder, $_state, {}); }]>
]; ];
} }

View File

@ -164,7 +164,7 @@ It has one output.
// Test attribute builder // Test attribute builder
// ODS-LABEL: def Test7Op // ODS-LABEL: def Test7Op
// ODS: OpBuilderDAG< // ODS: OpBuilder<
// ODS: (ins "TypeRange":$resultTensorTypes, "ValueRange":$inputs, // ODS: (ins "TypeRange":$resultTensorTypes, "ValueRange":$inputs,
// ODS: "ValueRange":$outputs, "Attribute":$attr_a, "Attribute":$attr_b) // ODS: "ValueRange":$outputs, "Attribute":$attr_a, "Attribute":$attr_b)
// ODS: $_state.addAttribute("attr_a", attr_a); // ODS: $_state.addAttribute("attr_a", attr_a);

View File

@ -35,8 +35,8 @@ def NS_AOp : NS_Op<"a_op", [IsolatedFromAbove, IsolatedFromAbove]> {
AnyRegion:$someRegion, AnyRegion:$someRegion,
VariadicRegion<AnyRegion>:$someRegions VariadicRegion<AnyRegion>:$someRegions
); );
let builders = [OpBuilderDAG<(ins "Value":$val)>, let builders = [OpBuilder<(ins "Value":$val)>,
OpBuilderDAG<(ins CArg<"int", "0">:$integer)>]; OpBuilder<(ins CArg<"int", "0">:$integer)>];
let parser = [{ foo }]; let parser = [{ foo }];
let printer = [{ bar }]; let printer = [{ bar }];
let verifier = [{ baz }]; let verifier = [{ baz }];
@ -296,7 +296,7 @@ def NS_ResultWithDialectTypeOp : NS_Op<"op_with_dialect_type", []> {
def NS_SkipDefaultBuildersOp : NS_Op<"skip_default_builders", []> { def NS_SkipDefaultBuildersOp : NS_Op<"skip_default_builders", []> {
let skipDefaultBuilders = 1; let skipDefaultBuilders = 1;
let builders = [OpBuilderDAG<(ins "Value":$val)>]; let builders = [OpBuilder<(ins "Value":$val)>];
} }
// CHECK-LABEL: NS::SkipDefaultBuildersOp declarations // CHECK-LABEL: NS::SkipDefaultBuildersOp declarations

View File

@ -12,7 +12,7 @@ def Test_Dialect : Dialect {
// ERROR1: error: expected 'ins' // ERROR1: error: expected 'ins'
def OpInsMissing : Op<Test_Dialect, "ins_missing"> { def OpInsMissing : Op<Test_Dialect, "ins_missing"> {
let builders = [ let builders = [
OpBuilderDAG<(outs)> OpBuilder<(outs)>
]; ];
} }
#endif #endif
@ -21,7 +21,7 @@ def OpInsMissing : Op<Test_Dialect, "ins_missing"> {
// ERROR2: error: expected an argument with default value after other arguments with default values // ERROR2: error: expected an argument with default value after other arguments with default values
def OpDefaultValueNotTrailing : Op<Test_Dialect, "default_value"> { def OpDefaultValueNotTrailing : Op<Test_Dialect, "default_value"> {
let builders = [ let builders = [
OpBuilderDAG<(ins CArg<"int", "42">, "int")> OpBuilder<(ins CArg<"int", "42">, "int")>
]; ];
} }
#endif #endif
@ -30,7 +30,7 @@ def OpDefaultValueNotTrailing : Op<Test_Dialect, "default_value"> {
// ERROR3: error: expected an argument with default value after other arguments with default values // ERROR3: error: expected an argument with default value after other arguments with default values
def OpDefaultValueNotTrailing : Op<Test_Dialect, "default_value"> { def OpDefaultValueNotTrailing : Op<Test_Dialect, "default_value"> {
let builders = [ let builders = [
OpBuilderDAG<(ins CArg<"int", "42">, CArg<"int">)> OpBuilder<(ins CArg<"int", "42">, CArg<"int">)>
]; ];
} }
#endif #endif

View File

@ -1886,7 +1886,7 @@ void TCParser::printODS(llvm::raw_ostream &os, StringRef cppOpName,
let skipDefaultBuilders = 1; let skipDefaultBuilders = 1;
let builders = [ let builders = [
OpBuilderDAG< OpBuilder<
(ins "ValueRange":$inputs, "ValueRange":$outputs), (ins "ValueRange":$inputs, "ValueRange":$outputs),
[{{ [{{
$_state.addOperands(inputs); $_state.addOperands(inputs);
@ -1902,7 +1902,7 @@ void TCParser::printODS(llvm::raw_ostream &os, StringRef cppOpName,
TypeRange(inputs), TypeRange(inputs),
TypeRange(outputs)/*, TODO: support captures*/); TypeRange(outputs)/*, TODO: support captures*/);
}]>, }]>,
OpBuilderDAG< OpBuilder<
(ins "TypeRange":$resultTensorTypes, "ValueRange":$inputs, (ins "TypeRange":$resultTensorTypes, "ValueRange":$inputs,
"ValueRange":$outputs), "ValueRange":$outputs),
[{{ [{{
@ -1920,7 +1920,7 @@ void TCParser::printODS(llvm::raw_ostream &os, StringRef cppOpName,
TypeRange(inputs), TypeRange(inputs),
TypeRange(outputs)/*, TODO: support captures*/); TypeRange(outputs)/*, TODO: support captures*/);
}]>, }]>,
OpBuilderDAG< OpBuilder<
(ins "TypeRange":$resultTensorTypes, "ValueRange":$operands, (ins "TypeRange":$resultTensorTypes, "ValueRange":$operands,
CArg<"ArrayRef<NamedAttribute>", "{{}">:$attributes), CArg<"ArrayRef<NamedAttribute>", "{{}">:$attributes),
[{{ [{{
@ -1995,7 +1995,7 @@ void TCParser::printODS(llvm::raw_ostream &os, StringRef cppOpName,
std::string attrStmtsList = llvm::join(attrStmts, "\n"); std::string attrStmtsList = llvm::join(attrStmts, "\n");
const char *builderFmt = R"FMT( const char *builderFmt = R"FMT(
, OpBuilderDAG< , OpBuilder<
(ins "TypeRange":$resultTensorTypes, "ValueRange":$inputs, (ins "TypeRange":$resultTensorTypes, "ValueRange":$inputs,
"ValueRange":$outputs, {1}), "ValueRange":$outputs, {1}),
[{{ [{{

View File

@ -435,7 +435,7 @@ def {0} : LinalgStructuredBase_Op<"{1}", !listconcat([
let skipDefaultBuilders = 1; let skipDefaultBuilders = 1;
let builders = [ let builders = [
OpBuilderDAG< OpBuilder<
(ins "ValueRange":$inputs, "ValueRange":$outputs), (ins "ValueRange":$inputs, "ValueRange":$outputs),
[{{ [{{
$_state.addOperands(inputs); $_state.addOperands(inputs);
@ -451,7 +451,7 @@ def {0} : LinalgStructuredBase_Op<"{1}", !listconcat([
TypeRange(inputs), TypeRange(inputs),
TypeRange(outputs)/*, TODO: support captures*/); TypeRange(outputs)/*, TODO: support captures*/);
}]>, }]>,
OpBuilderDAG< OpBuilder<
(ins "TypeRange":$resultTensorTypes, "ValueRange":$inputs, (ins "TypeRange":$resultTensorTypes, "ValueRange":$inputs,
"ValueRange":$outputs), "ValueRange":$outputs),
[{{ [{{
@ -469,7 +469,7 @@ def {0} : LinalgStructuredBase_Op<"{1}", !listconcat([
TypeRange(inputs), TypeRange(inputs),
TypeRange(outputs)/*, TODO: support captures*/); TypeRange(outputs)/*, TODO: support captures*/);
}]>, }]>,
OpBuilderDAG< OpBuilder<
(ins "TypeRange":$resultTensorTypes, "ValueRange":$operands, (ins "TypeRange":$resultTensorTypes, "ValueRange":$operands,
CArg<"ArrayRef<NamedAttribute>", "{{}">:$attributes), CArg<"ArrayRef<NamedAttribute>", "{{}">:$attributes),
[{{ [{{