diff --git a/flang/include/flang/Optimizer/Dialect/FIROps.td b/flang/include/flang/Optimizer/Dialect/FIROps.td --- a/flang/include/flang/Optimizer/Dialect/FIROps.td +++ b/flang/include/flang/Optimizer/Dialect/FIROps.td @@ -36,7 +36,7 @@ } // Base builder for allocate operations -def fir_AllocateOpBuilder : OpBuilderDAG<(ins +def fir_AllocateOpBuilder : OpBuilder<(ins "mlir::Type":$inType, CArg<"mlir::ValueRange", "{}">:$lenParams, CArg<"mlir::ValueRange", "{}">:$sizes, @@ -48,7 +48,7 @@ $_state.addAttributes(attributes); }]>; -def fir_NamedAllocateOpBuilder : OpBuilderDAG<(ins +def fir_NamedAllocateOpBuilder : OpBuilder<(ins "mlir::Type":$inType, "llvm::StringRef":$name, CArg<"mlir::ValueRange", "{}">:$lenParams, @@ -63,7 +63,7 @@ $_state.addAttributes(attributes); }]>; -def fir_OneResultOpBuilder : OpBuilderDAG<(ins +def fir_OneResultOpBuilder : OpBuilder<(ins "mlir::Type":$resultType, "mlir::ValueRange":$operands, CArg<"llvm::ArrayRef", "{}">:$attributes), @@ -86,8 +86,8 @@ let builders = [fir_OneResultOpBuilder]; } -class fir_TwoBuilders { - list builders = [b1, b2]; +class fir_TwoBuilders { + list builders = [b1, b2]; } class fir_AllocatableBaseOp traits = []> : @@ -309,7 +309,7 @@ let arguments = (ins Arg:$memref); - let builders = [OpBuilderDAG<(ins "mlir::Value":$refVal), + let builders = [OpBuilder<(ins "mlir::Value":$refVal), [{ if (!refVal) { mlir::emitError($_state.location, "LoadOp has null argument"); @@ -571,7 +571,7 @@ list traits = []> : fir_SwitchTerminatorOp { let skipDefaultBuilders = 1; - let builders = [OpBuilderDAG<(ins "mlir::Value":$selector, + let builders = [OpBuilder<(ins "mlir::Value":$selector, "llvm::ArrayRef":$compareOperands, "llvm::ArrayRef":$destinations, CArg<"llvm::ArrayRef", "{}">:$destOperands, @@ -760,13 +760,13 @@ let skipDefaultBuilders = 1; let builders = [ - OpBuilderDAG<(ins "mlir::Value":$selector, + OpBuilder<(ins "mlir::Value":$selector, "llvm::ArrayRef":$compareAttrs, "llvm::ArrayRef":$cmpOperands, "llvm::ArrayRef":$destinations, CArg<"llvm::ArrayRef", "{}">:$destOperands, CArg<"llvm::ArrayRef", "{}">:$attributes)>, - OpBuilderDAG<(ins "mlir::Value":$selector, + OpBuilder<(ins "mlir::Value":$selector, "llvm::ArrayRef":$compareAttrs, "llvm::ArrayRef":$cmpOpList, "llvm::ArrayRef":$destinations, @@ -856,7 +856,7 @@ }]; let skipDefaultBuilders = 1; - let builders = [OpBuilderDAG<(ins "mlir::Value":$selector, + let builders = [OpBuilder<(ins "mlir::Value":$selector, "llvm::ArrayRef":$typeOperands, "llvm::ArrayRef":$destinations, CArg<"llvm::ArrayRef", "{}">:$destOperands, @@ -1027,7 +1027,7 @@ let results = (outs fir_BoxType); let builders = [ - OpBuilderDAG<(ins "llvm::ArrayRef":$resultTypes, + OpBuilder<(ins "llvm::ArrayRef":$resultTypes, "mlir::Value":$memref, CArg<"mlir::Value", "{}">:$shape, CArg<"mlir::Value", "{}">:$slice, CArg<"mlir::ValueRange", "{}">:$lenParams), @@ -1812,7 +1812,7 @@ let verifier = [{ return ::verify(*this); }]; let builders = [ - OpBuilderDAG<(ins "mlir::Type":$resultType, + OpBuilder<(ins "mlir::Type":$resultType, "mlir::Value":$ref, "mlir::ValueRange":$coor), [{ return build($_builder, $_state, resultType, ref, coor, mlir::TypeAttr::get(ref.getType())); }]>, @@ -1924,7 +1924,7 @@ } }]; - let builders = [OpBuilderDAG<(ins "llvm::StringRef":$fieldName, + let builders = [OpBuilder<(ins "llvm::StringRef":$fieldName, "mlir::Type":$recTy, CArg<"mlir::ValueRange","{}">:$operands), [{ $_state.addAttribute(fieldAttrName(), @@ -2233,7 +2233,7 @@ << ", " << (*this)->getAttr(typeAttrName()); }]; - let builders = [OpBuilderDAG<(ins "llvm::StringRef":$fieldName, + let builders = [OpBuilder<(ins "llvm::StringRef":$fieldName, "mlir::Type":$recTy), [{ $_state.addAttribute(fieldAttrName(), $_builder.getStringAttr(fieldName)); @@ -2267,7 +2267,7 @@ }]; let arguments = (ins Variadic:$results); - let builders = [OpBuilderDAG<(ins), [{ /* do nothing */ }]>]; + let builders = [OpBuilder<(ins), [{ /* do nothing */ }]>]; let assemblyFormat = "($results^ `:` type($results))? attr-dict"; @@ -2320,7 +2320,7 @@ let skipDefaultBuilders = 1; 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, CArg<"bool", "false">:$finalCountValue, CArg<"mlir::ValueRange", "llvm::None">:$iterArgs, @@ -2405,8 +2405,8 @@ let skipDefaultBuilders = 1; let builders = [ - OpBuilderDAG<(ins "mlir::Value":$cond, "bool":$withElseRegion)>, - OpBuilderDAG<(ins "mlir::TypeRange":$resultTypes, "mlir::Value":$cond, + OpBuilder<(ins "mlir::Value":$cond, "bool":$withElseRegion)>, + OpBuilder<(ins "mlir::TypeRange":$resultTypes, "mlir::Value":$cond, "bool":$withElseRegion)> ]; @@ -2470,7 +2470,7 @@ let skipDefaultBuilders = 1; let builders = [ - OpBuilderDAG<(ins "mlir::Value":$lowerBound, "mlir::Value":$upperBound, + OpBuilder<(ins "mlir::Value":$lowerBound, "mlir::Value":$upperBound, "mlir::Value":$step, "mlir::Value":$iterate, CArg<"bool", "false">:$finalCountValue, CArg<"mlir::ValueRange", "llvm::None">:$iterArgs, @@ -2549,7 +2549,7 @@ let printer = "printCallOp(p, *this);"; let builders = [ - OpBuilderDAG<(ins "mlir::FuncOp":$callee, + OpBuilder<(ins "mlir::FuncOp":$callee, CArg<"mlir::ValueRange", "{}">:$operands), [{ $_state.addOperands(operands); @@ -2557,7 +2557,7 @@ $_builder.getSymbolRefAttr(callee)); $_state.addTypes(callee.getType().getResults()); }]>, - OpBuilderDAG<(ins "mlir::SymbolRefAttr":$callee, + OpBuilder<(ins "mlir::SymbolRefAttr":$callee, "llvm::ArrayRef":$results, CArg<"mlir::ValueRange", "{}">:$operands), [{ @@ -2565,7 +2565,7 @@ $_state.addAttribute(calleeAttrName(), callee); $_state.addTypes(results); }]>, - OpBuilderDAG<(ins "llvm::StringRef":$callee, + OpBuilder<(ins "llvm::StringRef":$callee, "llvm::ArrayRef":$results, CArg<"mlir::ValueRange", "{}">:$operands), [{ @@ -2821,7 +2821,7 @@ let results = (outs AnyLogicalLike); - let builders = [OpBuilderDAG<(ins "mlir::CmpFPredicate":$predicate, + let builders = [OpBuilder<(ins "mlir::CmpFPredicate":$predicate, "mlir::Value":$lhs, "mlir::Value":$rhs), [{ buildCmpFOp($_builder, $_state, predicate, lhs, rhs); }]>]; @@ -2929,7 +2929,7 @@ 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), [{ buildCmpCOp($_builder, $_state, predicate, lhs, rhs); }]>]; @@ -3062,7 +3062,7 @@ p.printOptionalAttrDict((*this)->getAttrs(), {"in_type"}); }]; - let builders = [OpBuilderDAG<(ins "mlir::TypeAttr":$inty)>]; + let builders = [OpBuilder<(ins "mlir::TypeAttr":$inty)>]; let verifier = [{ mlir::Type resultTy = getType(); @@ -3166,21 +3166,21 @@ let skipDefaultBuilders = 1; let builders = [ - OpBuilderDAG<(ins "llvm::StringRef":$name, "mlir::Type":$type, + OpBuilder<(ins "llvm::StringRef":$name, "mlir::Type":$type, CArg<"llvm::ArrayRef", "{}">:$attrs)>, - OpBuilderDAG<(ins "llvm::StringRef":$name, "bool":$isConstant, + OpBuilder<(ins "llvm::StringRef":$name, "bool":$isConstant, "mlir::Type":$type, CArg<"llvm::ArrayRef", "{}">:$attrs)>, - OpBuilderDAG<(ins "llvm::StringRef":$name, "mlir::Type":$type, + OpBuilder<(ins "llvm::StringRef":$name, "mlir::Type":$type, CArg<"mlir::StringAttr", "{}">:$linkage, CArg<"llvm::ArrayRef", "{}">:$attrs)>, - OpBuilderDAG<(ins "llvm::StringRef":$name, "bool":$isConstant, + OpBuilder<(ins "llvm::StringRef":$name, "bool":$isConstant, "mlir::Type":$type, CArg<"mlir::StringAttr", "{}">:$linkage, CArg<"llvm::ArrayRef", "{}">:$attrs)>, - OpBuilderDAG<(ins "llvm::StringRef":$name, "mlir::Type":$type, + OpBuilder<(ins "llvm::StringRef":$name, "mlir::Type":$type, "mlir::Attribute":$initVal, CArg<"mlir::StringAttr", "{}">:$linkage, CArg<"llvm::ArrayRef", "{}">:$attrs)>, - OpBuilderDAG<(ins "llvm::StringRef":$name, "bool":$isConstant, + OpBuilder<(ins "llvm::StringRef":$name, "bool":$isConstant, "mlir::Type":$type, "mlir::Attribute":$initVal, CArg<"mlir::StringAttr", "{}">:$linkage, CArg<"llvm::ArrayRef", "{}">:$attrs)>, @@ -3344,7 +3344,7 @@ let skipDefaultBuilders = 1; let builders = [ - OpBuilderDAG<(ins "llvm::StringRef":$name, "mlir::Type":$type, + OpBuilder<(ins "llvm::StringRef":$name, "mlir::Type":$type, CArg<"llvm::ArrayRef", "{}">:$attrs), [{ $_state.addAttribute(mlir::SymbolTable::getSymbolAttrName(), diff --git a/mlir/docs/OpDefinitions.md b/mlir/docs/OpDefinitions.md --- a/mlir/docs/OpDefinitions.md +++ b/mlir/docs/OpDefinitions.md @@ -451,7 +451,7 @@ let arguments = (ins F32Attr:$attr); let builders = [ - OpBuilderDAG<(ins "float":$val)> + OpBuilder<(ins "float":$val)> ]; } ``` @@ -489,7 +489,7 @@ let arguments = (ins F32Attr:$attr); let builders = [ - OpBuilderDAG<(ins "float":$val), [{ + OpBuilder<(ins "float":$val), [{ $_state.addAttribute("attr", $_builder.getF32FloatAttr(val)); }]> ]; @@ -511,7 +511,7 @@ let arguments = (ins F32Attr:$attr); let builders = [ - OpBuilderDAG<(ins CArg<"float", "0.5f">:$val), [{ + OpBuilder<(ins CArg<"float", "0.5f">:$val), [{ $_state.addAttribute("attr", $_builder.getF32FloatAttr(val)); }]> ]; diff --git a/mlir/docs/Tutorials/Toy/Ch-2.md b/mlir/docs/Tutorials/Toy/Ch-2.md --- a/mlir/docs/Tutorials/Toy/Ch-2.md +++ b/mlir/docs/Tutorials/Toy/Ch-2.md @@ -492,14 +492,14 @@ // using `builder.create(...)`. let builders = [ // Build a constant with a given constant tensor value. - OpBuilderDAG<(ins "DenseElementsAttr":$value), [{ + OpBuilder<(ins "DenseElementsAttr":$value), [{ // Call into an autogenerated `build` method. build(builder, result, value.getType(), value); }]>, // Build a constant with a given constant floating-point value. This builder // creates a declaration for `ConstantOp::build` with the given parameters. - OpBuilderDAG<(ins "double":$value)> + OpBuilder<(ins "double":$value)> ]; } ``` diff --git a/mlir/examples/toy/Ch2/include/toy/Ops.td b/mlir/examples/toy/Ch2/include/toy/Ops.td --- a/mlir/examples/toy/Ch2/include/toy/Ops.td +++ b/mlir/examples/toy/Ch2/include/toy/Ops.td @@ -68,12 +68,12 @@ // using `builder.create(...)`. let builders = [ // Build a constant with a given constant tensor value. - OpBuilderDAG<(ins "DenseElementsAttr":$value), [{ + OpBuilder<(ins "DenseElementsAttr":$value), [{ build($_builder, $_state, value.getType(), 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. @@ -96,7 +96,7 @@ // Allow building an AddOp with from the two input operands. let builders = [ - OpBuilderDAG<(ins "Value":$lhs, "Value":$rhs)> + OpBuilder<(ins "Value":$lhs, "Value":$rhs)> ]; } @@ -131,7 +131,7 @@ // Add custom build methods for the generic call operation. let builders = [ - OpBuilderDAG<(ins "StringRef":$callee, "ArrayRef":$arguments)> + OpBuilder<(ins "StringRef":$callee, "ArrayRef":$arguments)> ]; } @@ -151,7 +151,7 @@ // Allow building a MulOp with from the two input operands. let builders = [ - OpBuilderDAG<(ins "Value":$lhs, "Value":$rhs)> + OpBuilder<(ins "Value":$lhs, "Value":$rhs)> ]; } @@ -215,7 +215,7 @@ // Allow building a ReturnOp with no return operand. 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. @@ -239,7 +239,7 @@ // Allow building a TransposeOp with from the input operand. let builders = [ - OpBuilderDAG<(ins "Value":$input)> + OpBuilder<(ins "Value":$input)> ]; // Invoke a static verify method to verify this transpose operation. diff --git a/mlir/examples/toy/Ch3/include/toy/Ops.td b/mlir/examples/toy/Ch3/include/toy/Ops.td --- a/mlir/examples/toy/Ch3/include/toy/Ops.td +++ b/mlir/examples/toy/Ch3/include/toy/Ops.td @@ -67,12 +67,12 @@ // using `builder.create(...)`. let builders = [ // Build a constant with a given constant tensor value. - OpBuilderDAG<(ins "DenseElementsAttr":$value), [{ + OpBuilder<(ins "DenseElementsAttr":$value), [{ build($_builder, $_state, value.getType(), 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. @@ -95,7 +95,7 @@ // Allow building an AddOp with from the two input operands. let builders = [ - OpBuilderDAG<(ins "Value":$lhs, "Value":$rhs)> + OpBuilder<(ins "Value":$lhs, "Value":$rhs)> ]; } @@ -130,7 +130,7 @@ // Add custom build methods for the generic call operation. let builders = [ - OpBuilderDAG<(ins "StringRef":$callee, "ArrayRef":$arguments)> + OpBuilder<(ins "StringRef":$callee, "ArrayRef":$arguments)> ]; } @@ -150,7 +150,7 @@ // Allow building a MulOp with from the two input operands. let builders = [ - OpBuilderDAG<(ins "Value":$lhs, "Value":$rhs)> + OpBuilder<(ins "Value":$lhs, "Value":$rhs)> ]; } @@ -217,7 +217,7 @@ // Allow building a ReturnOp with no return operand. 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. @@ -244,7 +244,7 @@ // Allow building a TransposeOp with from the input operand. let builders = [ - OpBuilderDAG<(ins "Value":$input)> + OpBuilder<(ins "Value":$input)> ]; // Invoke a static verify method to verify this transpose operation. diff --git a/mlir/examples/toy/Ch4/include/toy/Ops.td b/mlir/examples/toy/Ch4/include/toy/Ops.td --- a/mlir/examples/toy/Ch4/include/toy/Ops.td +++ b/mlir/examples/toy/Ch4/include/toy/Ops.td @@ -70,12 +70,12 @@ // using `builder.create(...)`. let builders = [ // Build a constant with a given constant tensor value. - OpBuilderDAG<(ins "DenseElementsAttr":$value), [{ + OpBuilder<(ins "DenseElementsAttr":$value), [{ build($_builder, $_state, value.getType(), 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. @@ -99,7 +99,7 @@ // Allow building an AddOp with from the two input operands. let builders = [ - OpBuilderDAG<(ins "Value":$lhs, "Value":$rhs)> + OpBuilder<(ins "Value":$lhs, "Value":$rhs)> ]; } @@ -156,7 +156,7 @@ // Add custom build methods for the generic call operation. let builders = [ - OpBuilderDAG<(ins "StringRef":$callee, "ArrayRef":$arguments)> + OpBuilder<(ins "StringRef":$callee, "ArrayRef":$arguments)> ]; } @@ -177,7 +177,7 @@ // Allow building a MulOp with from the two input operands. let builders = [ - OpBuilderDAG<(ins "Value":$lhs, "Value":$rhs)> + OpBuilder<(ins "Value":$lhs, "Value":$rhs)> ]; } @@ -244,7 +244,7 @@ // Allow building a ReturnOp with no return operand. 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. @@ -272,7 +272,7 @@ // Allow building a TransposeOp with from the input operand. let builders = [ - OpBuilderDAG<(ins "Value":$input)> + OpBuilder<(ins "Value":$input)> ]; // Invoke a static verify method to verify this transpose operation. diff --git a/mlir/examples/toy/Ch5/include/toy/Ops.td b/mlir/examples/toy/Ch5/include/toy/Ops.td --- a/mlir/examples/toy/Ch5/include/toy/Ops.td +++ b/mlir/examples/toy/Ch5/include/toy/Ops.td @@ -70,12 +70,12 @@ // using `builder.create(...)`. let builders = [ // Build a constant with a given constant tensor value. - OpBuilderDAG<(ins "DenseElementsAttr":$value), [{ + OpBuilder<(ins "DenseElementsAttr":$value), [{ build($_builder, $_state, value.getType(), 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. @@ -99,7 +99,7 @@ // Allow building an AddOp with from the two input operands. let builders = [ - OpBuilderDAG<(ins "Value":$lhs, "Value":$rhs)> + OpBuilder<(ins "Value":$lhs, "Value":$rhs)> ]; } @@ -156,7 +156,7 @@ // Add custom build methods for the generic call operation. let builders = [ - OpBuilderDAG<(ins "StringRef":$callee, "ArrayRef":$arguments)> + OpBuilder<(ins "StringRef":$callee, "ArrayRef":$arguments)> ]; } @@ -177,7 +177,7 @@ // Allow building a MulOp with from the two input operands. let builders = [ - OpBuilderDAG<(ins "Value":$lhs, "Value":$rhs)> + OpBuilder<(ins "Value":$lhs, "Value":$rhs)> ]; } @@ -245,7 +245,7 @@ // Allow building a ReturnOp with no return operand. 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. @@ -273,7 +273,7 @@ // Allow building a TransposeOp with from the input operand. let builders = [ - OpBuilderDAG<(ins "Value":$input)> + OpBuilder<(ins "Value":$input)> ]; // Invoke a static verify method to verify this transpose operation. diff --git a/mlir/examples/toy/Ch6/include/toy/Ops.td b/mlir/examples/toy/Ch6/include/toy/Ops.td --- a/mlir/examples/toy/Ch6/include/toy/Ops.td +++ b/mlir/examples/toy/Ch6/include/toy/Ops.td @@ -70,12 +70,12 @@ // using `builder.create(...)`. let builders = [ // Build a constant with a given constant tensor value. - OpBuilderDAG<(ins "DenseElementsAttr":$value), [{ + OpBuilder<(ins "DenseElementsAttr":$value), [{ build($_builder, $_state, value.getType(), 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. @@ -99,7 +99,7 @@ // Allow building an AddOp with from the two input operands. let builders = [ - OpBuilderDAG<(ins "Value":$lhs, "Value":$rhs)> + OpBuilder<(ins "Value":$lhs, "Value":$rhs)> ]; } @@ -156,7 +156,7 @@ // Add custom build methods for the generic call operation. let builders = [ - OpBuilderDAG<(ins "StringRef":$callee, "ArrayRef":$arguments)> + OpBuilder<(ins "StringRef":$callee, "ArrayRef":$arguments)> ]; } @@ -177,7 +177,7 @@ // Allow building a MulOp with from the two input operands. let builders = [ - OpBuilderDAG<(ins "Value":$lhs, "Value":$rhs)> + OpBuilder<(ins "Value":$lhs, "Value":$rhs)> ]; } @@ -245,7 +245,7 @@ // Allow building a ReturnOp with no return operand. 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. @@ -273,7 +273,7 @@ // Allow building a TransposeOp with from the input operand. let builders = [ - OpBuilderDAG<(ins "Value":$input)> + OpBuilder<(ins "Value":$input)> ]; // Invoke a static verify method to verify this transpose operation. diff --git a/mlir/examples/toy/Ch7/include/toy/Ops.td b/mlir/examples/toy/Ch7/include/toy/Ops.td --- a/mlir/examples/toy/Ch7/include/toy/Ops.td +++ b/mlir/examples/toy/Ch7/include/toy/Ops.td @@ -80,12 +80,12 @@ // using `builder.create(...)`. let builders = [ // Build a constant with a given constant tensor value. - OpBuilderDAG<(ins "DenseElementsAttr":$value), [{ + OpBuilder<(ins "DenseElementsAttr":$value), [{ build($_builder, $_state, value.getType(), 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. @@ -112,7 +112,7 @@ // Allow building an AddOp with from the two input operands. let builders = [ - OpBuilderDAG<(ins "Value":$lhs, "Value":$rhs)> + OpBuilder<(ins "Value":$lhs, "Value":$rhs)> ]; } @@ -170,7 +170,7 @@ // Add custom build methods for the generic call operation. let builders = [ - OpBuilderDAG<(ins "StringRef":$callee, "ArrayRef":$arguments)> + OpBuilder<(ins "StringRef":$callee, "ArrayRef":$arguments)> ]; } @@ -191,7 +191,7 @@ // Allow building a MulOp with from the two input operands. let builders = [ - OpBuilderDAG<(ins "Value":$lhs, "Value":$rhs)> + OpBuilder<(ins "Value":$lhs, "Value":$rhs)> ]; } @@ -259,7 +259,7 @@ // Allow building a ReturnOp with no return operand. 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. @@ -286,7 +286,7 @@ // Allow building a StructAccessOp with just a struct value and an index. let builders = [ - OpBuilderDAG<(ins "Value":$input, "size_t":$index)> + OpBuilder<(ins "Value":$input, "size_t":$index)> ]; let verifier = [{ return ::verify(*this); }]; @@ -334,7 +334,7 @@ // Allow building a TransposeOp with from the input operand. let builders = [ - OpBuilderDAG<(ins "Value":$input)> + OpBuilder<(ins "Value":$input)> ]; // Invoke a static verify method to verify this transpose operation. diff --git a/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td b/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td --- a/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td +++ b/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td @@ -72,7 +72,7 @@ // has a constant builder. That way we wouldn't need to explicitly specify the // result types here. let builders = [ - OpBuilderDAG<(ins "AffineMap":$map, "ValueRange":$mapOperands), + OpBuilder<(ins "AffineMap":$map, "ValueRange":$mapOperands), [{ build($_builder, $_state, $_builder.getIndexType(), map, mapOperands); }]> @@ -213,11 +213,11 @@ let skipDefaultBuilders = 1; 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<"function_ref", "nullptr">:$bodyBuilder)>, - OpBuilderDAG<(ins "ValueRange":$lbOperands, "AffineMap":$lbMap, + OpBuilder<(ins "ValueRange":$lbOperands, "AffineMap":$lbMap, "ValueRange":$ubOperands, "AffineMap":$ubMap, CArg<"int64_t", "1">:$step, CArg<"ValueRange", "llvm::None">:$iterArgs, CArg<"function_ref", @@ -411,9 +411,9 @@ let skipDefaultBuilders = 1; let builders = [ - OpBuilderDAG<(ins "IntegerSet":$set, "ValueRange":$args, + OpBuilder<(ins "IntegerSet":$set, "ValueRange":$args, "bool":$withElseRegion)>, - OpBuilderDAG<(ins "TypeRange":$resultTypes, "IntegerSet":$set, + OpBuilder<(ins "TypeRange":$resultTypes, "IntegerSet":$set, "ValueRange":$args, "bool":$withElseRegion)>, ]; @@ -506,11 +506,11 @@ let builders = [ /// 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. - 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. - OpBuilderDAG<(ins "Value":$memref, "AffineMap":$map, + OpBuilder<(ins "Value":$memref, "AffineMap":$map, "ValueRange":$mapOperands)> ]; @@ -526,7 +526,7 @@ let results = (outs Index); let builders = [ - OpBuilderDAG<(ins "AffineMap":$affineMap, "ValueRange":$mapOperands), + OpBuilder<(ins "AffineMap":$affineMap, "ValueRange":$mapOperands), [{ build($_builder, $_state, $_builder.getIndexType(), affineMap, mapOperands); }]> @@ -651,12 +651,12 @@ let regions = (region SizedRegion<1>:$region); let builders = [ - OpBuilderDAG<(ins "TypeRange":$resultTypes, + OpBuilder<(ins "TypeRange":$resultTypes, "ArrayRef":$reductions, "ArrayRef":$ranges)>, - OpBuilderDAG<(ins "TypeRange":$resultTypes, + OpBuilder<(ins "TypeRange":$resultTypes, "ArrayRef":$reductions, "AffineMap":$lbMap, "ValueRange":$lbArgs, "AffineMap":$ubMap, "ValueRange":$ubArgs)>, - OpBuilderDAG<(ins "TypeRange":$resultTypes, + OpBuilder<(ins "TypeRange":$resultTypes, "ArrayRef":$reductions, "AffineMap":$lbMap, "ValueRange":$lbArgs, "AffineMap":$ubMap, "ValueRange":$ubArgs, "ArrayRef":$steps)> @@ -726,7 +726,7 @@ BoolAttr:$isDataCache); let builders = [ - OpBuilderDAG<(ins "Value":$memref, "AffineMap":$map, + OpBuilder<(ins "Value":$memref, "AffineMap":$map, "ArrayRef":$mapOperands, "bool":$isWrite, "unsigned":$localityHint, "bool":$isDataCache), [{ @@ -830,9 +830,9 @@ let skipDefaultBuilders = 1; let builders = [ - OpBuilderDAG<(ins "Value":$valueToStore, "Value":$memref, + OpBuilder<(ins "Value":$valueToStore, "Value":$memref, "ValueRange":$indices)>, - OpBuilderDAG<(ins "Value":$valueToStore, "Value":$memref, "AffineMap":$map, + OpBuilder<(ins "Value":$valueToStore, "Value":$memref, "AffineMap":$map, "ValueRange":$mapOperands)> ]; @@ -861,7 +861,7 @@ let arguments = (ins Variadic:$operands); let builders = [ - OpBuilderDAG<(ins), [{ build($_builder, $_state, llvm::None); }]> + OpBuilder<(ins), [{ build($_builder, $_state, llvm::None); }]> ]; let assemblyFormat = "attr-dict ($operands^ `:` type($operands))?"; @@ -911,13 +911,13 @@ let builders = [ /// 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)>, /// 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)>, /// 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)> ]; @@ -977,9 +977,9 @@ let skipDefaultBuilders = 1; let builders = [ - OpBuilderDAG<(ins "Value":$valueToStore, "Value":$memref, + OpBuilder<(ins "Value":$valueToStore, "Value":$memref, "ValueRange":$indices)>, - OpBuilderDAG<(ins "Value":$valueToStore, "Value":$memref, "AffineMap":$map, + OpBuilder<(ins "Value":$valueToStore, "Value":$memref, "AffineMap":$map, "ValueRange":$mapOperands)> ]; diff --git a/mlir/include/mlir/Dialect/Async/IR/AsyncOps.td b/mlir/include/mlir/Dialect/Async/IR/AsyncOps.td --- a/mlir/include/mlir/Dialect/Async/IR/AsyncOps.td +++ b/mlir/include/mlir/Dialect/Async/IR/AsyncOps.td @@ -85,7 +85,7 @@ let skipDefaultBuilders = 1; let builders = [ - OpBuilderDAG<(ins "TypeRange":$resultTypes, "ValueRange":$dependencies, + OpBuilder<(ins "TypeRange":$resultTypes, "ValueRange":$dependencies, "ValueRange":$operands, CArg<"function_ref", "nullptr">:$bodyBuilder)>, @@ -136,7 +136,7 @@ let skipDefaultBuilders = 1; let builders = [ - OpBuilderDAG<(ins "Value":$operand, + OpBuilder<(ins "Value":$operand, CArg<"ArrayRef", "{}">:$attrs)>, ]; diff --git a/mlir/include/mlir/Dialect/GPU/GPUOps.td b/mlir/include/mlir/Dialect/GPU/GPUOps.td --- a/mlir/include/mlir/Dialect/GPU/GPUOps.td +++ b/mlir/include/mlir/Dialect/GPU/GPUOps.td @@ -197,7 +197,7 @@ let skipDefaultBuilders = 1; let builders = [ - OpBuilderDAG<(ins "StringRef":$name, "FunctionType":$type, + OpBuilder<(ins "StringRef":$name, "FunctionType":$type, CArg<"TypeRange", "{}">:$workgroupAttributions, CArg<"TypeRange", "{}">:$privateAttributions, CArg<"ArrayRef", "{}">:$attrs)> @@ -377,7 +377,7 @@ let skipDefaultBuilders = 1; let builders = [ - OpBuilderDAG<(ins "GPUFuncOp":$kernelFunc, "KernelDim3":$gridSize, + OpBuilder<(ins "GPUFuncOp":$kernelFunc, "KernelDim3":$gridSize, "KernelDim3":$blockSize, "ValueRange":$kernelOperands)> ]; @@ -496,7 +496,7 @@ let skipDefaultBuilders = 1; let builders = [ - OpBuilderDAG<(ins "Value":$gridSizeX, "Value":$gridSizeY, + OpBuilder<(ins "Value":$gridSizeX, "Value":$gridSizeY, "Value":$gridSizeZ, "Value":$blockSizeX, "Value":$blockSizeY, "Value":$blockSizeZ)> ]; @@ -543,7 +543,7 @@ by an invocation of the `gpu.func`. }]; - let builders = [OpBuilderDAG<(ins), [{ // empty}]>]; + let builders = [OpBuilder<(ins), [{ // empty}]>]; let parser = [{ return parseReturnOp(parser, result); }]; let printer = [{ p << getOperationName(); }]; @@ -722,7 +722,7 @@ ``` }]; - let builders = [OpBuilderDAG<(ins "StringRef":$name)>]; + let builders = [OpBuilder<(ins "StringRef":$name)>]; let parser = [{ return ::parseGPUModuleOp(parser, result); }]; let printer = [{ return ::print(p, *this); }]; let regions = (region SizedRegion<1>:$body); diff --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td --- a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td +++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td @@ -52,7 +52,7 @@ } def LLVM_OneResultOpBuilder : - OpBuilderDAG<(ins "Type":$resultType, "ValueRange":$operands, + OpBuilder<(ins "Type":$resultType, "ValueRange":$operands, CArg<"ArrayRef", "{}">:$attributes), [{ if (resultType) $_state.addTypes(resultType); @@ -63,7 +63,7 @@ }]>; def LLVM_ZeroResultOpBuilder : - OpBuilderDAG<(ins "ValueRange":$operands, + OpBuilder<(ins "ValueRange":$operands, CArg<"ArrayRef", "{}">:$attributes), [{ $_state.addOperands(operands); @@ -75,7 +75,7 @@ // Compatibility builder that takes an instance of wrapped llvm::VoidType // to indicate no result. def LLVM_VoidResultTypeOpBuilder : - OpBuilderDAG<(ins "Type":$resultType, "ValueRange":$operands, + OpBuilder<(ins "Type":$resultType, "ValueRange":$operands, CArg<"ArrayRef", "{}">:$attributes), [{ assert(isCompatibleType(resultType) && "result must be an LLVM type"); @@ -87,7 +87,7 @@ // Opaque builder used for terminator operations that contain successors. def LLVM_TerminatorPassthroughOpBuilder : - OpBuilderDAG<(ins "ValueRange":$operands, "SuccessorRange":$destinations, + OpBuilder<(ins "ValueRange":$operands, "SuccessorRange":$destinations, CArg<"ArrayRef", "{}">:$attributes), [{ $_state.addOperands(operands); @@ -182,7 +182,7 @@ $res = builder.CreateICmp(getLLVMCmpPredicate($predicate), $lhs, $rhs); }]; 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), $_builder.getI64IntegerAttr(static_cast(predicate)), lhs, rhs); @@ -232,7 +232,7 @@ $res = builder.CreateFCmp(getLLVMCmpPredicate($predicate), $lhs, $rhs); }]; let builders = [ - OpBuilderDAG<(ins "FCmpPredicate":$predicate, "Value":$lhs, "Value":$rhs, + OpBuilder<(ins "FCmpPredicate":$predicate, "Value":$lhs, "Value":$rhs, CArg<"FastmathFlags", "{}">:$fmf), [{ build($_builder, $_state, IntegerType::get(lhs.getType().getContext(), 1), @@ -289,7 +289,7 @@ $res = inst; }]; let builders = [ - OpBuilderDAG<(ins "Type":$resultType, "Value":$arraySize, + OpBuilder<(ins "Type":$resultType, "Value":$arraySize, "unsigned":$alignment), [{ if (alignment == 0) @@ -323,13 +323,13 @@ $res = inst; }]; 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), [{ auto type = addr.getType().cast().getElementType(); 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<"bool", "false">:$isNonTemporal)>]; let parser = [{ return parseLoadOp(parser, result); }]; @@ -345,7 +345,7 @@ auto *inst = builder.CreateStore($value, $addr, $volatile_); }] # setAlignmentCode # setNonTemporalMetadataCode; let builders = [ - OpBuilderDAG<(ins "Value":$value, "Value":$addr, + OpBuilder<(ins "Value":$value, "Value":$addr, CArg<"unsigned", "0">:$alignment, CArg<"bool", "false">:$isVolatile, CArg<"bool", "false">:$isNonTemporal)> ]; @@ -417,14 +417,14 @@ AnySuccessor:$unwindDest); let builders = [ - OpBuilderDAG<(ins "TypeRange":$tys, "FlatSymbolRefAttr":$callee, + OpBuilder<(ins "TypeRange":$tys, "FlatSymbolRefAttr":$callee, "ValueRange":$ops, "Block*":$normal, "ValueRange":$normalOps, "Block*":$unwind, "ValueRange":$unwindOps), [{ $_state.addAttribute("callee", callee); 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), [{ build($_builder, $_state, tys, /*callee=*/FlatSymbolRefAttr(), ops, normalOps, @@ -480,7 +480,7 @@ DefaultValuedAttr:$fastmathFlags); let results = (outs Variadic); let builders = [ - OpBuilderDAG<(ins "LLVMFuncOp":$func, "ValueRange":$operands, + OpBuilder<(ins "LLVMFuncOp":$func, "ValueRange":$operands, CArg<"ArrayRef", "{}">:$attributes), [{ Type resultType = func.getType().getReturnType(); @@ -501,7 +501,7 @@ $res = builder.CreateExtractElement($vector, $position); }]; let builders = [ - OpBuilderDAG<(ins "Value":$vector, "Value":$position, + OpBuilder<(ins "Value":$vector, "Value":$position, CArg<"ArrayRef", "{}">:$attrs)>]; let parser = [{ return parseExtractElementOp(parser, result); }]; let printer = [{ printExtractElementOp(p, *this); }]; @@ -536,7 +536,7 @@ extractPosition($position)); }]; 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); }]>]; @@ -552,7 +552,7 @@ $res = builder.CreateShuffleVector($v1, $v2, mask); }]; let builders = [ - OpBuilderDAG<(ins "Value":$v1, "Value":$v2, "ArrayAttr":$mask, + OpBuilder<(ins "Value":$v1, "Value":$v2, "ArrayAttr":$mask, CArg<"ArrayRef", "{}">:$attrs)>]; let verifier = [{ auto type1 = v1().getType(); @@ -576,7 +576,7 @@ LLVM_Type:$trueValue, LLVM_Type:$falseValue); let results = (outs LLVM_Type:$res); 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); }]>]; @@ -616,7 +616,7 @@ }]; let builders = [ - OpBuilderDAG<(ins "Value":$condition, "Block *":$trueDest, + OpBuilder<(ins "Value":$condition, "Block *":$trueDest, "ValueRange":$trueOperands, "Block *":$falseDest, "ValueRange":$falseOperands, CArg<"Optional>", "{}">:$weights), @@ -630,7 +630,7 @@ build($_builder, $_state, condition, trueOperands, falseOperands, weightsAttr, trueDest, falseDest); }]>, - OpBuilderDAG<(ins "Value":$condition, "Block *":$trueDest, + OpBuilder<(ins "Value":$condition, "Block *":$trueDest, "Block *":$falseDest, CArg<"ValueRange", "{}">:$falseOperands), [{ build($_builder, $_state, condition, trueDest, ValueRange(), falseDest, @@ -698,7 +698,7 @@ }]; let builders = [ - OpBuilderDAG<(ins "Value":$value, + OpBuilder<(ins "Value":$value, "Block *":$defaultDestination, "ValueRange":$defaultOperands, CArg<"ArrayRef", "{}">:$caseValues, @@ -797,7 +797,7 @@ }]; let builders = [ - OpBuilderDAG<(ins "GlobalOp":$global, + OpBuilder<(ins "GlobalOp":$global, CArg<"ArrayRef", "{}">:$attrs), [{ build($_builder, $_state, @@ -805,7 +805,7 @@ global.sym_name()); $_state.addAttributes(attrs); }]>, - OpBuilderDAG<(ins "LLVMFuncOp":$func, + OpBuilder<(ins "LLVMFuncOp":$func, CArg<"ArrayRef", "{}">:$attrs), [{ build($_builder, $_state, @@ -922,7 +922,7 @@ let regions = (region AnyRegion:$initializer); 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, CArg<"ArrayRef", "{}">:$attrs)> ]; @@ -996,7 +996,7 @@ let skipDefaultBuilders = 1; let builders = [ - OpBuilderDAG<(ins "StringRef":$name, "Type":$type, + OpBuilder<(ins "StringRef":$name, "Type":$type, CArg<"Linkage", "Linkage::External">:$linkage, CArg<"ArrayRef", "{}">:$attrs, CArg<"ArrayRef", "{}">:$argAttrs)> diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td b/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td --- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td +++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td @@ -101,24 +101,24 @@ }]; let builders = [ - OpBuilderDAG<(ins "ValueRange":$shape, + OpBuilder<(ins "ValueRange":$shape, "ArrayRef":$staticShape, "Type":$elementType), [{ build($_builder, $_state, InitTensorOp::inferResultType(staticShape, elementType), shape, $_builder.getI64ArrayAttr(staticShape)); }]>, - OpBuilderDAG<(ins "ValueRange":$shape, "Type":$elementType), + OpBuilder<(ins "ValueRange":$shape, "Type":$elementType), [{ SmallVector staticShape( shape.size(), ShapedType::kDynamicSize); build($_builder, $_state, shape, staticShape, elementType); }]>, - OpBuilderDAG<(ins "ArrayRef":$staticShape, "Type":$elementType), + OpBuilder<(ins "ArrayRef":$staticShape, "Type":$elementType), [{ build($_builder, $_state, ValueRange{}, staticShape, elementType); }]>, - OpBuilderDAG<(ins "ArrayRef":$sizes, "Type":$elementType, + OpBuilder<(ins "ArrayRef":$sizes, "Type":$elementType, CArg<"ArrayRef", "{}">:$attrs)> ]; @@ -260,15 +260,15 @@ let builders = [ // Build a PadTensorOp with mixed static and dynamic entries. - OpBuilderDAG<(ins "Value":$source, "ArrayRef":$staticLow, + OpBuilder<(ins "Value":$source, "ArrayRef":$staticLow, "ArrayRef":$staticHigh, "ValueRange":$low, "ValueRange":$high, CArg<"ArrayRef", "{}">:$attrs)>, // 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", "{}">:$attrs)>, // Build a PadTensorOp with mixed static and dynamic entries and custom // result type. If the type passed is nullptr, it is inferred. - OpBuilderDAG<(ins "Type":$resultType, "Value":$source, + OpBuilder<(ins "Type":$resultType, "Value":$source, "ArrayRef":$low, "ArrayRef":$high, CArg<"ArrayRef", "{}">:$attrs)> ]; @@ -291,7 +291,7 @@ ```` }]; let builders = [ - OpBuilderDAG<(ins "Value":$min, "Value":$max, "Value":$step), + OpBuilder<(ins "Value":$min, "Value":$max, "Value":$step), [{ auto rangeType = RangeType::get($_builder.getContext()); build($_builder, $_state, rangeType, min, max, step); @@ -307,10 +307,10 @@ let builders = [ // Builders for a contracting reshape whose result type is computed from // `src` and `reassociation`. - OpBuilderDAG<(ins "Value":$src, + OpBuilder<(ins "Value":$src, "ArrayRef":$reassociation, CArg<"ArrayRef", "{}">:$attrs)>, - OpBuilderDAG<(ins "Value":$src, + OpBuilder<(ins "Value":$src, "ArrayRef":$reassociation, CArg<"ArrayRef", "{}">:$attrs), [{ @@ -321,10 +321,10 @@ // Builders for a reshape whose result type is passed explicitly. This may // be either a contracting or expanding reshape. - OpBuilderDAG<(ins "Type":$resultType, "Value":$src, + OpBuilder<(ins "Type":$resultType, "Value":$src, "ArrayRef":$reassociation, CArg<"ArrayRef", "{}">:$attrs)>, - OpBuilderDAG<(ins "Type":$resultType, "Value":$src, + OpBuilder<(ins "Type":$resultType, "Value":$src, "ArrayRef":$reassociation, CArg<"ArrayRef", "{}">:$attrs), [{ @@ -484,7 +484,7 @@ 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", [ @@ -540,7 +540,7 @@ let regions = (region SizedRegion<1>:$region); let builders = [ - OpBuilderDAG<(ins "ValueRange":$lowerBounds, "ValueRange":$upperBounds, + OpBuilder<(ins "ValueRange":$lowerBounds, "ValueRange":$upperBounds, "ValueRange":$steps, "ValueRange":$inputs, "ValueRange":$outputs, "ArrayRef":$iteratorTypes, CArg<"function_ref", diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td b/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td --- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td +++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td @@ -113,7 +113,7 @@ let regions = (region AnyRegion:$region); let builders = [ - OpBuilderDAG<(ins "Value":$input, "Value":$output, + OpBuilder<(ins "Value":$input, "Value":$output, CArg<"AffineMap", "AffineMap()">:$inputPermutation, CArg<"AffineMap", "AffineMap()">:$outputPermutation, CArg<"ArrayRef", "{}">:$attrs)>]; @@ -204,7 +204,7 @@ }]; let builders = [ - OpBuilderDAG<(ins "Value":$output, "Value":$value)> + OpBuilder<(ins "Value":$output, "Value":$value)> ]; let verifier = [{ return ::verify(*this); }]; @@ -642,20 +642,20 @@ }]; let builders = [ - OpBuilderDAG<(ins "TypeRange":$resultTensorTypes, "ValueRange":$inputs, + OpBuilder<(ins "TypeRange":$resultTensorTypes, "ValueRange":$inputs, "ValueRange":$outputs, "ArrayRef":$indexingMaps, "ArrayRef":$iteratorTypes, "StringRef":$doc, "StringRef":$libraryCall, CArg<"function_ref", "nullptr">)>, - OpBuilderDAG<(ins "ValueRange":$inputs, "ValueRange":$outputBuffers, + OpBuilder<(ins "ValueRange":$inputs, "ValueRange":$outputBuffers, "ArrayRef":$indexingMaps, "ArrayRef":$iteratorTypes, "StringRef":$doc, "StringRef":$libraryCall, CArg<"function_ref", "nullptr">)>, - OpBuilderDAG<(ins "TypeRange":$resultTensorTypes, "ValueRange":$inputs, + OpBuilder<(ins "TypeRange":$resultTensorTypes, "ValueRange":$inputs, "ValueRange":$outputs, "ArrayRef":$indexingMaps, "ArrayRef":$iteratorTypes, CArg<"function_ref", "nullptr">)>, - OpBuilderDAG<(ins "ValueRange":$inputs, "ValueRange":$outputBuffers, + OpBuilder<(ins "ValueRange":$inputs, "ValueRange":$outputBuffers, "ArrayRef":$indexingMaps, "ArrayRef":$iteratorTypes, CArg<"function_ref", "nullptr">)> ]; @@ -774,23 +774,23 @@ }]; let builders = [ - OpBuilderDAG<(ins "TypeRange":$resultTensorTypes, "ValueRange":$inputs, + OpBuilder<(ins "TypeRange":$resultTensorTypes, "ValueRange":$inputs, "ValueRange":$outputs, "ArrayRef":$indexingMaps, "ArrayRef":$iteratorTypes, "StringRef":$doc, "StringRef":$libraryCall, CArg<"function_ref", "nullptr">)>, - OpBuilderDAG<(ins "ValueRange":$inputs, "ValueRange":$outputBuffers, + OpBuilder<(ins "ValueRange":$inputs, "ValueRange":$outputBuffers, "ArrayRef":$indexingMaps, "ArrayRef":$iteratorTypes, "StringRef":$doc, "StringRef":$libraryCall, CArg<"function_ref", "nullptr">)>, - OpBuilderDAG<(ins "TypeRange":$resultTensorTypes, "ValueRange":$inputs, + OpBuilder<(ins "TypeRange":$resultTensorTypes, "ValueRange":$inputs, "ValueRange":$outputs, "ArrayRef":$indexingMaps, "ArrayRef":$iteratorTypes, CArg<"function_ref", "nullptr">)>, - OpBuilderDAG<(ins "ValueRange":$inputs, "ValueRange":$outputBuffers, + OpBuilder<(ins "ValueRange":$inputs, "ValueRange":$outputBuffers, "ArrayRef":$indexingMaps, "ArrayRef":$iteratorTypes, CArg<"function_ref", "nullptr">)> diff --git a/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td b/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td --- a/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td +++ b/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td @@ -382,7 +382,7 @@ let arguments = (ins Variadic:$operands); - let builders = [OpBuilderDAG<(ins), [{ /* nothing to do */ }]>]; + let builders = [OpBuilder<(ins), [{ /* nothing to do */ }]>]; let verifier = ?; diff --git a/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td b/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td --- a/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td +++ b/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td @@ -93,7 +93,7 @@ let regions = (region AnyRegion:$region); let builders = [ - OpBuilderDAG<(ins CArg<"ArrayRef", "{}">:$attributes)> + OpBuilder<(ins CArg<"ArrayRef", "{}">:$attributes)> ]; let parser = [{ return parseParallelOp(parser, result); }]; let printer = [{ return printParallelOp(p, *this); }]; @@ -182,7 +182,7 @@ UnitAttr:$inclusive); let builders = [ - OpBuilderDAG<(ins "ValueRange":$lowerBound, "ValueRange":$upperBound, + OpBuilder<(ins "ValueRange":$lowerBound, "ValueRange":$upperBound, "ValueRange":$step, CArg<"ArrayRef", "{}">:$attributes)> ]; diff --git a/mlir/include/mlir/Dialect/PDL/IR/PDLOps.td b/mlir/include/mlir/Dialect/PDL/IR/PDLOps.td --- a/mlir/include/mlir/Dialect/PDL/IR/PDLOps.td +++ b/mlir/include/mlir/Dialect/PDL/IR/PDLOps.td @@ -59,7 +59,7 @@ }]; let builders = [ - OpBuilderDAG<(ins "StringRef":$name, CArg<"ValueRange", "{}">:$args, + OpBuilder<(ins "StringRef":$name, CArg<"ValueRange", "{}">:$args, CArg<"ArrayRef", "{}">:$params), [{ build($_builder, $_state, $_builder.getStringAttr(name), args, params.empty() ? ArrayAttr() : $_builder.getArrayAttr(params)); @@ -103,11 +103,11 @@ let assemblyFormat = "attr-dict (`:` $type^)? ($value^)?"; let builders = [ - OpBuilderDAG<(ins CArg<"Value", "Value()">:$type), [{ + OpBuilder<(ins CArg<"Value", "Value()">:$type), [{ build($_builder, $_state, $_builder.getType(), type, Attribute()); }]>, - OpBuilderDAG<(ins "Attribute":$attr), [{ + OpBuilder<(ins "Attribute":$attr), [{ build($_builder, $_state, $_builder.getType(), Value(), attr); }]>, ]; @@ -199,7 +199,7 @@ let assemblyFormat = "(`:` $type^)? attr-dict"; let builders = [ - OpBuilderDAG<(ins), [{ + OpBuilder<(ins), [{ build($_builder, $_state, $_builder.getType(), Value()); }]>, ]; @@ -253,7 +253,7 @@ let results = (outs PDL_Operation:$op, Variadic:$results); let builders = [ - OpBuilderDAG<(ins CArg<"Optional", "llvm::None">:$name, + OpBuilder<(ins CArg<"Optional", "llvm::None">:$name, CArg<"ValueRange", "llvm::None">:$operandValues, CArg<"ArrayRef", "llvm::None">:$attrNames, CArg<"ValueRange", "llvm::None">:$attrValues, @@ -311,7 +311,7 @@ }]; let builders = [ - OpBuilderDAG<(ins CArg<"Optional", "llvm::None">:$rootKind, + OpBuilder<(ins CArg<"Optional", "llvm::None">:$rootKind, CArg<"Optional", "1">:$benefit, CArg<"Optional", "llvm::None">:$name)>, ]; @@ -452,7 +452,7 @@ let assemblyFormat = "attr-dict (`:` $type^)?"; let builders = [ - OpBuilderDAG<(ins CArg<"Type", "Type()">:$ty), [{ + OpBuilder<(ins CArg<"Type", "Type()">:$ty), [{ build($_builder, $_state, $_builder.getType(), ty ? TypeAttr::get(ty) : TypeAttr()); }]>, diff --git a/mlir/include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.td b/mlir/include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.td --- a/mlir/include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.td +++ b/mlir/include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.td @@ -347,7 +347,7 @@ let assemblyFormat = "$value attr-dict"; let builders = [ - OpBuilderDAG<(ins "Attribute":$value), [{ + OpBuilder<(ins "Attribute":$value), [{ build($_builder, $_state, $_builder.getType(), value); }]>]; } @@ -411,7 +411,7 @@ let results = (outs PDL_Operation:$operation); let builders = [ - OpBuilderDAG<(ins "StringRef":$name, "ValueRange":$types, + OpBuilder<(ins "StringRef":$name, "ValueRange":$types, "ValueRange":$operands, "ValueRange":$attributes, "ArrayAttr":$attributeNames), [{ build($_builder, $_state, $_builder.getType(), name, @@ -443,7 +443,7 @@ let assemblyFormat = "$value attr-dict"; let builders = [ - OpBuilderDAG<(ins "TypeAttr":$type), [{ + OpBuilder<(ins "TypeAttr":$type), [{ build($_builder, $_state, $_builder.getType(), type); }]> ]; @@ -538,7 +538,7 @@ let assemblyFormat = "`of` $value attr-dict"; let builders = [ - OpBuilderDAG<(ins "Value":$value), [{ + OpBuilder<(ins "Value":$value), [{ build($_builder, $_state, $_builder.getType(), value); }]> ]; @@ -639,7 +639,7 @@ let assemblyFormat = "`of` $value attr-dict"; let builders = [ - OpBuilderDAG<(ins "Value":$value), [{ + OpBuilder<(ins "Value":$value), [{ build($_builder, $_state, $_builder.getType(), value); }]> ]; @@ -666,7 +666,7 @@ let assemblyFormat = "attr-dict"; let builders = [ - OpBuilderDAG<(ins), [{ + OpBuilder<(ins), [{ build($_builder, $_state, $_builder.getType()); }]>, ]; @@ -781,7 +781,7 @@ }]; let builders = [ - OpBuilderDAG<(ins "Value":$attribute, "ArrayRef":$caseValues, + OpBuilder<(ins "Value":$attribute, "ArrayRef":$caseValues, "Block *":$defaultDest, "BlockRange":$dests), [{ build($_builder, $_state, attribute, $_builder.getArrayAttr(caseValues), defaultDest, dests); @@ -814,7 +814,7 @@ }]; let builders = [ - OpBuilderDAG<(ins "Value":$operation, "ArrayRef":$counts, + OpBuilder<(ins "Value":$operation, "ArrayRef":$counts, "Block *":$defaultDest, "BlockRange":$dests), [{ build($_builder, $_state, operation, $_builder.getI32VectorAttr(counts), defaultDest, dests); @@ -848,7 +848,7 @@ }]; let builders = [ - OpBuilderDAG<(ins "Value":$operation, "ArrayRef":$names, + OpBuilder<(ins "Value":$operation, "ArrayRef":$names, "Block *":$defaultDest, "BlockRange":$dests), [{ auto stringNames = llvm::to_vector<8>(llvm::map_range(names, [](OperationName name) { return name.getStringRef(); })); @@ -884,7 +884,7 @@ }]; let builders = [ - OpBuilderDAG<(ins "Value":$operation, "ArrayRef":$counts, + OpBuilder<(ins "Value":$operation, "ArrayRef":$counts, "Block *":$defaultDest, "BlockRange":$dests), [{ build($_builder, $_state, operation, $_builder.getI32VectorAttr(counts), defaultDest, dests); @@ -916,7 +916,7 @@ }]; let builders = [ - OpBuilderDAG<(ins "Value":$edge, "TypeRange":$types, "Block *":$defaultDest, + OpBuilder<(ins "Value":$edge, "TypeRange":$types, "Block *":$defaultDest, "BlockRange":$dests), [{ build($_builder, $_state, edge, $_builder.getTypeArrayAttr(types), defaultDest, dests); diff --git a/mlir/include/mlir/Dialect/SCF/SCFOps.td b/mlir/include/mlir/Dialect/SCF/SCFOps.td --- a/mlir/include/mlir/Dialect/SCF/SCFOps.td +++ b/mlir/include/mlir/Dialect/SCF/SCFOps.td @@ -154,7 +154,7 @@ let skipDefaultBuilders = 1; let builders = [ - OpBuilderDAG<(ins "Value":$lowerBound, "Value":$upperBound, "Value":$step, + OpBuilder<(ins "Value":$lowerBound, "Value":$upperBound, "Value":$step, CArg<"ValueRange", "llvm::None">:$iterArgs, CArg<"function_ref", "nullptr">)> @@ -261,15 +261,15 @@ let skipDefaultBuilders = 1; let builders = [ - OpBuilderDAG<(ins "Value":$cond, "bool":$withElseRegion)>, - OpBuilderDAG<(ins "TypeRange":$resultTypes, "Value":$cond, + OpBuilder<(ins "Value":$cond, "bool":$withElseRegion)>, + OpBuilder<(ins "TypeRange":$resultTypes, "Value":$cond, "bool":$withElseRegion)>, - OpBuilderDAG<(ins "TypeRange":$resultTypes, "Value":$cond, + OpBuilder<(ins "TypeRange":$resultTypes, "Value":$cond, CArg<"function_ref", "buildTerminatedBody">:$thenBuilder, CArg<"function_ref", "nullptr">:$elseBuilder)>, - OpBuilderDAG<(ins "Value":$cond, + OpBuilder<(ins "Value":$cond, CArg<"function_ref", "buildTerminatedBody">:$thenBuilder, CArg<"function_ref", @@ -352,11 +352,11 @@ let skipDefaultBuilders = 1; let builders = [ - OpBuilderDAG<(ins "ValueRange":$lowerBounds, "ValueRange":$upperBounds, + OpBuilder<(ins "ValueRange":$lowerBounds, "ValueRange":$upperBounds, "ValueRange":$steps, "ValueRange":$initVals, CArg<"function_ref", "nullptr">:$bodyBuilderFn)>, - OpBuilderDAG<(ins "ValueRange":$lowerBounds, "ValueRange":$upperBounds, + OpBuilder<(ins "ValueRange":$lowerBounds, "ValueRange":$upperBounds, "ValueRange":$steps, CArg<"function_ref", "nullptr">:$bodyBuilderFn)>, @@ -412,7 +412,7 @@ let skipDefaultBuilders = 1; let builders = [ - OpBuilderDAG<(ins "Value":$operand, + OpBuilder<(ins "Value":$operand, CArg<"function_ref", "nullptr">:$bodyBuilderFn)> ]; @@ -582,7 +582,7 @@ }]; let arguments = (ins Variadic:$results); - let builders = [OpBuilderDAG<(ins), [{ /* nothing to do */ }]>]; + let builders = [OpBuilder<(ins), [{ /* nothing to do */ }]>]; let assemblyFormat = [{ attr-dict ($results^ `:` type($results))? }]; diff --git a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAtomicOps.td b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAtomicOps.td --- a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAtomicOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAtomicOps.td @@ -49,7 +49,7 @@ ); let builders = [ - OpBuilderDAG<(ins "Value":$pointer, "::mlir::spirv::Scope":$scope, + OpBuilder<(ins "Value":$pointer, "::mlir::spirv::Scope":$scope, "::mlir::spirv::MemorySemantics":$memory, "Value":$value), [{build($_builder, $_state, value.getType(), pointer, scope, memory, value);}]> ]; diff --git a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVCompositeOps.td b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVCompositeOps.td --- a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVCompositeOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVCompositeOps.td @@ -111,7 +111,7 @@ ); let builders = [ - OpBuilderDAG<(ins "Value":$composite, "ArrayRef":$indices)> + OpBuilder<(ins "Value":$composite, "ArrayRef":$indices)> ]; let hasFolder = 1; @@ -164,7 +164,7 @@ ); let builders = [ - OpBuilderDAG<(ins "Value":$object, "Value":$composite, + OpBuilder<(ins "Value":$object, "Value":$composite, "ArrayRef":$indices)> ]; } diff --git a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVControlFlowOps.td b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVControlFlowOps.td --- a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVControlFlowOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVControlFlowOps.td @@ -54,7 +54,7 @@ let verifier = [{ return success(); }]; let builders = [ - OpBuilderDAG<(ins "Block *":$successor, CArg<"ValueRange", "{}">:$arguments), + OpBuilder<(ins "Block *":$successor, CArg<"ValueRange", "{}">:$arguments), [{ $_state.addSuccessors(successor); $_state.addOperands(arguments); @@ -134,7 +134,7 @@ AnySuccessor:$falseTarget); let builders = [ - OpBuilderDAG<(ins "Value":$condition, "Block *":$trueBlock, + OpBuilder<(ins "Value":$condition, "Block *":$trueBlock, "ValueRange":$trueArguments, "Block *":$falseBlock, "ValueRange":$falseArguments, CArg<"Optional>", "{}">:$weights), @@ -286,7 +286,7 @@ let regions = (region AnyRegion:$body); - let builders = [OpBuilderDAG<(ins)>]; + let builders = [OpBuilder<(ins)>]; let extraClassDeclaration = [{ // Returns the entry block. diff --git a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVLogicalOps.td b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVLogicalOps.td --- a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVLogicalOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVLogicalOps.td @@ -28,7 +28,7 @@ let printer = [{ return ::printLogicalOp(getOperation(), p); }]; let builders = [ - OpBuilderDAG<(ins "Value":$lhs, "Value":$rhs), + OpBuilder<(ins "Value":$lhs, "Value":$rhs), [{::buildLogicalBinaryOp($_builder, $_state, lhs, rhs);}]> ]; } @@ -43,7 +43,7 @@ let printer = [{ return ::printLogicalOp(getOperation(), p); }]; let builders = [ - OpBuilderDAG<(ins "Value":$value), + OpBuilder<(ins "Value":$value), [{::buildLogicalUnaryOp($_builder, $_state, value);}]> ]; } @@ -1001,7 +1001,7 @@ ); let builders = [ - OpBuilderDAG<(ins "Value":$cond, "Value":$trueValue, "Value":$falseValue)>]; + OpBuilder<(ins "Value":$cond, "Value":$trueValue, "Value":$falseValue)>]; let assemblyFormat = [{ operands attr-dict `:` type($condition) `,` type($result) diff --git a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVMemoryOps.td b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVMemoryOps.td --- a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVMemoryOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVMemoryOps.td @@ -74,7 +74,7 @@ SPV_AnyPtr:$component_ptr ); - let builders = [OpBuilderDAG<(ins "Value":$basePtr, "ValueRange":$indices)>]; + let builders = [OpBuilder<(ins "Value":$basePtr, "ValueRange":$indices)>]; let hasCanonicalizer = 1; } @@ -183,7 +183,7 @@ ); let builders = [ - OpBuilderDAG<(ins "Value":$basePtr, + OpBuilder<(ins "Value":$basePtr, CArg<"IntegerAttr", "{}">:$memory_access, CArg<"IntegerAttr", "{}">:$alignment)> ]; @@ -232,7 +232,7 @@ let results = (outs); let builders = [ - OpBuilderDAG<(ins "Value":$ptr, "Value":$value, + OpBuilder<(ins "Value":$ptr, "Value":$value, CArg<"ArrayRef", "{}">:$namedAttrs), [{ $_state.addOperands(ptr); diff --git a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVNonUniformOps.td b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVNonUniformOps.td --- a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVNonUniformOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVNonUniformOps.td @@ -208,7 +208,7 @@ SPV_Bool:$result ); - let builders = [OpBuilderDAG<(ins "spirv::Scope")>]; + let builders = [OpBuilder<(ins "spirv::Scope")>]; let assemblyFormat = "$execution_scope attr-dict `:` type($result)"; } diff --git a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVStructureOps.td b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVStructureOps.td --- a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVStructureOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVStructureOps.td @@ -60,7 +60,7 @@ let autogenSerialization = 0; - let builders = [OpBuilderDAG<(ins "spirv::GlobalVariableOp":$var)>]; + let builders = [OpBuilder<(ins "spirv::GlobalVariableOp":$var)>]; let assemblyFormat = "$variable attr-dict `:` type($pointer)"; } @@ -189,7 +189,7 @@ let autogenSerialization = 0; let builders = [ - OpBuilderDAG<(ins "spirv::ExecutionModel":$executionModel, + OpBuilder<(ins "spirv::ExecutionModel":$executionModel, "spirv::FuncOp":$function, "ArrayRef":$interfaceVars)>]; } @@ -239,7 +239,7 @@ let autogenSerialization = 0; let builders = [ - OpBuilderDAG<(ins "spirv::FuncOp":$function, + OpBuilder<(ins "spirv::FuncOp":$function, "spirv::ExecutionMode":$executionMode, "ArrayRef":$params)>]; } @@ -292,7 +292,7 @@ let verifier = [{ return success(); }]; let builders = [ - OpBuilderDAG<(ins "StringRef":$name, "FunctionType":$type, + OpBuilder<(ins "StringRef":$name, "FunctionType":$type, CArg<"spirv::FunctionControl", "spirv::FunctionControl::None">:$control, CArg<"ArrayRef", "{}">:$attrs)>]; @@ -379,14 +379,14 @@ let results = (outs); let builders = [ - OpBuilderDAG<(ins "TypeAttr":$type, "ArrayRef":$namedAttrs), + OpBuilder<(ins "TypeAttr":$type, "ArrayRef":$namedAttrs), [{ $_state.addAttribute("type", type); $_state.addAttributes(namedAttrs); }]>, - OpBuilderDAG<(ins "Type":$type, "StringRef":$name, + OpBuilder<(ins "Type":$type, "StringRef":$name, "unsigned":$descriptorSet, "unsigned":$binding)>, - OpBuilderDAG<(ins "Type":$type, "StringRef":$name, + OpBuilder<(ins "Type":$type, "StringRef":$name, "spirv::BuiltIn":$builtin)> ]; @@ -463,8 +463,8 @@ let regions = (region SizedRegion<1>:$body); let builders = [ - OpBuilderDAG<(ins CArg<"Optional", "llvm::None">:$name)>, - OpBuilderDAG<(ins "spirv::AddressingModel":$addressing_model, + OpBuilder<(ins CArg<"Optional", "llvm::None">:$name)>, + OpBuilder<(ins "spirv::AddressingModel":$addressing_model, "spirv::MemoryModel":$memory_model, CArg<"Optional", "llvm::None">:$name)> ]; diff --git a/mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td b/mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td --- a/mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td +++ b/mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td @@ -81,7 +81,7 @@ $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, "/*optional*/ ::mlir::StringAttr":$error), [{ build($_builder, $_state, result, ::llvm::makeArrayRef({lhs, rhs}), error); @@ -132,7 +132,7 @@ let arguments = (ins IndexAttr:$value); 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 hasFolder = 1; @@ -244,7 +244,7 @@ let results = (outs I1:$result); 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})); }]>, ]; let extraClassDeclaration = [{ @@ -312,7 +312,7 @@ let builders = [ // 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 = [{ @@ -411,7 +411,7 @@ let arguments = (ins Shape_ShapeOrExtentTensorType:$shape); 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)"; @@ -459,7 +459,7 @@ let results = (outs Variadic:$result); 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 printer = [{ return ::print(p, *this); }]; @@ -479,7 +479,7 @@ 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 hasCanonicalizer = 1; @@ -556,7 +556,7 @@ let arguments = (ins Variadic:$operands); - let builders = [OpBuilderDAG<(ins), + let builders = [OpBuilder<(ins), [{ build($_builder, $_state, llvm::None); }]> ]; @@ -735,7 +735,7 @@ let arguments = (ins Variadic:$operands); - let builders = [OpBuilderDAG<(ins), [{ /* nothing to do */ }]>]; + let builders = [OpBuilder<(ins), [{ /* nothing to do */ }]>]; let assemblyFormat = "attr-dict ($operands^ `:` type($operands))?"; } @@ -763,7 +763,7 @@ let assemblyFormat = "$shapes attr-dict `:` type($shapes)"; 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})); }]>, ]; @@ -891,7 +891,7 @@ FuncOp getShapeFunction(Operation *op); }]; - let builders = [OpBuilderDAG<(ins "StringRef":$name)>]; + let builders = [OpBuilder<(ins "StringRef":$name)>]; let skipDefaultBuilders = 1; let printer = [{ ::print(p, *this); }]; diff --git a/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td b/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td --- a/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td +++ b/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td @@ -53,7 +53,7 @@ let results = (outs AnyType); let builders = [ - OpBuilderDAG<(ins "Value":$source, "Type":$destType), [{ + OpBuilder<(ins "Value":$source, "Type":$destType), [{ impl::buildCastOp($_builder, $_state, source, destType); }]> ]; @@ -209,15 +209,15 @@ let results = (outs Res]>:$memref); let builders = [ - OpBuilderDAG<(ins "MemRefType":$memrefType, + OpBuilder<(ins "MemRefType":$memrefType, CArg<"IntegerAttr", "IntegerAttr()">:$alignment), [{ return build($_builder, $_state, memrefType, {}, alignment); }]>, - OpBuilderDAG<(ins "MemRefType":$memrefType, "ValueRange":$dynamicSizes, + OpBuilder<(ins "MemRefType":$memrefType, "ValueRange":$dynamicSizes, CArg<"IntegerAttr", "IntegerAttr()">:$alignment), [{ return build($_builder, $_state, memrefType, dynamicSizes, {}, alignment); }]>, - OpBuilderDAG<(ins "MemRefType":$memrefType, "ValueRange":$dynamicSizes, + OpBuilder<(ins "MemRefType":$memrefType, "ValueRange":$dynamicSizes, "ValueRange":$symbolOperands, CArg<"IntegerAttr", "{}">:$alignment), [{ $_state.types.push_back(memrefType); @@ -623,7 +623,7 @@ let regions = (region AnyRegion:$body); let skipDefaultBuilders = 1; - let builders = [OpBuilderDAG<(ins "Value":$memref, "ValueRange":$ivs)>]; + let builders = [OpBuilder<(ins "Value":$memref, "ValueRange":$ivs)>]; let extraClassDeclaration = [{ // The value stored in memref[ivs]. @@ -678,7 +678,7 @@ let successors = (successor AnySuccessor:$dest); let builders = [ - OpBuilderDAG<(ins "Block *":$dest, + OpBuilder<(ins "Block *":$dest, CArg<"ValueRange", "{}">:$destOperands), [{ $_state.addSuccessors(dest); $_state.addOperands(destOperands); @@ -726,18 +726,18 @@ let results = (outs Variadic); let builders = [ - OpBuilderDAG<(ins "FuncOp":$callee, CArg<"ValueRange", "{}">:$operands), [{ + OpBuilder<(ins "FuncOp":$callee, CArg<"ValueRange", "{}">:$operands), [{ $_state.addOperands(operands); $_state.addAttribute("callee",$_builder.getSymbolRefAttr(callee)); $_state.addTypes(callee.getType().getResults()); }]>, - OpBuilderDAG<(ins "SymbolRefAttr":$callee, "TypeRange":$results, + OpBuilder<(ins "SymbolRefAttr":$callee, "TypeRange":$results, CArg<"ValueRange", "{}">:$operands), [{ $_state.addOperands(operands); $_state.addAttribute("callee", callee); $_state.addTypes(results); }]>, - OpBuilderDAG<(ins "StringRef":$callee, "TypeRange":$results, + OpBuilder<(ins "StringRef":$callee, "TypeRange":$results, CArg<"ValueRange", "{}">:$operands), [{ build($_builder, $_state, $_builder.getSymbolRefAttr(callee), results, operands); @@ -802,7 +802,7 @@ let results = (outs Variadic:$results); let builders = [ - OpBuilderDAG<(ins "Value":$callee, CArg<"ValueRange", "{}">:$operands), [{ + OpBuilder<(ins "Value":$callee, CArg<"ValueRange", "{}">:$operands), [{ $_state.operands.push_back(callee); $_state.addOperands(operands); $_state.addTypes(callee.getType().cast().getResults()); @@ -966,7 +966,7 @@ let results = (outs BoolLike:$result); let builders = [ - OpBuilderDAG<(ins "CmpFPredicate":$predicate, "Value":$lhs, + OpBuilder<(ins "CmpFPredicate":$predicate, "Value":$lhs, "Value":$rhs), [{ ::buildCmpFOp($_builder, $_state, predicate, lhs, rhs); }]>]; @@ -1087,7 +1087,7 @@ let results = (outs BoolLike:$result); let builders = [ - OpBuilderDAG<(ins "CmpIPredicate":$predicate, "Value":$lhs, + OpBuilder<(ins "CmpIPredicate":$predicate, "Value":$lhs, "Value":$rhs), [{ ::buildCmpIOp($_builder, $_state, predicate, lhs, rhs); }]>]; @@ -1151,13 +1151,13 @@ let successors = (successor AnySuccessor:$trueDest, AnySuccessor:$falseDest); let builders = [ - OpBuilderDAG<(ins "Value":$condition, "Block *":$trueDest, + OpBuilder<(ins "Value":$condition, "Block *":$trueDest, "ValueRange":$trueOperands, "Block *":$falseDest, "ValueRange":$falseOperands), [{ build($_builder, $_state, condition, trueOperands, falseOperands, trueDest, falseDest); }]>, - OpBuilderDAG<(ins "Value":$condition, "Block *":$trueDest, + OpBuilder<(ins "Value":$condition, "Block *":$trueDest, "Block *":$falseDest, CArg<"ValueRange", "{}">:$falseOperands), [{ build($_builder, $_state, condition, trueDest, ValueRange(), falseDest, falseOperands); @@ -1285,7 +1285,7 @@ let results = (outs AnyType); let builders = [ - OpBuilderDAG<(ins "Attribute":$value), + OpBuilder<(ins "Attribute":$value), [{ build($_builder, $_state, value.getType(), value); }]>]; let extraClassDeclaration = [{ @@ -1401,8 +1401,8 @@ }]; let builders = [ - OpBuilderDAG<(ins "Value":$memrefOrTensor, "int64_t":$index)>, - OpBuilderDAG<(ins "Value":$memrefOrTensor, "Value":$index)> + OpBuilder<(ins "Value":$memrefOrTensor, "int64_t":$index)>, + OpBuilder<(ins "Value":$memrefOrTensor, "Value":$index)> ]; let extraClassDeclaration = [{ @@ -1672,7 +1672,7 @@ let results = (outs AnyType:$result); let builders = [ - OpBuilderDAG<(ins "Value":$memref, CArg<"ValueRange", "{}">:$indices), [{ + OpBuilder<(ins "Value":$memref, CArg<"ValueRange", "{}">:$indices), [{ auto memrefType = memref.getType().cast(); $_state.addOperands(memref); $_state.addOperands(indices); @@ -1819,17 +1819,17 @@ let builders = [ // Build a ReinterpretCastOp with mixed static and dynamic entries. - OpBuilderDAG<(ins "MemRefType":$resultType, "Value":$source, + OpBuilder<(ins "MemRefType":$resultType, "Value":$source, "OpFoldResult":$offset, "ArrayRef":$sizes, "ArrayRef":$strides, CArg<"ArrayRef", "{}">:$attrs)>, // Build a ReinterpretCastOp with static entries. - OpBuilderDAG<(ins "MemRefType":$resultType, "Value":$source, + OpBuilder<(ins "MemRefType":$resultType, "Value":$source, "int64_t":$offset, "ArrayRef":$sizes, "ArrayRef":$strides, CArg<"ArrayRef", "{}">:$attrs)>, // Build a ReinterpretCastOp with dynamic entries. - OpBuilderDAG<(ins "MemRefType":$resultType, "Value":$source, + OpBuilder<(ins "MemRefType":$resultType, "Value":$source, "Value":$offset, "ValueRange":$sizes, "ValueRange":$strides, CArg<"ArrayRef", "{}">:$attrs)> @@ -1905,7 +1905,7 @@ ); let results = (outs AnyRankedOrUnrankedMemRef:$result); - let builders = [OpBuilderDAG< + let builders = [OpBuilder< (ins "MemRefType":$resultType, "Value":$operand, "Value":$shape), [{ $_state.addOperands(operand); $_state.addOperands(shape); @@ -2099,7 +2099,7 @@ let verifier = ?; let builders = [ - OpBuilderDAG<(ins "Value":$tensor), [{ + OpBuilder<(ins "Value":$tensor), [{ auto indexType = $_builder.getIndexType(); build($_builder, $_state, indexType, tensor); }]>]; @@ -2142,7 +2142,7 @@ let arguments = (ins Variadic:$operands); let builders = [ - OpBuilderDAG<(ins), + OpBuilder<(ins), [{ build($_builder, $_state, llvm::None); }]>]; let assemblyFormat = "attr-dict ($operands^ `:` type($operands))?"; @@ -2195,7 +2195,7 @@ let results = (outs AnyType:$result); let builders = [ - OpBuilderDAG<(ins "Value":$condition, "Value":$trueValue, + OpBuilder<(ins "Value":$condition, "Value":$trueValue, "Value":$falseValue), [{ $_state.addOperands({condition, trueValue, falseValue}); $_state.addTypes(trueValue.getType()); @@ -2412,7 +2412,7 @@ let results = (outs SignlessIntegerLike); let builders = [ - OpBuilderDAG<(ins "Value":$value, "Type":$destType), [{ + OpBuilder<(ins "Value":$value, "Type":$destType), [{ $_state.addOperands(value); $_state.addTypes(destType); }]>]; @@ -2478,7 +2478,7 @@ let results = (outs AnyTypeOf<[AnyVector, AnyStaticShapeTensor]>:$aggregate); let builders = [ - OpBuilderDAG<(ins "Value":$element, "Type":$aggregateType), + OpBuilder<(ins "Value":$element, "Type":$aggregateType), [{ build($_builder, $_state, aggregateType, element); }]>]; let hasFolder = 1; @@ -2531,7 +2531,7 @@ Variadic:$indices); let builders = [ - OpBuilderDAG<(ins "Value":$valueToStore, "Value":$memref), [{ + OpBuilder<(ins "Value":$valueToStore, "Value":$memref), [{ $_state.addOperands(valueToStore); $_state.addOperands(memref); }]>]; @@ -2732,32 +2732,32 @@ let builders = [ // Build a SubViewOp with mixed static and dynamic entries and custom // result type. If the type passed is nullptr, it is inferred. - OpBuilderDAG<(ins "Value":$source, "ArrayRef":$offsets, + OpBuilder<(ins "Value":$source, "ArrayRef":$offsets, "ArrayRef":$sizes, "ArrayRef":$strides, CArg<"ArrayRef", "{}">:$attrs)>, // Build a SubViewOp with mixed static and dynamic entries and inferred // result type. - OpBuilderDAG<(ins "MemRefType":$resultType, "Value":$source, + OpBuilder<(ins "MemRefType":$resultType, "Value":$source, "ArrayRef":$offsets, "ArrayRef":$sizes, "ArrayRef":$strides, CArg<"ArrayRef", "{}">:$attrs)>, // Build a SubViewOp with static entries and custom result type. If the // type passed is nullptr, it is inferred. - OpBuilderDAG<(ins "Value":$source, "ArrayRef":$offsets, + OpBuilder<(ins "Value":$source, "ArrayRef":$offsets, "ArrayRef":$sizes, "ArrayRef":$strides, CArg<"ArrayRef", "{}">:$attrs)>, // Build a SubViewOp with static entries and inferred result type. - OpBuilderDAG<(ins "MemRefType":$resultType, "Value":$source, + OpBuilder<(ins "MemRefType":$resultType, "Value":$source, "ArrayRef":$offsets, "ArrayRef":$sizes, "ArrayRef":$strides, CArg<"ArrayRef", "{}">:$attrs)>, // Build a SubViewOp with dynamic entries and custom result type. If the // type passed is nullptr, it is inferred. - OpBuilderDAG<(ins "Value":$source, "ValueRange":$offsets, + OpBuilder<(ins "Value":$source, "ValueRange":$offsets, "ValueRange":$sizes, "ValueRange":$strides, CArg<"ArrayRef", "{}">:$attrs)>, // 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, CArg<"ArrayRef", "{}">:$attrs)> ]; @@ -2876,22 +2876,22 @@ let builders = [ // Build a SubTensorOp with mixed static and dynamic entries and inferred // result type. - OpBuilderDAG<(ins "Value":$source, "ArrayRef":$offsets, + OpBuilder<(ins "Value":$source, "ArrayRef":$offsets, "ArrayRef":$sizes, "ArrayRef":$strides, CArg<"ArrayRef", "{}">:$attrs)>, // Build a SubTensorOp with mixed static and dynamic entries and custom // result type. If the type passed is nullptr, it is inferred. - OpBuilderDAG<(ins "RankedTensorType":$resultType, "Value":$source, + OpBuilder<(ins "RankedTensorType":$resultType, "Value":$source, "ArrayRef":$offsets, "ArrayRef":$sizes, "ArrayRef":$strides, CArg<"ArrayRef", "{}">:$attrs)>, // Build a SubTensorOp with dynamic entries and custom result type. If the // type passed is nullptr, it is inferred. - OpBuilderDAG<(ins "Value":$source, "ValueRange":$offsets, + OpBuilder<(ins "Value":$source, "ValueRange":$offsets, "ValueRange":$sizes, "ValueRange":$strides, CArg<"ArrayRef", "{}">:$attrs)>, // 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, CArg<"ArrayRef", "{}">:$attrs)> ]; @@ -3009,12 +3009,12 @@ let builders = [ // Build a SubTensorInsertOp with mixed static and dynamic entries. - OpBuilderDAG<(ins "Value":$source, "Value":$dest, + OpBuilder<(ins "Value":$source, "Value":$dest, "ArrayRef":$offsets, "ArrayRef":$sizes, "ArrayRef":$strides, CArg<"ArrayRef", "{}">:$attrs)>, // Build a SubTensorInsertOp with dynamic entries. - OpBuilderDAG<(ins "Value":$source, "Value":$dest, + OpBuilder<(ins "Value":$source, "Value":$dest, "ValueRange":$offsets, "ValueRange":$sizes, "ValueRange":$strides, CArg<"ArrayRef", "{}">:$attrs)> ]; @@ -3080,7 +3080,7 @@ let verifier = ?; let builders = [ - OpBuilderDAG<(ins "Value":$memref), [{ + OpBuilder<(ins "Value":$memref), [{ $_state.addOperands(memref); $_state.addTypes(getTensorTypeFromMemRefType(memref.getType())); }]>]; @@ -3199,7 +3199,7 @@ }]; let builders = [ - OpBuilderDAG<(ins "Value":$in, "AffineMapAttr":$permutation, + OpBuilder<(ins "Value":$in, "AffineMapAttr":$permutation, CArg<"ArrayRef", "{}">:$attrs)>]; let extraClassDeclaration = [{ @@ -3239,7 +3239,7 @@ let results = (outs SignlessIntegerLike); let builders = [ - OpBuilderDAG<(ins "Value":$value, "Type":$destType), [{ + OpBuilder<(ins "Value":$value, "Type":$destType), [{ $_state.addOperands(value); $_state.addTypes(destType); }]>]; @@ -3483,7 +3483,7 @@ let results = (outs SignlessIntegerLike); let builders = [ - OpBuilderDAG<(ins "Value":$value, "Type":$destType), [{ + OpBuilder<(ins "Value":$value, "Type":$destType), [{ $_state.addOperands(value); $_state.addTypes(destType); }]>]; diff --git a/mlir/include/mlir/Dialect/Tensor/IR/TensorOps.td b/mlir/include/mlir/Dialect/Tensor/IR/TensorOps.td --- a/mlir/include/mlir/Dialect/Tensor/IR/TensorOps.td +++ b/mlir/include/mlir/Dialect/Tensor/IR/TensorOps.td @@ -91,7 +91,7 @@ let assemblyFormat = "$tensor `[` $indices `]` attr-dict `:` type($tensor)"; let builders = [ - OpBuilderDAG<(ins "Value":$tensor, CArg<"ValueRange", "{}">:$indices), [{ + OpBuilder<(ins "Value":$tensor, CArg<"ValueRange", "{}">:$indices), [{ auto resType = tensor.getType().cast().getElementType(); build($_builder, $_state, resType, tensor, indices); }]>]; @@ -131,9 +131,9 @@ let skipDefaultBuilders = 1; let builders = [ - OpBuilderDAG<(ins "Type":$elementType, "ValueRange":$elements)>, + OpBuilder<(ins "Type":$elementType, "ValueRange":$elements)>, // Special case builder for when `elements` has size >=1. - OpBuilderDAG<(ins "ValueRange":$elements)> + OpBuilder<(ins "ValueRange":$elements)> ]; let hasCanonicalizer = 1; @@ -175,7 +175,7 @@ let builders = [ // Build op and populate its body per callback function. - OpBuilderDAG<(ins "Type":$resultTy, "ValueRange":$dynamicExtents, + OpBuilder<(ins "Type":$resultTy, "ValueRange":$dynamicExtents, "function_ref")>, ]; @@ -200,7 +200,7 @@ let assemblyFormat = "$value attr-dict `:` type($value)"; // Dummy builder to appease code in templated ensureTerminator that // GenerateOp's auto-generated parser calls. - let builders = [OpBuilderDAG<(ins), [{ /* nothing to do */ }]>]; + let builders = [OpBuilder<(ins), [{ /* nothing to do */ }]>]; let verifier = ?; } diff --git a/mlir/include/mlir/Dialect/Tosa/IR/TosaOpBase.td b/mlir/include/mlir/Dialect/Tosa/IR/TosaOpBase.td --- a/mlir/include/mlir/Dialect/Tosa/IR/TosaOpBase.td +++ b/mlir/include/mlir/Dialect/Tosa/IR/TosaOpBase.td @@ -111,7 +111,7 @@ // This builder is called on all convolution operators except for TransposeConv, // which has specialized output shape semantics. The builder also defines the // 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, "ArrayAttr":$pad, "ArrayAttr":$stride, "ArrayAttr":$dilation), [{ @@ -121,7 +121,7 @@ }]>; // 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, "ArrayAttr":$outpad, "ArrayAttr":$stride, "ArrayAttr":$dilation, "ArrayAttr":$outputShape), @@ -134,7 +134,7 @@ // The tosa.fully_connected op has its own builder as it does not have // strides/dilation/padding. -def Tosa_FCOpQuantInfoBuilder : OpBuilderDAG< +def Tosa_FCOpQuantInfoBuilder : OpBuilder< (ins "Type":$outputType, "Value":$input, "Value":$weight, "Value":$bias), [{ buildFCOpWithQuantInfo($_builder, $_state, outputType, @@ -145,7 +145,7 @@ // op must be constructed where the weight is not a constant. In this case, // the fully_connected op must be expressed using matmul. // TODO: Add link to the leglization document explaining this. -def Tosa_MatMulOpQuantInfoBuilder : OpBuilderDAG< +def Tosa_MatMulOpQuantInfoBuilder : OpBuilder< (ins "Type":$outputType, "Value":$a, "Value":$b), [{ buildMatMulOpWithQuantInfo($_builder, $_state, outputType, @@ -155,7 +155,7 @@ // Both the tosa.avg_pool2d and unary ops use the same // UnaruOpQuantizationAttr but the avg_pool operator has its own builder as it // has additional parameters not part of the unary ops. -def Tosa_AvgPool2dOpQuantInfoBuilder : OpBuilderDAG< +def Tosa_AvgPool2dOpQuantInfoBuilder : OpBuilder< (ins "Type":$outputType, "Value":$input, "ArrayAttr":$kernel, "ArrayAttr":$stride, "ArrayAttr":$pad), [{ @@ -166,7 +166,7 @@ // This builder is called on single-parameter unary operators that have a scale // relationship between their input and output, expressed by the // UnaryOpQuantizationAttr. -def Tosa_UnaryOpQuantInfoBuilder : OpBuilderDAG< +def Tosa_UnaryOpQuantInfoBuilder : OpBuilder< (ins "Type":$outputType, "Value":$input), [{ buildUnaryOpWithQuantInfo($_builder, $_state, outputType, input); @@ -175,7 +175,7 @@ // This builder is called on the TOSA pad operator that needs to create its own // OptionalAttr quantization_attr parameter to scale the padding values // correctly. -def Tosa_PadOpQuantInfoBuilder : OpBuilderDAG< +def Tosa_PadOpQuantInfoBuilder : OpBuilder< (ins "Type":$outputType, "Value":$input, "Value":$paddings), [{ buildPadOpWithQuantInfo($_builder, $_state, outputType, diff --git a/mlir/include/mlir/Dialect/Vector/VectorOps.td b/mlir/include/mlir/Dialect/Vector/VectorOps.td --- a/mlir/include/mlir/Dialect/Vector/VectorOps.td +++ b/mlir/include/mlir/Dialect/Vector/VectorOps.td @@ -199,9 +199,9 @@ ``` }]; let builders = [ - OpBuilderDAG<(ins "Value":$lhs, "Value":$rhs, "Value":$acc, + OpBuilder<(ins "Value":$lhs, "Value":$rhs, "Value":$acc, "ArrayAttr":$indexingMaps, "ArrayAttr":$iteratorTypes)>, - OpBuilderDAG<(ins "Value":$lhs, "Value":$rhs, "Value":$acc, + OpBuilder<(ins "Value":$lhs, "Value":$rhs, "Value":$acc, "ArrayRef>":$indexingExprs, "ArrayRef":$iteratorTypes)> ]; @@ -371,7 +371,7 @@ ``` }]; let builders = [ - OpBuilderDAG<(ins "Value":$v1, "Value":$v2, "ArrayRef")> + OpBuilder<(ins "Value":$v1, "Value":$v2, "ArrayRef")> ]; let extraClassDeclaration = [{ static StringRef getMaskAttrName() { return "mask"; } @@ -414,8 +414,8 @@ }]; let builders = [ - OpBuilderDAG<(ins "Value":$source, "int64_t":$position)>, - OpBuilderDAG<(ins "Value":$source, "Value":$position)> + OpBuilder<(ins "Value":$source, "int64_t":$position)>, + OpBuilder<(ins "Value":$source, "Value":$position)> ]; let extraClassDeclaration = [{ VectorType getVectorType() { @@ -443,10 +443,10 @@ ``` }]; let builders = [ - OpBuilderDAG<(ins "Value":$source, "ArrayRef":$position)>, + OpBuilder<(ins "Value":$source, "ArrayRef":$position)>, // Convenience builder which assumes the values in `position` are defined by // ConstantIndexOp. - OpBuilderDAG<(ins "Value":$source, "ValueRange":$position)> + OpBuilder<(ins "Value":$source, "ValueRange":$position)> ]; let extraClassDeclaration = [{ static StringRef getPositionAttrName() { return "position"; } @@ -493,7 +493,7 @@ ``` }]; let builders = [ - OpBuilderDAG<(ins "TupleType":$tupleType, "Value":$vector, + OpBuilder<(ins "TupleType":$tupleType, "Value":$vector, "ArrayRef":$sizes, "ArrayRef":$strides)> ]; let extraClassDeclaration = [{ @@ -562,7 +562,7 @@ ``` }]; let builders = [ - OpBuilderDAG<(ins "Value":$vector, "ValueRange":$ids, + OpBuilder<(ins "Value":$vector, "ValueRange":$ids, "ArrayRef":$multiplicity, "AffineMap":$map)>]; let extraClassDeclaration = [{ @@ -609,7 +609,7 @@ let verifier = ?; let assemblyFormat = "$lhs `,` $rhs `,` $acc attr-dict `:` type($lhs)"; 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);}]> ]; let extraClassDeclaration = [{ @@ -649,8 +649,8 @@ }]; let builders = [ - OpBuilderDAG<(ins "Value":$source, "Value":$dest, "int64_t":$position)>, - OpBuilderDAG<(ins "Value":$source, "Value":$dest, "Value":$position)> + OpBuilder<(ins "Value":$source, "Value":$dest, "int64_t":$position)>, + OpBuilder<(ins "Value":$source, "Value":$dest, "Value":$position)> ]; let extraClassDeclaration = [{ Type getSourceType() { return source().getType(); } @@ -686,10 +686,10 @@ }]; let builders = [ - OpBuilderDAG<(ins "Value":$source, "Value":$dest, + OpBuilder<(ins "Value":$source, "Value":$dest, "ArrayRef":$position)>, // 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 = [{ static StringRef getPositionAttrName() { return "position"; } @@ -806,7 +806,7 @@ into vector<64x4x32xf32> ``` }]; - let builders = [OpBuilderDAG<(ins "Value":$vector, "Value":$dest, + let builders = [OpBuilder<(ins "Value":$vector, "Value":$dest, "ValueRange":$ids)>]; let extraClassDeclaration = [{ VectorType getSourceVectorType() { @@ -859,7 +859,7 @@ }]; let builders = [ - OpBuilderDAG<(ins "Value":$source, "Value":$dest, + OpBuilder<(ins "Value":$source, "Value":$dest, "ArrayRef":$offsets, "ArrayRef":$strides)> ]; let extraClassDeclaration = [{ @@ -935,7 +935,7 @@ }]; let builders = [ // 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 = [{ VectorType getOperandVectorTypeLHS() { @@ -1115,7 +1115,7 @@ ``` }]; let builders = [ - OpBuilderDAG<(ins "Value":$source, "ArrayRef":$offsets, + OpBuilder<(ins "Value":$source, "ArrayRef":$offsets, "ArrayRef":$sizes, "ArrayRef":$strides)> ]; let extraClassDeclaration = [{ @@ -1288,16 +1288,16 @@ let builders = [ // Builder that sets padding to zero. - OpBuilderDAG<(ins "VectorType":$vector, "Value":$source, + OpBuilder<(ins "VectorType":$vector, "Value":$source, "ValueRange":$indices, "AffineMap":$permutationMap, CArg<"ArrayRef", "{}">:$maybeMasked)>, // Builder that sets padding to 'getMinorIdentityMap'. - OpBuilderDAG<(ins "VectorType":$vector, "Value":$source, + OpBuilder<(ins "VectorType":$vector, "Value":$source, "ValueRange":$indices, "Value":$padding, CArg<"ArrayRef", "{}">:$maybeMasked)>, // Builder that sets permutation map (resp. padding) to // 'getMinorIdentityMap' (resp. zero). - OpBuilderDAG<(ins "VectorType":$vector, "Value":$source, + OpBuilder<(ins "VectorType":$vector, "Value":$source, "ValueRange":$indices, CArg<"ArrayRef", "{}">:$maybeMasked)> ]; @@ -1385,13 +1385,13 @@ let builders = [ // 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", "{}">:$maybeMasked)>, - OpBuilderDAG<(ins "Value":$vector, "Value":$source, "ValueRange":$indices, + OpBuilder<(ins "Value":$vector, "Value":$source, "ValueRange":$indices, "AffineMap":$permutationMap)>, - OpBuilderDAG<(ins "Value":$vector, "Value":$source, "ValueRange":$indices, + OpBuilder<(ins "Value":$vector, "Value":$source, "ValueRange":$indices, "AffineMapAttr":$permutationMap, "ArrayAttr":$masked)>, - OpBuilderDAG<(ins "Value":$vector, "Value":$source, "ValueRange":$indices, + OpBuilder<(ins "Value":$vector, "Value":$source, "ValueRange":$indices, "AffineMap":$permutationMap, "ArrayAttr":$masked)>, ]; @@ -2016,7 +2016,7 @@ /// Build the canonical memRefType with a single vector. /// E.g. memref<4 x 5 x vector<6 x f32>> -> memref>. - let builders = [OpBuilderDAG<(ins "Value":$source)>]; + let builders = [OpBuilder<(ins "Value":$source)>]; let extraClassDeclaration = [{ MemRefType getMemRefType() { @@ -2172,7 +2172,7 @@ ``` }]; let builders = [ - OpBuilderDAG<(ins "Value":$vector, "ArrayRef":$transp)> + OpBuilder<(ins "Value":$vector, "ArrayRef":$transp)> ]; let extraClassDeclaration = [{ VectorType getVectorType() { @@ -2318,7 +2318,7 @@ ``` }]; let builders = [ - OpBuilderDAG<(ins "Value":$lhs, "Value":$rhs, "unsigned":$lhsRows, + OpBuilder<(ins "Value":$lhs, "Value":$rhs, "unsigned":$lhsRows, "unsigned":$lhsColumns, "unsigned":$rhsColumns), [{ $_state.addOperands({lhs, rhs}); diff --git a/mlir/include/mlir/IR/BuiltinOps.td b/mlir/include/mlir/IR/BuiltinOps.td --- a/mlir/include/mlir/IR/BuiltinOps.td +++ b/mlir/include/mlir/IR/BuiltinOps.td @@ -76,7 +76,7 @@ OptionalAttr:$sym_visibility); let regions = (region AnyRegion:$body); - let builders = [OpBuilderDAG<(ins + let builders = [OpBuilder<(ins "StringRef":$name, "FunctionType":$type, CArg<"ArrayRef", "{}">:$attrs, CArg<"ArrayRef", "{}">:$argAttrs) @@ -184,7 +184,7 @@ let regions = (region SizedRegion<1>:$body); let assemblyFormat = "($sym_name^)? attr-dict-with-keyword $body"; - let builders = [OpBuilderDAG<(ins CArg<"Optional", "{}">:$name)>]; + let builders = [OpBuilder<(ins CArg<"Optional", "{}">:$name)>]; let extraClassDeclaration = [{ /// Construct a module from the given location with an optional name. static ModuleOp create(Location loc, Optional name = llvm::None); diff --git a/mlir/include/mlir/IR/OpBase.td b/mlir/include/mlir/IR/OpBase.td --- a/mlir/include/mlir/IR/OpBase.td +++ b/mlir/include/mlir/IR/OpBase.td @@ -2015,7 +2015,7 @@ // 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. @@ -2023,7 +2023,7 @@ // If an empty string is passed in for `body`, then *only* the builder // declaration will be generated; this provides a way to define complicated // builders entirely in C++. -class OpBuilderDAG { +class OpBuilder { dag dagParams = p; code body = b; } @@ -2103,7 +2103,7 @@ // ValueRange operands, // ArrayRef attributes); // ``` - list builders = ?; + list builders = ?; // Avoid generating default build functions. Custom builders must be // provided. diff --git a/mlir/test/lib/Dialect/Test/TestOps.td b/mlir/test/lib/Dialect/Test/TestOps.td --- a/mlir/test/lib/Dialect/Test/TestOps.td +++ b/mlir/test/lib/Dialect/Test/TestOps.td @@ -667,7 +667,7 @@ let description = [{ 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 @@ -1155,7 +1155,7 @@ // 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. let builders = [ - OpBuilderDAG<(ins "IntegerAttr":$count), + OpBuilder<(ins "IntegerAttr":$count), [{ auto i32Type = $_builder.getIntegerType(32); $_state.addTypes(i32Type); // $output1 @@ -1214,7 +1214,7 @@ def IllegalOpTerminator : TEST_Op<"illegal_op_terminator", [Terminator]>; def IllegalOpWithRegion : TEST_Op<"illegal_op_with_region"> { let skipDefaultBuilders = 1; - let builders = [OpBuilderDAG<(ins), + let builders = [OpBuilder<(ins), [{ Region *bodyRegion = $_state.addRegion(); OpBuilder::InsertionGuard g($_builder); @@ -1258,7 +1258,7 @@ def TestRegionBuilderOp : TEST_Op<"region_builder">; def TestReturnOp : TEST_Op<"return", [ReturnLike, Terminator]> { let arguments = (ins Variadic); - let builders = [OpBuilderDAG<(ins), + let builders = [OpBuilder<(ins), [{ build($_builder, $_state, {}); }]> ]; } @@ -1823,7 +1823,7 @@ let assemblyFormat = [{ $result `:` type($result) attr-dict }]; - let builders = [OpBuilderDAG<(ins), + let builders = [OpBuilder<(ins), [{ build($_builder, $_state, {}); }]> ]; } diff --git a/mlir/test/mlir-linalg-ods-gen/test-linalg-ods-gen.tc b/mlir/test/mlir-linalg-ods-gen/test-linalg-ods-gen.tc --- a/mlir/test/mlir-linalg-ods-gen/test-linalg-ods-gen.tc +++ b/mlir/test/mlir-linalg-ods-gen/test-linalg-ods-gen.tc @@ -164,7 +164,7 @@ // Test attribute builder // ODS-LABEL: def Test7Op -// ODS: OpBuilderDAG< +// ODS: OpBuilder< // ODS: (ins "TypeRange":$resultTensorTypes, "ValueRange":$inputs, // ODS: "ValueRange":$outputs, "Attribute":$attr_a, "Attribute":$attr_b) // ODS: $_state.addAttribute("attr_a", attr_a); diff --git a/mlir/test/mlir-tblgen/op-decl-and-defs.td b/mlir/test/mlir-tblgen/op-decl-and-defs.td --- a/mlir/test/mlir-tblgen/op-decl-and-defs.td +++ b/mlir/test/mlir-tblgen/op-decl-and-defs.td @@ -35,8 +35,8 @@ AnyRegion:$someRegion, VariadicRegion:$someRegions ); - let builders = [OpBuilderDAG<(ins "Value":$val)>, - OpBuilderDAG<(ins CArg<"int", "0">:$integer)>]; + let builders = [OpBuilder<(ins "Value":$val)>, + OpBuilder<(ins CArg<"int", "0">:$integer)>]; let parser = [{ foo }]; let printer = [{ bar }]; let verifier = [{ baz }]; @@ -294,7 +294,7 @@ def NS_SkipDefaultBuildersOp : NS_Op<"skip_default_builders", []> { let skipDefaultBuilders = 1; - let builders = [OpBuilderDAG<(ins "Value":$val)>]; + let builders = [OpBuilder<(ins "Value":$val)>]; } // CHECK-LABEL: NS::SkipDefaultBuildersOp declarations diff --git a/mlir/test/mlir-tblgen/op-error.td b/mlir/test/mlir-tblgen/op-error.td --- a/mlir/test/mlir-tblgen/op-error.td +++ b/mlir/test/mlir-tblgen/op-error.td @@ -12,7 +12,7 @@ // ERROR1: error: expected 'ins' def OpInsMissing : Op { let builders = [ - OpBuilderDAG<(outs)> + OpBuilder<(outs)> ]; } #endif @@ -21,7 +21,7 @@ // ERROR2: error: expected an argument with default value after other arguments with default values def OpDefaultValueNotTrailing : Op { let builders = [ - OpBuilderDAG<(ins CArg<"int", "42">, "int")> + OpBuilder<(ins CArg<"int", "42">, "int")> ]; } #endif @@ -30,7 +30,7 @@ // ERROR3: error: expected an argument with default value after other arguments with default values def OpDefaultValueNotTrailing : Op { let builders = [ - OpBuilderDAG<(ins CArg<"int", "42">, CArg<"int">)> + OpBuilder<(ins CArg<"int", "42">, CArg<"int">)> ]; } #endif diff --git a/mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-gen.cpp b/mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-gen.cpp --- a/mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-gen.cpp +++ b/mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-gen.cpp @@ -1885,7 +1885,7 @@ let skipDefaultBuilders = 1; let builders = [ - OpBuilderDAG< + OpBuilder< (ins "ValueRange":$inputs, "ValueRange":$outputs), [{{ $_state.addOperands(inputs); @@ -1901,7 +1901,7 @@ TypeRange(inputs), TypeRange(outputs)/*, TODO: support captures*/); }]>, - OpBuilderDAG< + OpBuilder< (ins "TypeRange":$resultTensorTypes, "ValueRange":$inputs, "ValueRange":$outputs), [{{ @@ -1919,7 +1919,7 @@ TypeRange(inputs), TypeRange(outputs)/*, TODO: support captures*/); }]>, - OpBuilderDAG< + OpBuilder< (ins "TypeRange":$resultTensorTypes, "ValueRange":$operands, CArg<"ArrayRef", "{{}">:$attributes), [{{ @@ -1994,7 +1994,7 @@ std::string attrStmtsList = llvm::join(attrStmts, "\n"); const char *builderFmt = R"FMT( - , OpBuilderDAG< + , OpBuilder< (ins "TypeRange":$resultTensorTypes, "ValueRange":$inputs, "ValueRange":$outputs, {1}), [{{ diff --git a/mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp b/mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp --- a/mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp +++ b/mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp @@ -435,7 +435,7 @@ let skipDefaultBuilders = 1; let builders = [ - OpBuilderDAG< + OpBuilder< (ins "ValueRange":$inputs, "ValueRange":$outputs), [{{ $_state.addOperands(inputs); @@ -451,7 +451,7 @@ TypeRange(inputs), TypeRange(outputs)/*, TODO: support captures*/); }]>, - OpBuilderDAG< + OpBuilder< (ins "TypeRange":$resultTensorTypes, "ValueRange":$inputs, "ValueRange":$outputs), [{{ @@ -469,7 +469,7 @@ TypeRange(inputs), TypeRange(outputs)/*, TODO: support captures*/); }]>, - OpBuilderDAG< + OpBuilder< (ins "TypeRange":$resultTensorTypes, "ValueRange":$operands, CArg<"ArrayRef", "{{}">:$attributes), [{{