From: Alex Zinenko Date: Wed, 3 Mar 2021 14:53:09 +0000 (+0100) Subject: [mlir] ODS: change OpBuilderDAG to OpBuilder X-Git-Tag: llvmorg-14-init~13417 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=32c49c7d730d8e46921f3f17aee52a7a5320d9ef;p=platform%2Fupstream%2Fllvm.git [mlir] ODS: change OpBuilderDAG to OpBuilder We no longer have the non-DAG version. Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D97856 --- diff --git a/flang/include/flang/Optimizer/Dialect/FIROps.td b/flang/include/flang/Optimizer/Dialect/FIROps.td index 5b09559..a039001 100644 --- a/flang/include/flang/Optimizer/Dialect/FIROps.td +++ b/flang/include/flang/Optimizer/Dialect/FIROps.td @@ -36,7 +36,7 @@ class fir_SimpleOp traits> } // 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 @@ def fir_AllocateOpBuilder : OpBuilderDAG<(ins $_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 @@ def fir_NamedAllocateOpBuilder : OpBuilderDAG<(ins $_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 @@ class fir_SimpleOneResultOp traits = []> : 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 @@ def fir_LoadOp : fir_OneResultOp<"load"> { 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 @@ class fir_IntegralSwitchTerminatorOp 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 @@ def fir_SelectCaseOp : fir_SwitchTerminatorOp<"select_case"> { 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 @@ def fir_SelectTypeOp : fir_SwitchTerminatorOp<"select_type"> { }]; 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 @@ def fir_EmboxOp : fir_Op<"embox", [NoSideEffect, AttrSizedOperandSegments]> { 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 @@ def fir_CoordinateOp : fir_Op<"coordinate_of", [NoSideEffect]> { 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 @@ def fir_FieldIndexOp : fir_OneResultOp<"field_index", [NoSideEffect]> { } }]; - let builders = [OpBuilderDAG<(ins "llvm::StringRef":$fieldName, + let builders = [OpBuilder<(ins "llvm::StringRef":$fieldName, "mlir::Type":$recTy, CArg<"mlir::ValueRange","{}">:$operands), [{ $_state.addAttribute(fieldAttrName(), @@ -2233,7 +2233,7 @@ def fir_LenParamIndexOp : fir_OneResultOp<"len_param_index", [NoSideEffect]> { << ", " << (*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 @@ def fir_ResultOp : fir_Op<"result", }]; 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 @@ def fir_DoLoopOp : region_Op<"do_loop", 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 @@ def fir_IfOp : region_Op<"if", [NoRegionArguments]> { 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 @@ def fir_IterWhileOp : region_Op<"iterate_while", 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 @@ def fir_CallOp : fir_Op<"call", [CallOpInterface]> { 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 @@ def fir_CallOp : fir_Op<"call", [CallOpInterface]> { $_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 @@ def fir_CallOp : fir_Op<"call", [CallOpInterface]> { $_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 @@ def fir_CmpfOp : fir_Op<"cmpf", 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 @@ def fir_CmpcOp : fir_Op<"cmpc", 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 @@ def fir_GenTypeDescOp : fir_OneResultOp<"gentypedesc", [NoSideEffect]> { 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 @@ def fir_GlobalOp : fir_Op<"global", [IsolatedFromAbove, Symbol]> { 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 @@ def fir_DispatchTableOp : fir_Op<"dispatch_table", 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 index 3eb0d801..10cd936 100644 --- a/mlir/docs/OpDefinitions.md +++ b/mlir/docs/OpDefinitions.md @@ -451,7 +451,7 @@ def MyOp : Op<"my_op", []> { let arguments = (ins F32Attr:$attr); let builders = [ - OpBuilderDAG<(ins "float":$val)> + OpBuilder<(ins "float":$val)> ]; } ``` @@ -489,7 +489,7 @@ def MyOp : Op<"my_op", []> { let arguments = (ins F32Attr:$attr); let builders = [ - OpBuilderDAG<(ins "float":$val), [{ + OpBuilder<(ins "float":$val), [{ $_state.addAttribute("attr", $_builder.getF32FloatAttr(val)); }]> ]; @@ -511,7 +511,7 @@ def MyOp : Op<"my_op", []> { 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 index 6c9b93a..f684494 100644 --- a/mlir/docs/Tutorials/Toy/Ch-2.md +++ b/mlir/docs/Tutorials/Toy/Ch-2.md @@ -492,14 +492,14 @@ def ConstantOp : Toy_Op<"constant"> { // 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 index cc110e1..c68ca5b 100644 --- a/mlir/examples/toy/Ch2/include/toy/Ops.td +++ b/mlir/examples/toy/Ch2/include/toy/Ops.td @@ -68,12 +68,12 @@ def ConstantOp : Toy_Op<"constant", [NoSideEffect]> { // 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 @@ def AddOp : Toy_Op<"add"> { // 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 @@ def GenericCallOp : Toy_Op<"generic_call"> { // 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 @@ def MulOp : Toy_Op<"mul"> { // 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 @@ def ReturnOp : Toy_Op<"return", [NoSideEffect, HasParent<"FuncOp">, // 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 @@ def TransposeOp : Toy_Op<"transpose"> { // 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 index 8808bc8..cdbef4c 100644 --- a/mlir/examples/toy/Ch3/include/toy/Ops.td +++ b/mlir/examples/toy/Ch3/include/toy/Ops.td @@ -67,12 +67,12 @@ def ConstantOp : Toy_Op<"constant", [NoSideEffect]> { // 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 @@ def AddOp : Toy_Op<"add", [NoSideEffect]> { // 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 @@ def GenericCallOp : Toy_Op<"generic_call"> { // 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 @@ def MulOp : Toy_Op<"mul", [NoSideEffect]> { // 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 @@ def ReturnOp : Toy_Op<"return", [NoSideEffect, HasParent<"FuncOp">, // 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 @@ def TransposeOp : Toy_Op<"transpose", [NoSideEffect]> { // 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 index 8ba8f1a..7f9662c 100644 --- a/mlir/examples/toy/Ch4/include/toy/Ops.td +++ b/mlir/examples/toy/Ch4/include/toy/Ops.td @@ -70,12 +70,12 @@ def ConstantOp : Toy_Op<"constant", [NoSideEffect]> { // 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 @@ def AddOp : Toy_Op<"add", // 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 @@ def GenericCallOp : Toy_Op<"generic_call", // 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 @@ def MulOp : Toy_Op<"mul", // 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 @@ def ReturnOp : Toy_Op<"return", [NoSideEffect, HasParent<"FuncOp">, // 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 @@ def TransposeOp : Toy_Op<"transpose", // 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 index 5e9a0a0..db81814 100644 --- a/mlir/examples/toy/Ch5/include/toy/Ops.td +++ b/mlir/examples/toy/Ch5/include/toy/Ops.td @@ -70,12 +70,12 @@ def ConstantOp : Toy_Op<"constant", [NoSideEffect]> { // 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 @@ def AddOp : Toy_Op<"add", // 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 @@ def GenericCallOp : Toy_Op<"generic_call", // 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 @@ def MulOp : Toy_Op<"mul", // 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 @@ def ReturnOp : Toy_Op<"return", [NoSideEffect, HasParent<"FuncOp">, // 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 @@ def TransposeOp : Toy_Op<"transpose", // 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 index 2f9e169..3af018a 100644 --- a/mlir/examples/toy/Ch6/include/toy/Ops.td +++ b/mlir/examples/toy/Ch6/include/toy/Ops.td @@ -70,12 +70,12 @@ def ConstantOp : Toy_Op<"constant", [NoSideEffect]> { // 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 @@ def AddOp : Toy_Op<"add", // 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 @@ def GenericCallOp : Toy_Op<"generic_call", // 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 @@ def MulOp : Toy_Op<"mul", // 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 @@ def ReturnOp : Toy_Op<"return", [NoSideEffect, HasParent<"FuncOp">, // 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 @@ def TransposeOp : Toy_Op<"transpose", // 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 index 3984a5c..7ca473e 100644 --- a/mlir/examples/toy/Ch7/include/toy/Ops.td +++ b/mlir/examples/toy/Ch7/include/toy/Ops.td @@ -80,12 +80,12 @@ def ConstantOp : Toy_Op<"constant", // 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 @@ def AddOp : Toy_Op<"add", // 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 @@ def GenericCallOp : Toy_Op<"generic_call", // 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 @@ def MulOp : Toy_Op<"mul", // 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 @@ def ReturnOp : Toy_Op<"return", [NoSideEffect, HasParent<"FuncOp">, // 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 @@ def StructAccessOp : Toy_Op<"struct_access", [NoSideEffect]> { // 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 @@ def TransposeOp : Toy_Op<"transpose", // 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 index 0a167de..c32b235 100644 --- a/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td +++ b/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td @@ -72,7 +72,7 @@ def AffineApplyOp : Affine_Op<"apply", [NoSideEffect]> { // 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 @@ def AffineForOp : Affine_Op<"for", 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 @@ def AffineIfOp : Affine_Op<"if", 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 @@ def AffineLoadOp : AffineLoadOpBase<"load"> { 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 @@ class AffineMinMaxOpBase traits = []> : 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 @@ def AffineParallelOp : Affine_Op<"parallel", 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 @@ def AffinePrefetchOp : Affine_Op<"prefetch", 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 @@ def AffineStoreOp : AffineStoreOpBase<"store"> { 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 @@ def AffineYieldOp : Affine_Op<"yield", [NoSideEffect, Terminator, ReturnLike, 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 @@ def AffineVectorLoadOp : AffineLoadOpBase<"vector_load"> { 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 @@ def AffineVectorStoreOp : AffineStoreOpBase<"vector_store"> { 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 index c95e8f4..fbfc529 100644 --- a/mlir/include/mlir/Dialect/Async/IR/AsyncOps.td +++ b/mlir/include/mlir/Dialect/Async/IR/AsyncOps.td @@ -85,7 +85,7 @@ def Async_ExecuteOp : 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 @@ def Async_AwaitOp : Async_Op<"await"> { 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 index 915347e0..b8b958d 100644 --- a/mlir/include/mlir/Dialect/GPU/GPUOps.td +++ b/mlir/include/mlir/Dialect/GPU/GPUOps.td @@ -197,7 +197,7 @@ def GPU_GPUFuncOp : GPU_Op<"func", [HasParent<"GPUModuleOp">, 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 @@ def GPU_LaunchFuncOp : GPU_Op<"launch_func", 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 @@ def GPU_LaunchOp : GPU_Op<"launch">, 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 @@ def GPU_ReturnOp : GPU_Op<"return", [HasParent<"GPUFuncOp">, NoSideEffect, 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 @@ def GPU_GPUModuleOp : GPU_Op<"module", [ ``` }]; - let builders = [OpBuilderDAG<(ins "StringRef":$name)>]; + let builders = [OpBuilder<(ins "StringRef":$name)>]; let parser = [{ return ::parseGPUModuleOp(parser, result); }]; let 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 index 956c555..661f83c 100644 --- a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td +++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td @@ -64,7 +64,7 @@ class LLVM_Builder { } def LLVM_OneResultOpBuilder : - OpBuilderDAG<(ins "Type":$resultType, "ValueRange":$operands, + OpBuilder<(ins "Type":$resultType, "ValueRange":$operands, CArg<"ArrayRef", "{}">:$attributes), [{ if (resultType) $_state.addTypes(resultType); @@ -75,7 +75,7 @@ def LLVM_OneResultOpBuilder : }]>; def LLVM_ZeroResultOpBuilder : - OpBuilderDAG<(ins "ValueRange":$operands, + OpBuilder<(ins "ValueRange":$operands, CArg<"ArrayRef", "{}">:$attributes), [{ $_state.addOperands(operands); @@ -87,7 +87,7 @@ def LLVM_ZeroResultOpBuilder : // 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"); @@ -99,7 +99,7 @@ def LLVM_VoidResultTypeOpBuilder : // 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); @@ -194,7 +194,7 @@ def LLVM_ICmpOp : LLVM_Op<"icmp", [NoSideEffect]> { $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); @@ -244,7 +244,7 @@ def LLVM_FCmpOp : LLVM_Op<"fcmp", [ $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), @@ -301,7 +301,7 @@ def LLVM_AllocaOp : LLVM_Op<"alloca">, MemoryOpWithAlignmentBase { $res = inst; }]; let builders = [ - OpBuilderDAG<(ins "Type":$resultType, "Value":$arraySize, + OpBuilder<(ins "Type":$resultType, "Value":$arraySize, "unsigned":$alignment), [{ if (alignment == 0) @@ -335,13 +335,13 @@ def LLVM_LoadOp : LLVM_Op<"load">, MemoryOpWithAlignmentAndAttributes { $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); }]; @@ -357,7 +357,7 @@ def LLVM_StoreOp : LLVM_Op<"store">, MemoryOpWithAlignmentAndAttributes { 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)> ]; @@ -429,14 +429,14 @@ def LLVM_InvokeOp : LLVM_Op<"invoke", [ 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, @@ -492,7 +492,7 @@ def LLVM_CallOp : LLVM_Op<"call", 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(); @@ -513,7 +513,7 @@ def LLVM_ExtractElementOp : LLVM_Op<"extractelement", [NoSideEffect]> { $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); }]; @@ -548,7 +548,7 @@ def LLVM_InsertValueOp : LLVM_Op<"insertvalue", [NoSideEffect]> { 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); }]>]; @@ -564,7 +564,7 @@ def LLVM_ShuffleVectorOp : LLVM_Op<"shufflevector", [NoSideEffect]> { $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(); @@ -588,7 +588,7 @@ def LLVM_SelectOp 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); }]>]; @@ -628,7 +628,7 @@ def LLVM_CondBrOp : LLVM_TerminatorOp<"cond_br", }]; let builders = [ - OpBuilderDAG<(ins "Value":$condition, "Block *":$trueDest, + OpBuilder<(ins "Value":$condition, "Block *":$trueDest, "ValueRange":$trueOperands, "Block *":$falseDest, "ValueRange":$falseOperands, CArg<"Optional>", "{}">:$weights), @@ -642,7 +642,7 @@ def LLVM_CondBrOp : LLVM_TerminatorOp<"cond_br", 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, @@ -710,7 +710,7 @@ def LLVM_SwitchOp : LLVM_TerminatorOp<"switch", }]; let builders = [ - OpBuilderDAG<(ins "Value":$value, + OpBuilder<(ins "Value":$value, "Block *":$defaultDestination, "ValueRange":$defaultOperands, CArg<"ArrayRef", "{}">:$caseValues, @@ -809,7 +809,7 @@ def LLVM_AddressOfOp : LLVM_Op<"mlir.addressof"> { }]; let builders = [ - OpBuilderDAG<(ins "GlobalOp":$global, + OpBuilder<(ins "GlobalOp":$global, CArg<"ArrayRef", "{}">:$attrs), [{ build($_builder, $_state, @@ -817,7 +817,7 @@ def LLVM_AddressOfOp : LLVM_Op<"mlir.addressof"> { global.sym_name()); $_state.addAttributes(attrs); }]>, - OpBuilderDAG<(ins "LLVMFuncOp":$func, + OpBuilder<(ins "LLVMFuncOp":$func, CArg<"ArrayRef", "{}">:$attrs), [{ build($_builder, $_state, @@ -976,7 +976,7 @@ def LLVM_GlobalOp : LLVM_Op<"mlir.global", 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)> ]; @@ -1050,7 +1050,7 @@ def LLVM_LLVMFuncOp : LLVM_Op<"func", 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 index a295cdc..63bee92 100644 --- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td +++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td @@ -101,24 +101,24 @@ def Linalg_InitTensorOp : Linalg_Op<"init_tensor", [NoSideEffect]> { }]; 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 @@ def Linalg_PadTensorOp : Linalg_Op<"pad_tensor", 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 @@ def Linalg_RangeOp : ```` }]; 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 @@ class Linalg_ReshapeLikeOp traits = []> : 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 @@ class Linalg_ReshapeLikeOp traits = []> : // 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 @@ def Linalg_YieldOp : Linalg_Op<"yield", [NoSideEffect, ReturnLike, Terminator]>, 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 @@ def Linalg_TiledLoopOp : Linalg_Op<"tiled_loop", [ 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 index cb37092..f87a1ea 100644 --- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td +++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td @@ -113,7 +113,7 @@ def CopyOp : LinalgStructured_Op<"copy", [CopyOpInterface]> { 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 @@ def FillOp : LinalgStructured_Op<"fill", []> { }]; let builders = [ - OpBuilderDAG<(ins "Value":$output, "Value":$value)> + OpBuilder<(ins "Value":$output, "Value":$value)> ]; let verifier = [{ return ::verify(*this); }]; @@ -642,20 +642,20 @@ def GenericOp : GenericOpBase<"generic"> { }]; 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 @@ def IndexedGenericOp : GenericOpBase<"indexed_generic"> { }]; 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 index a48af00..586cee4 100644 --- a/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td +++ b/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td @@ -382,7 +382,7 @@ def OpenACC_YieldOp : OpenACC_Op<"yield", [Terminator, 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 index 92e418f..24a06c4 100644 --- a/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td +++ b/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td @@ -93,7 +93,7 @@ def ParallelOp : OpenMP_Op<"parallel", [AttrSizedOperandSegments]> { 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 @@ def WsLoopOp : OpenMP_Op<"wsloop", [AttrSizedOperandSegments]> { 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 index 812a71c..60590b1f 100644 --- a/mlir/include/mlir/Dialect/PDL/IR/PDLOps.td +++ b/mlir/include/mlir/Dialect/PDL/IR/PDLOps.td @@ -59,7 +59,7 @@ def PDL_ApplyConstraintOp }]; 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 @@ def PDL_AttributeOp : PDL_Op<"attribute"> { 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 @@ def PDL_OperandOp : PDL_Op<"operand", [HasParent<"pdl::PatternOp">]> { let assemblyFormat = "(`:` $type^)? attr-dict"; let builders = [ - OpBuilderDAG<(ins), [{ + OpBuilder<(ins), [{ build($_builder, $_state, $_builder.getType(), Value()); }]>, ]; @@ -253,7 +253,7 @@ def PDL_OperationOp 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 @@ def PDL_PatternOp : PDL_Op<"pattern", [IsolatedFromAbove, Symbol]> { }]; 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 @@ def PDL_TypeOp : PDL_Op<"type"> { 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 index 46513c1..517a0f4 100644 --- a/mlir/include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.td +++ b/mlir/include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.td @@ -346,7 +346,7 @@ def PDLInterp_CreateAttributeOp let assemblyFormat = "$value attr-dict"; let builders = [ - OpBuilderDAG<(ins "Attribute":$value), [{ + OpBuilder<(ins "Attribute":$value), [{ build($_builder, $_state, $_builder.getType(), value); }]>]; } @@ -410,7 +410,7 @@ def PDLInterp_CreateOperationOp 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, @@ -442,7 +442,7 @@ def PDLInterp_CreateTypeOp : PDLInterp_Op<"create_type", [NoSideEffect]> { let assemblyFormat = "$value attr-dict"; let builders = [ - OpBuilderDAG<(ins "TypeAttr":$type), [{ + OpBuilder<(ins "TypeAttr":$type), [{ build($_builder, $_state, $_builder.getType(), type); }]> ]; @@ -537,7 +537,7 @@ def PDLInterp_GetAttributeTypeOp let assemblyFormat = "`of` $value attr-dict"; let builders = [ - OpBuilderDAG<(ins "Value":$value), [{ + OpBuilder<(ins "Value":$value), [{ build($_builder, $_state, $_builder.getType(), value); }]> ]; @@ -638,7 +638,7 @@ def PDLInterp_GetValueTypeOp : PDLInterp_Op<"get_value_type", [NoSideEffect]> { let assemblyFormat = "`of` $value attr-dict"; let builders = [ - OpBuilderDAG<(ins "Value":$value), [{ + OpBuilder<(ins "Value":$value), [{ build($_builder, $_state, $_builder.getType(), value); }]> ]; @@ -665,7 +665,7 @@ def PDLInterp_InferredTypeOp : PDLInterp_Op<"inferred_type"> { let assemblyFormat = "attr-dict"; let builders = [ - OpBuilderDAG<(ins), [{ + OpBuilder<(ins), [{ build($_builder, $_state, $_builder.getType()); }]>, ]; @@ -780,7 +780,7 @@ def PDLInterp_SwitchAttributeOp }]; 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); @@ -813,7 +813,7 @@ def PDLInterp_SwitchOperandCountOp }]; 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); @@ -847,7 +847,7 @@ def PDLInterp_SwitchOperationNameOp }]; 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(); })); @@ -883,7 +883,7 @@ def PDLInterp_SwitchResultCountOp }]; 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); @@ -915,7 +915,7 @@ def PDLInterp_SwitchTypeOp : PDLInterp_SwitchOp<"switch_type", [NoSideEffect]> { }]; 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 index b4e158c..f88fcf4 100644 --- a/mlir/include/mlir/Dialect/SCF/SCFOps.td +++ b/mlir/include/mlir/Dialect/SCF/SCFOps.td @@ -154,7 +154,7 @@ def ForOp : SCF_Op<"for", 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 @@ def IfOp : SCF_Op<"if", 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 @@ def ParallelOp : SCF_Op<"parallel", 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 @@ def ReduceOp : SCF_Op<"reduce", [HasParent<"ParallelOp">]> { let skipDefaultBuilders = 1; let builders = [ - OpBuilderDAG<(ins "Value":$operand, + OpBuilder<(ins "Value":$operand, CArg<"function_ref", "nullptr">:$bodyBuilderFn)> ]; @@ -582,7 +582,7 @@ def YieldOp : SCF_Op<"yield", [NoSideEffect, ReturnLike, Terminator, }]; 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 index 289e9a2..122987a 100644 --- a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAtomicOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAtomicOps.td @@ -49,7 +49,7 @@ class SPV_AtomicUpdateWithValueOp traits = []> : ); 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 index 2ac4fb0..7a5e1de 100644 --- a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVCompositeOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVCompositeOps.td @@ -111,7 +111,7 @@ def SPV_CompositeExtractOp : SPV_Op<"CompositeExtract", ); let builders = [ - OpBuilderDAG<(ins "Value":$composite, "ArrayRef":$indices)> + OpBuilder<(ins "Value":$composite, "ArrayRef":$indices)> ]; let hasFolder = 1; @@ -164,7 +164,7 @@ def SPV_CompositeInsertOp : SPV_Op<"CompositeInsert", ); 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 index 1605672..31930f6 100644 --- a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVControlFlowOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVControlFlowOps.td @@ -54,7 +54,7 @@ def SPV_BranchOp : SPV_Op<"Branch", [ 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 @@ def SPV_BranchConditionalOp : SPV_Op<"BranchConditional", [ 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 @@ def SPV_LoopOp : SPV_Op<"loop", [InFunctionScope]> { 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 index 019b63f..f363e7f 100644 --- a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVLogicalOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVLogicalOps.td @@ -28,7 +28,7 @@ class SPV_LogicalBinaryOp ]; } @@ -43,7 +43,7 @@ class SPV_LogicalUnaryOp ]; } @@ -1001,7 +1001,7 @@ def SPV_SelectOp : SPV_Op<"Select", ); 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 index dc14c8b..9f514a5 100644 --- a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVMemoryOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVMemoryOps.td @@ -74,7 +74,7 @@ def SPV_AccessChainOp : SPV_Op<"AccessChain", [NoSideEffect]> { 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 @@ def SPV_LoadOp : SPV_Op<"Load", []> { ); let builders = [ - OpBuilderDAG<(ins "Value":$basePtr, + OpBuilder<(ins "Value":$basePtr, CArg<"IntegerAttr", "{}">:$memory_access, CArg<"IntegerAttr", "{}">:$alignment)> ]; @@ -232,7 +232,7 @@ def SPV_StoreOp : SPV_Op<"Store", []> { 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 index 0bea875..e7a9f44 100644 --- a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVNonUniformOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVNonUniformOps.td @@ -208,7 +208,7 @@ def SPV_GroupNonUniformElectOp : SPV_Op<"GroupNonUniformElect", []> { 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 index 25341e7..c487a97 100644 --- a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVStructureOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVStructureOps.td @@ -60,7 +60,7 @@ def SPV_AddressOfOp : SPV_Op<"mlir.addressof", [InFunctionScope, NoSideEffect]> 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 @@ def SPV_EntryPointOp : SPV_Op<"EntryPoint", [InModuleScope]> { let autogenSerialization = 0; let builders = [ - OpBuilderDAG<(ins "spirv::ExecutionModel":$executionModel, + OpBuilder<(ins "spirv::ExecutionModel":$executionModel, "spirv::FuncOp":$function, "ArrayRef":$interfaceVars)>]; } @@ -239,7 +239,7 @@ def SPV_ExecutionModeOp : SPV_Op<"ExecutionMode", [InModuleScope]> { let autogenSerialization = 0; let builders = [ - OpBuilderDAG<(ins "spirv::FuncOp":$function, + OpBuilder<(ins "spirv::FuncOp":$function, "spirv::ExecutionMode":$executionMode, "ArrayRef":$params)>]; } @@ -292,7 +292,7 @@ def SPV_FuncOp : SPV_Op<"func", [ 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 @@ def SPV_GlobalVariableOp : SPV_Op<"globalVariable", [InModuleScope, Symbol]> { 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 @@ def SPV_ModuleOp : SPV_Op<"module", 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 index c651b84..27e219d 100644 --- a/mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td +++ b/mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td @@ -81,7 +81,7 @@ def Shape_BroadcastOp : Shape_Op<"broadcast", [Commutative, NoSideEffect]> { $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 @@ def Shape_ConstSizeOp : Shape_Op<"const_size", [ 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; @@ -184,7 +184,7 @@ def Shape_ShapeEqOp : Shape_Op<"shape_eq", [NoSideEffect, Commutative, // Convenience builder alias for the binary version. 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 = [{ @@ -262,7 +262,7 @@ def Shape_IsBroadcastableOp : Shape_Op<"is_broadcastable", 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 = [{ @@ -330,7 +330,7 @@ def Shape_GetExtentOp : Shape_Op<"get_extent", [NoSideEffect]> { 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 = [{ @@ -429,7 +429,7 @@ def Shape_NumElementsOp : Shape_Op<"num_elements", [NoSideEffect]> { 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)"; @@ -477,7 +477,7 @@ def Shape_ReduceOp : Shape_Op<"reduce", 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); }]; @@ -497,7 +497,7 @@ def Shape_ShapeOfOp : Shape_Op<"shape_of", [NoSideEffect]> { 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; @@ -574,7 +574,7 @@ def Shape_YieldOp : Shape_Op<"yield", let arguments = (ins Variadic:$operands); - let builders = [OpBuilderDAG<(ins), + let builders = [OpBuilder<(ins), [{ build($_builder, $_state, llvm::None); }]> ]; @@ -753,7 +753,7 @@ def Shape_AssumingYieldOp : Shape_Op<"assuming_yield", 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))?"; } @@ -781,7 +781,7 @@ def Shape_CstrBroadcastableOp : Shape_Op<"cstr_broadcastable", 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})); }]>, ]; @@ -920,7 +920,7 @@ def Shape_FunctionLibraryOp : Shape_Op<"function_library", 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 index 24ea8ea..47d2bf1 100644 --- a/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td +++ b/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td @@ -53,7 +53,7 @@ class CastOp traits = []> : 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 @@ class AllocLikeOp]>:$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 @@ def GenericAtomicRMWOp : Std_Op<"generic_atomic_rmw", [ 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 @@ def BranchOp : Std_Op<"br", 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 @@ def CallOp : Std_Op<"call", 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 @@ def CallIndirectOp : Std_Op<"call_indirect", [ 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 @@ def CmpFOp : Std_Op<"cmpf", [NoSideEffect, SameTypeOperands, 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 @@ def CmpIOp : Std_Op<"cmpi", [NoSideEffect, SameTypeOperands, 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 @@ def CondBranchOp : Std_Op<"cond_br", 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 @@ def ConstantOp : Std_Op<"constant", 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 @@ def DimOp : Std_Op<"dim", [NoSideEffect]> { }]; 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 @@ def LoadOp : Std_Op<"load", 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 @@ def MemRefReinterpretCastOp: 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 @@ def MemRefReshapeOp: Std_Op<"memref_reshape", [ ); 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 @@ def RankOp : Std_Op<"rank", [NoSideEffect]> { 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 @@ def ReturnOp : Std_Op<"return", [NoSideEffect, HasParent<"FuncOp">, 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 @@ def SelectOp : Std_Op<"select", [NoSideEffect, 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 @@ def SignExtendIOp : Std_Op<"sexti", [NoSideEffect, 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 @@ def SplatOp : Std_Op<"splat", [NoSideEffect, 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 @@ def StoreOp : Std_Op<"store", 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 @@ def SubViewOp : BaseOpWithOffsetSizesAndStrides< 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 @@ def SubTensorOp : BaseOpWithOffsetSizesAndStrides< 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 @@ def SubTensorInsertOp : BaseOpWithOffsetSizesAndStrides< 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 @@ def TensorLoadOp : Std_Op<"tensor_load", let verifier = ?; let builders = [ - OpBuilderDAG<(ins "Value":$memref), [{ + OpBuilder<(ins "Value":$memref), [{ $_state.addOperands(memref); $_state.addTypes(getTensorTypeFromMemRefType(memref.getType())); }]>]; @@ -3199,7 +3199,7 @@ def TransposeOp : Std_Op<"transpose", [NoSideEffect]>, }]; let builders = [ - OpBuilderDAG<(ins "Value":$in, "AffineMapAttr":$permutation, + OpBuilder<(ins "Value":$in, "AffineMapAttr":$permutation, CArg<"ArrayRef", "{}">:$attrs)>]; let extraClassDeclaration = [{ @@ -3239,7 +3239,7 @@ def TruncateIOp : Std_Op<"trunci", [NoSideEffect, 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 @@ def ZeroExtendIOp : Std_Op<"zexti", [NoSideEffect, 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 index d45f1f6..58c9a5c 100644 --- a/mlir/include/mlir/Dialect/Tensor/IR/TensorOps.td +++ b/mlir/include/mlir/Dialect/Tensor/IR/TensorOps.td @@ -91,7 +91,7 @@ def Tensor_ExtractOp : Tensor_Op<"extract", 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 @@ def Tensor_FromElementsOp : Tensor_Op<"from_elements", [ 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 @@ def Tensor_GenerateOp : Tensor_Op<"generate", 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 @@ def Tensor_YieldOp : Tensor_Op<"yield", 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 index c7c8359..eee33db 100644 --- a/mlir/include/mlir/Dialect/Tosa/IR/TosaOpBase.td +++ b/mlir/include/mlir/Dialect/Tosa/IR/TosaOpBase.td @@ -111,7 +111,7 @@ def Tosa_PadOpQuantizationAttr : StructAttr<"PadOpQuantizationAttr", // 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 @@ def Tosa_ConvOpQuantInfoBuilder : OpBuilderDAG< }]>; // 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 @@ def Tosa_TransConvOpQuantInfoBuilder : OpBuilderDAG< // 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 @@ def Tosa_FCOpQuantInfoBuilder : OpBuilderDAG< // 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 @@ def Tosa_MatMulOpQuantInfoBuilder : OpBuilderDAG< // 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 @@ def Tosa_AvgPool2dOpQuantInfoBuilder : OpBuilderDAG< // 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 @@ def Tosa_UnaryOpQuantInfoBuilder : OpBuilderDAG< // 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 index 83b221f..69fb073 100644 --- a/mlir/include/mlir/Dialect/Vector/VectorOps.td +++ b/mlir/include/mlir/Dialect/Vector/VectorOps.td @@ -199,9 +199,9 @@ def Vector_ContractionOp : ``` }]; 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 @@ def Vector_ShuffleOp : ``` }]; 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 @@ def Vector_ExtractElementOp : }]; 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 @@ def Vector_ExtractOp : ``` }]; 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 @@ def Vector_ExtractSlicesOp : ``` }]; let builders = [ - OpBuilderDAG<(ins "TupleType":$tupleType, "Value":$vector, + OpBuilder<(ins "TupleType":$tupleType, "Value":$vector, "ArrayRef":$sizes, "ArrayRef":$strides)> ]; let extraClassDeclaration = [{ @@ -562,7 +562,7 @@ def Vector_ExtractMapOp : ``` }]; let builders = [ - OpBuilderDAG<(ins "Value":$vector, "ValueRange":$ids, + OpBuilder<(ins "Value":$vector, "ValueRange":$ids, "ArrayRef":$multiplicity, "AffineMap":$map)>]; let extraClassDeclaration = [{ @@ -609,7 +609,7 @@ def Vector_FMAOp : 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 @@ def Vector_InsertElementOp : }]; 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 @@ def Vector_InsertOp : }]; 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 @@ def Vector_InsertMapOp : 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 @@ def Vector_InsertStridedSliceOp : }]; let builders = [ - OpBuilderDAG<(ins "Value":$source, "Value":$dest, + OpBuilder<(ins "Value":$source, "Value":$dest, "ArrayRef":$offsets, "ArrayRef":$strides)> ]; let extraClassDeclaration = [{ @@ -935,7 +935,7 @@ def Vector_OuterProductOp : }]; 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 @@ def Vector_ExtractStridedSliceOp : ``` }]; let builders = [ - OpBuilderDAG<(ins "Value":$source, "ArrayRef":$offsets, + OpBuilder<(ins "Value":$source, "ArrayRef":$offsets, "ArrayRef":$sizes, "ArrayRef":$strides)> ]; let extraClassDeclaration = [{ @@ -1288,16 +1288,16 @@ def Vector_TransferReadOp : 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 @@ def Vector_TransferWriteOp : 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 @@ def Vector_TypeCastOp : /// 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 @@ def Vector_TransposeOp : ``` }]; let builders = [ - OpBuilderDAG<(ins "Value":$vector, "ArrayRef":$transp)> + OpBuilder<(ins "Value":$vector, "ArrayRef":$transp)> ]; let extraClassDeclaration = [{ VectorType getVectorType() { @@ -2318,7 +2318,7 @@ def Vector_MatmulOp : Vector_Op<"matrix_multiply", [NoSideEffect, ``` }]; 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 index 163c487..3e61608 100644 --- a/mlir/include/mlir/IR/BuiltinOps.td +++ b/mlir/include/mlir/IR/BuiltinOps.td @@ -76,7 +76,7 @@ def FuncOp : Builtin_Op<"func", [ 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 @@ def ModuleOp : Builtin_Op<"module", [ 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 index 4001f3e..db38107b 100644 --- a/mlir/include/mlir/IR/OpBase.td +++ b/mlir/include/mlir/IR/OpBase.td @@ -2015,7 +2015,7 @@ def successor; // 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 @@ def successor; // 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 @@ class Op props = []> { // 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 index 458347d..e09e003 100644 --- a/mlir/test/lib/Dialect/Test/TestOps.td +++ b/mlir/test/lib/Dialect/Test/TestOps.td @@ -674,7 +674,7 @@ def OpFuncRef : TEST_Op<"op_funcref"> { 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 @@ -1162,7 +1162,7 @@ def MixedVResultOp3 : TEST_Op<"mixed_variadic_out3", // We will use this op in a nested result pattern, where we cannot deduce the // 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 @@ -1221,7 +1221,7 @@ def LegalOpB : TEST_Op<"legal_op_b">, Results<(outs I32)>; 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); @@ -1265,7 +1265,7 @@ def TestRecursiveRewriteOp : TEST_Op<"recursive_rewrite"> { 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, {}); }]> ]; } @@ -1830,7 +1830,7 @@ def RegionYieldOp : TEST_Op<"region_yield", 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 index 45d16f9..7627a01 100644 --- 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 @@ It has one output. // 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 index ebdaaa4..5115cfe 100644 --- a/mlir/test/mlir-tblgen/op-decl-and-defs.td +++ b/mlir/test/mlir-tblgen/op-decl-and-defs.td @@ -35,8 +35,8 @@ def NS_AOp : NS_Op<"a_op", [IsolatedFromAbove, IsolatedFromAbove]> { 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 }]; @@ -296,7 +296,7 @@ def NS_ResultWithDialectTypeOp : NS_Op<"op_with_dialect_type", []> { 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 index b5fea66..0be7d33 100644 --- a/mlir/test/mlir-tblgen/op-error.td +++ b/mlir/test/mlir-tblgen/op-error.td @@ -12,7 +12,7 @@ def Test_Dialect : Dialect { // ERROR1: error: expected 'ins' def OpInsMissing : Op { let builders = [ - OpBuilderDAG<(outs)> + OpBuilder<(outs)> ]; } #endif @@ -21,7 +21,7 @@ def OpInsMissing : Op { // 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 @@ def OpDefaultValueNotTrailing : Op { // 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 index 0f655f0..9d2d26a 100644 --- a/mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-gen.cpp +++ b/mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-gen.cpp @@ -1886,7 +1886,7 @@ void TCParser::printODS(llvm::raw_ostream &os, StringRef cppOpName, let skipDefaultBuilders = 1; let builders = [ - OpBuilderDAG< + OpBuilder< (ins "ValueRange":$inputs, "ValueRange":$outputs), [{{ $_state.addOperands(inputs); @@ -1902,7 +1902,7 @@ void TCParser::printODS(llvm::raw_ostream &os, StringRef cppOpName, TypeRange(inputs), TypeRange(outputs)/*, TODO: support captures*/); }]>, - OpBuilderDAG< + OpBuilder< (ins "TypeRange":$resultTensorTypes, "ValueRange":$inputs, "ValueRange":$outputs), [{{ @@ -1920,7 +1920,7 @@ void TCParser::printODS(llvm::raw_ostream &os, StringRef cppOpName, TypeRange(inputs), TypeRange(outputs)/*, TODO: support captures*/); }]>, - OpBuilderDAG< + OpBuilder< (ins "TypeRange":$resultTensorTypes, "ValueRange":$operands, CArg<"ArrayRef", "{{}">:$attributes), [{{ @@ -1995,7 +1995,7 @@ void TCParser::printODS(llvm::raw_ostream &os, StringRef cppOpName, 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 index 1dddc57..cea4632 100644 --- 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 @@ def {0} : LinalgStructuredBase_Op<"{1}", !listconcat([ let skipDefaultBuilders = 1; let builders = [ - OpBuilderDAG< + OpBuilder< (ins "ValueRange":$inputs, "ValueRange":$outputs), [{{ $_state.addOperands(inputs); @@ -451,7 +451,7 @@ def {0} : LinalgStructuredBase_Op<"{1}", !listconcat([ TypeRange(inputs), TypeRange(outputs)/*, TODO: support captures*/); }]>, - OpBuilderDAG< + OpBuilder< (ins "TypeRange":$resultTensorTypes, "ValueRange":$inputs, "ValueRange":$outputs), [{{ @@ -469,7 +469,7 @@ def {0} : LinalgStructuredBase_Op<"{1}", !listconcat([ TypeRange(inputs), TypeRange(outputs)/*, TODO: support captures*/); }]>, - OpBuilderDAG< + OpBuilder< (ins "TypeRange":$resultTensorTypes, "ValueRange":$operands, CArg<"ArrayRef", "{{}">:$attributes), [{{