forked from OSchip/llvm-project
[flang][mlir][NFC] Remove deprecated parser/printer/verifier utilities
These have been replaced by `hasCustomAssemblyFormat` and `hasVerifier` fields and aren't needed anymore. Ops deriving from `fir_IntegralSwitchTerminatorOp` and `region_Op` are not handled in this patch for ease of review. Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D119776
This commit is contained in:
parent
4ef02da094
commit
cc120e36c3
|
@ -135,9 +135,8 @@ def fir_AllocaOp : fir_Op<"alloca", [AttrSizedOperandSegments,
|
|||
|
||||
let results = (outs fir_ReferenceType);
|
||||
|
||||
let parser =
|
||||
"return parseAllocatableOp(wrapAllocaResultType, parser, result);";
|
||||
let printer = "printAllocatableOp(p, (*this));";
|
||||
let hasCustomAssemblyFormat = 1;
|
||||
let hasVerifier = 1;
|
||||
|
||||
let builders = [
|
||||
OpBuilder<(ins "mlir::Type":$inType, "llvm::StringRef":$uniqName,
|
||||
|
@ -166,8 +165,6 @@ def fir_AllocaOp : fir_Op<"alloca", [AttrSizedOperandSegments,
|
|||
CArg<"mlir::ValueRange", "{}">:$shape,
|
||||
CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attributes)>];
|
||||
|
||||
let verifier = "return ::verify(*this);";
|
||||
|
||||
let extraClassDeclaration = [{
|
||||
mlir::Type getAllocatedType();
|
||||
bool hasLenParams() { return !typeparams().empty(); }
|
||||
|
@ -205,9 +202,8 @@ def fir_AllocMemOp : fir_Op<"allocmem",
|
|||
);
|
||||
let results = (outs fir_HeapType);
|
||||
|
||||
let parser =
|
||||
"return parseAllocatableOp(wrapAllocMemResultType, parser, result);";
|
||||
let printer = "printAllocatableOp(p, (*this));";
|
||||
let hasCustomAssemblyFormat = 1;
|
||||
let hasVerifier = 1;
|
||||
|
||||
let builders = [
|
||||
OpBuilder<(ins "mlir::Type":$in_type, "llvm::StringRef":$uniq_name,
|
||||
|
@ -223,8 +219,6 @@ def fir_AllocMemOp : fir_Op<"allocmem",
|
|||
CArg<"mlir::ValueRange", "{}">:$shape,
|
||||
CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attributes)>];
|
||||
|
||||
let verifier = "return ::verify(*this);";
|
||||
|
||||
let extraClassDeclaration = [{
|
||||
mlir::Type getAllocatedType();
|
||||
bool hasLenParams() { return !typeparams().empty(); }
|
||||
|
@ -279,9 +273,7 @@ def fir_LoadOp : fir_OneResultOp<"load"> {
|
|||
|
||||
let builders = [OpBuilder<(ins "mlir::Value":$refVal)>];
|
||||
|
||||
let parser = "return parseLoadOp(parser, result);";
|
||||
|
||||
let printer = "::print(p, *this);";
|
||||
let hasCustomAssemblyFormat = 1;
|
||||
|
||||
let extraClassDeclaration = [{
|
||||
static mlir::ParseResult getElementOf(mlir::Type &ele, mlir::Type ref);
|
||||
|
@ -325,7 +317,7 @@ def fir_CharConvertOp : fir_Op<"char_convert", []> {
|
|||
$from `for` $count `to` $to attr-dict `:` type(operands)
|
||||
}];
|
||||
|
||||
let verifier = "return ::verify(*this);";
|
||||
let hasVerifier = 1;
|
||||
}
|
||||
|
||||
def fir_StoreOp : fir_Op<"store", []> {
|
||||
|
@ -350,11 +342,8 @@ def fir_StoreOp : fir_Op<"store", []> {
|
|||
let arguments = (ins AnyType:$value,
|
||||
Arg<AnyReferenceLike, "", [MemWrite]>:$memref);
|
||||
|
||||
let parser = "return parseStoreOp(parser, result);";
|
||||
|
||||
let printer = "::print(p, *this);";
|
||||
|
||||
let verifier = "return ::verify(*this);";
|
||||
let hasCustomAssemblyFormat = 1;
|
||||
let hasVerifier = 1;
|
||||
|
||||
let extraClassDeclaration = [{
|
||||
static mlir::Type elementType(mlir::Type refType);
|
||||
|
@ -407,7 +396,7 @@ def fir_SaveResultOp : fir_Op<"save_result", [AttrSizedOperandSegments]> {
|
|||
attr-dict `:` type(operands)
|
||||
}];
|
||||
|
||||
let verifier = "return ::verify(*this);";
|
||||
let hasVerifier = 1;
|
||||
}
|
||||
|
||||
def fir_UndefOp : fir_OneResultOp<"undefined", [NoSideEffect]> {
|
||||
|
@ -731,11 +720,8 @@ def fir_SelectCaseOp : fir_SwitchTerminatorOp<"select_case"> {
|
|||
CArg<"llvm::ArrayRef<mlir::ValueRange>", "{}">:$destOperands,
|
||||
CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attributes)>];
|
||||
|
||||
let parser = "return parseSelectCase(parser, result);";
|
||||
|
||||
let printer = "::print(p, *this);";
|
||||
|
||||
let verifier = "return ::verify(*this);";
|
||||
let hasCustomAssemblyFormat = 1;
|
||||
let hasVerifier = 1;
|
||||
|
||||
let extraClassDeclaration = extraSwitchClassDeclaration#[{
|
||||
unsigned compareOffsetSize();
|
||||
|
@ -769,11 +755,8 @@ def fir_SelectTypeOp : fir_SwitchTerminatorOp<"select_type"> {
|
|||
CArg<"llvm::ArrayRef<mlir::ValueRange>", "{}">:$destOperands,
|
||||
CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attributes)>];
|
||||
|
||||
let parser = "return parseSelectType(parser, result);";
|
||||
|
||||
let printer = "::print(p, *this);";
|
||||
|
||||
let verifier = "return ::verify(*this);";
|
||||
let hasCustomAssemblyFormat = 1;
|
||||
let hasVerifier = 1;
|
||||
|
||||
let extraClassDeclaration = extraSwitchClassDeclaration;
|
||||
}
|
||||
|
@ -793,9 +776,8 @@ def fir_UnreachableOp : fir_Op<"unreachable", [Terminator]> {
|
|||
```
|
||||
}];
|
||||
|
||||
let parser = "return mlir::success();";
|
||||
let assemblyFormat = [{ attr-dict }];
|
||||
|
||||
let printer = "";
|
||||
}
|
||||
|
||||
def fir_FirEndOp : fir_Op<"end", [Terminator]> {
|
||||
|
@ -887,7 +869,7 @@ def fir_EmboxOp : fir_Op<"embox", [NoSideEffect, AttrSizedOperandSegments]> {
|
|||
(`map` $accessMap^)? attr-dict `:` functional-type(operands, results)
|
||||
}];
|
||||
|
||||
let verifier = "return ::verify(*this);";
|
||||
let hasVerifier = 1;
|
||||
|
||||
let extraClassDeclaration = [{
|
||||
bool hasLenParams() { return !typeparams().empty(); }
|
||||
|
@ -944,7 +926,7 @@ def fir_ReboxOp : fir_Op<"rebox", [NoSideEffect, AttrSizedOperandSegments]> {
|
|||
$box (`(` $shape^ `)`)? (`[` $slice^ `]`)? attr-dict `:` functional-type(operands, results)
|
||||
}];
|
||||
|
||||
let verifier = "return ::verify(*this);";
|
||||
let hasVerifier = 1;
|
||||
}
|
||||
|
||||
def fir_EmboxCharOp : fir_Op<"emboxchar", [NoSideEffect]> {
|
||||
|
@ -977,7 +959,7 @@ def fir_EmboxCharOp : fir_Op<"emboxchar", [NoSideEffect]> {
|
|||
$memref `,` $len attr-dict `:` functional-type(operands, results)
|
||||
}];
|
||||
|
||||
let verifier = "return ::verify(*this);";
|
||||
let hasVerifier = 1;
|
||||
}
|
||||
|
||||
def fir_EmboxProcOp : fir_Op<"emboxproc", [NoSideEffect]> {
|
||||
|
@ -1009,11 +991,8 @@ def fir_EmboxProcOp : fir_Op<"emboxproc", [NoSideEffect]> {
|
|||
|
||||
let results = (outs fir_BoxProcType);
|
||||
|
||||
let parser = "return parseEmboxProcOp(parser, result);";
|
||||
|
||||
let printer = "::print(p, *this);";
|
||||
|
||||
let verifier = "return ::verify(*this);";
|
||||
let hasCustomAssemblyFormat = 1;
|
||||
let hasVerifier = 1;
|
||||
}
|
||||
|
||||
def fir_UnboxCharOp : fir_SimpleOp<"unboxchar", [NoSideEffect]> {
|
||||
|
@ -1047,7 +1026,7 @@ def fir_UnboxProcOp : fir_SimpleOp<"unboxproc", [NoSideEffect]> {
|
|||
```
|
||||
}];
|
||||
|
||||
let verifier = "return ::verify(*this);";
|
||||
let hasVerifier = 1;
|
||||
|
||||
let arguments = (ins fir_BoxProcType:$boxproc);
|
||||
|
||||
|
@ -1367,7 +1346,7 @@ def fir_ArrayLoadOp : fir_Op<"array_load", [AttrSizedOperandSegments]> {
|
|||
attr-dict `:` functional-type(operands, results)
|
||||
}];
|
||||
|
||||
let verifier = "return ::verify(*this);";
|
||||
let hasVerifier = 1;
|
||||
|
||||
let extraClassDeclaration = [{
|
||||
std::vector<mlir::Value> getExtents();
|
||||
|
@ -1417,7 +1396,7 @@ def fir_ArrayFetchOp : fir_Op<"array_fetch", [AttrSizedOperandSegments,
|
|||
functional-type(operands, results)
|
||||
}];
|
||||
|
||||
let verifier = "return ::verify(*this);";
|
||||
let hasVerifier = 1;
|
||||
}
|
||||
|
||||
def fir_ArrayUpdateOp : fir_Op<"array_update", [AttrSizedOperandSegments,
|
||||
|
@ -1469,7 +1448,7 @@ def fir_ArrayUpdateOp : fir_Op<"array_update", [AttrSizedOperandSegments,
|
|||
`:` functional-type(operands, results)
|
||||
}];
|
||||
|
||||
let verifier = "return ::verify(*this);";
|
||||
let hasVerifier = 1;
|
||||
}
|
||||
|
||||
def fir_ArrayModifyOp : fir_Op<"array_modify", [AttrSizedOperandSegments,
|
||||
|
@ -1530,7 +1509,7 @@ def fir_ArrayModifyOp : fir_Op<"array_modify", [AttrSizedOperandSegments,
|
|||
`:` functional-type(operands, results)
|
||||
}];
|
||||
|
||||
let verifier = "return ::verify(*this);";
|
||||
let hasVerifier = 1;
|
||||
}
|
||||
|
||||
def fir_ArrayAccessOp : fir_Op<"array_access", [AttrSizedOperandSegments,
|
||||
|
@ -1592,7 +1571,7 @@ def fir_ArrayAccessOp : fir_Op<"array_access", [AttrSizedOperandSegments,
|
|||
functional-type(operands, results)
|
||||
}];
|
||||
|
||||
let verifier = "return ::verify(*this);";
|
||||
let hasVerifier = 1;
|
||||
}
|
||||
|
||||
def fir_ArrayAmendOp : fir_Op<"array_amend", [NoSideEffect]> {
|
||||
|
@ -1669,7 +1648,7 @@ def fir_ArrayMergeStoreOp : fir_Op<"array_merge_store",
|
|||
$typeparams^)? attr-dict `:` type(operands)
|
||||
}];
|
||||
|
||||
let verifier = "return ::verify(*this);";
|
||||
let hasVerifier = 1;
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -1718,7 +1697,7 @@ def fir_ArrayCoorOp : fir_Op<"array_coor",
|
|||
$typeparams^)? attr-dict `:` functional-type(operands, results)
|
||||
}];
|
||||
|
||||
let verifier = "return ::verify(*this);";
|
||||
let hasVerifier = 1;
|
||||
}
|
||||
|
||||
def fir_CoordinateOp : fir_Op<"coordinate_of", [NoSideEffect]> {
|
||||
|
@ -1754,9 +1733,8 @@ def fir_CoordinateOp : fir_Op<"coordinate_of", [NoSideEffect]> {
|
|||
|
||||
let results = (outs RefOrLLVMPtr);
|
||||
|
||||
let parser = "return parseCoordinateCustom(parser, result);";
|
||||
let printer = "::print(p, *this);";
|
||||
let verifier = "return ::verify(*this);";
|
||||
let hasCustomAssemblyFormat = 1;
|
||||
let hasVerifier = 1;
|
||||
|
||||
let builders = [
|
||||
OpBuilder<(ins "mlir::Type":$resultType,
|
||||
|
@ -1818,9 +1796,7 @@ def fir_FieldIndexOp : fir_OneResultOp<"field_index", [NoSideEffect]> {
|
|||
Variadic<AnyIntegerType>:$typeparams
|
||||
);
|
||||
|
||||
let parser = "return parseFieldIndexOp(parser, result);";
|
||||
|
||||
let printer = "::print(p, *this);";
|
||||
let hasCustomAssemblyFormat = 1;
|
||||
|
||||
let builders = [OpBuilder<(ins "llvm::StringRef":$fieldName,
|
||||
"mlir::Type":$recTy, CArg<"mlir::ValueRange","{}">:$operands)>];
|
||||
|
@ -1856,7 +1832,7 @@ def fir_ShapeOp : fir_Op<"shape", [NoSideEffect]> {
|
|||
operands attr-dict `:` functional-type(operands, results)
|
||||
}];
|
||||
|
||||
let verifier = "return ::verify(*this);";
|
||||
let hasVerifier = 1;
|
||||
}
|
||||
|
||||
def fir_ShapeShiftOp : fir_Op<"shape_shift", [NoSideEffect]> {
|
||||
|
@ -1886,7 +1862,7 @@ def fir_ShapeShiftOp : fir_Op<"shape_shift", [NoSideEffect]> {
|
|||
operands attr-dict `:` functional-type(operands, results)
|
||||
}];
|
||||
|
||||
let verifier = "return ::verify(*this);";
|
||||
let hasVerifier = 1;
|
||||
|
||||
let extraClassDeclaration = [{
|
||||
// Logically unzip the origins from the extent values.
|
||||
|
@ -1933,7 +1909,7 @@ def fir_ShiftOp : fir_Op<"shift", [NoSideEffect]> {
|
|||
operands attr-dict `:` functional-type(operands, results)
|
||||
}];
|
||||
|
||||
let verifier = "return ::verify(*this);";
|
||||
let hasVerifier = 1;
|
||||
}
|
||||
|
||||
def fir_SliceOp : fir_Op<"slice", [NoSideEffect, AttrSizedOperandSegments]> {
|
||||
|
@ -1991,7 +1967,7 @@ def fir_SliceOp : fir_Op<"slice", [NoSideEffect, AttrSizedOperandSegments]> {
|
|||
CArg<"mlir::ValueRange", "llvm::None">:$substr)>
|
||||
];
|
||||
|
||||
let verifier = "return ::verify(*this);";
|
||||
let hasVerifier = 1;
|
||||
|
||||
let extraClassDeclaration = [{
|
||||
unsigned getOutRank() { return getOutputRank(triples()); }
|
||||
|
@ -2059,7 +2035,7 @@ def fir_InsertOnRangeOp : fir_OneResultOp<"insert_on_range", [NoSideEffect]> {
|
|||
$seq `,` $val custom<CustomRangeSubscript>($coor) attr-dict `:` functional-type(operands, results)
|
||||
}];
|
||||
|
||||
let verifier = "return ::verify(*this);";
|
||||
let hasVerifier = 1;
|
||||
}
|
||||
|
||||
def fir_LenParamIndexOp : fir_OneResultOp<"len_param_index", [NoSideEffect]> {
|
||||
|
@ -2081,9 +2057,7 @@ def fir_LenParamIndexOp : fir_OneResultOp<"len_param_index", [NoSideEffect]> {
|
|||
|
||||
let arguments = (ins StrAttr:$field_id, TypeAttr:$on_type);
|
||||
|
||||
let parser = "return parseLenParamIndexOp(parser, result);";
|
||||
|
||||
let printer = "::print(p, *this);";
|
||||
let hasCustomAssemblyFormat = 1;
|
||||
|
||||
let builders = [OpBuilder<(ins "llvm::StringRef":$fieldName,
|
||||
"mlir::Type":$recTy),
|
||||
|
@ -2120,7 +2094,7 @@ def fir_ResultOp : fir_Op<"result",
|
|||
|
||||
let assemblyFormat = "($results^ `:` type($results))? attr-dict";
|
||||
|
||||
let verifier = "return ::verify(*this);";
|
||||
let hasVerifier = 1;
|
||||
}
|
||||
|
||||
def FirRegionTerminator : SingleBlockImplicitTerminator<"ResultOp">;
|
||||
|
@ -2388,8 +2362,7 @@ def fir_CallOp : fir_Op<"call", [CallOpInterface]> {
|
|||
);
|
||||
let results = (outs Variadic<AnyType>);
|
||||
|
||||
let parser = "return parseCallOp(parser, result);";
|
||||
let printer = "printCallOp(p, *this);";
|
||||
let hasCustomAssemblyFormat = 1;
|
||||
|
||||
let builders = [
|
||||
OpBuilder<(ins "mlir::FuncOp":$callee,
|
||||
|
@ -2452,9 +2425,7 @@ def fir_DispatchOp : fir_Op<"dispatch", []> {
|
|||
|
||||
let results = (outs Variadic<AnyType>);
|
||||
|
||||
let parser = "return parseDispatchOp(parser, result);";
|
||||
|
||||
let printer = "::print(p, *this);";
|
||||
let hasCustomAssemblyFormat = 1;
|
||||
|
||||
let extraClassDeclaration = [{
|
||||
mlir::FunctionType getFunctionType();
|
||||
|
@ -2490,9 +2461,8 @@ def fir_StringLitOp : fir_Op<"string_lit", [NoSideEffect]> {
|
|||
|
||||
let results = (outs fir_CharacterType);
|
||||
|
||||
let parser = "return parseStringLitOp(parser, result);";
|
||||
|
||||
let printer = "::print(p, *this);";
|
||||
let hasCustomAssemblyFormat = 1;
|
||||
let hasVerifier = 1;
|
||||
|
||||
let builders = [
|
||||
OpBuilder<(ins "fir::CharacterType":$inType,
|
||||
|
@ -2508,8 +2478,6 @@ def fir_StringLitOp : fir_Op<"string_lit", [NoSideEffect]> {
|
|||
"llvm::ArrayRef<char32_t>":$xlist,
|
||||
CArg<"llvm::Optional<int64_t>", "{}">:$len)>];
|
||||
|
||||
let verifier = "return ::verify(*this);";
|
||||
|
||||
let extraClassDeclaration = [{
|
||||
static constexpr const char *size() { return "size"; }
|
||||
static constexpr const char *value() { return "value"; }
|
||||
|
@ -2556,11 +2524,8 @@ def fir_ConstcOp : fir_Op<"constc", [NoSideEffect]> {
|
|||
|
||||
let results = (outs fir_ComplexType);
|
||||
|
||||
let parser = "return parseConstcOp(parser, result);";
|
||||
|
||||
let printer = "::print(p, *this);";
|
||||
|
||||
let verifier = "return ::verify(*this);";
|
||||
let hasCustomAssemblyFormat = 1;
|
||||
let hasVerifier = 1;
|
||||
|
||||
let extraClassDeclaration = [{
|
||||
static constexpr llvm::StringRef realAttrName() { return "real"; }
|
||||
|
@ -2599,9 +2564,7 @@ def fir_CmpcOp : fir_Op<"cmpc",
|
|||
|
||||
let results = (outs AnyLogicalLike);
|
||||
|
||||
let parser = "return parseCmpcOp(parser, result);";
|
||||
|
||||
let printer = "printCmpcOp(p, *this);";
|
||||
let hasCustomAssemblyFormat = 1;
|
||||
|
||||
let builders = [OpBuilder<(ins "mlir::arith::CmpFPredicate":$predicate,
|
||||
"mlir::Value":$lhs, "mlir::Value":$rhs), [{
|
||||
|
@ -2668,7 +2631,7 @@ def fir_ConvertOp : fir_OneResultOp<"convert", [NoSideEffect]> {
|
|||
|
||||
let hasFolder = 1;
|
||||
|
||||
let verifier = "return ::verify(*this);";
|
||||
let hasVerifier = 1;
|
||||
|
||||
let extraClassDeclaration = [{
|
||||
static bool isIntegerCompatible(mlir::Type ty);
|
||||
|
@ -2706,13 +2669,10 @@ def fir_GenTypeDescOp : fir_OneResultOp<"gentypedesc", [NoSideEffect]> {
|
|||
|
||||
let arguments = (ins FortranTypeAttr:$in_type);
|
||||
|
||||
let parser = "return parseGenTypeDescOp(parser, result);";
|
||||
|
||||
let printer = "::print(p, *this);";
|
||||
let hasCustomAssemblyFormat = 1;
|
||||
let hasVerifier = 1;
|
||||
|
||||
let builders = [OpBuilder<(ins "mlir::TypeAttr":$inty)>];
|
||||
|
||||
let verifier = "return ::verify(*this);";
|
||||
}
|
||||
|
||||
def fir_NoReassocOp : fir_OneResultOp<"no_reassoc",
|
||||
|
@ -2777,9 +2737,7 @@ def fir_GlobalOp : fir_Op<"global", [IsolatedFromAbove, Symbol]> {
|
|||
|
||||
let regions = (region AtMostRegion<1>:$region);
|
||||
|
||||
let parser = "return parseGlobalOp(parser, result);";
|
||||
|
||||
let printer = "::print(p, *this);";
|
||||
let hasCustomAssemblyFormat = 1;
|
||||
|
||||
let skipDefaultBuilders = 1;
|
||||
let builders = [
|
||||
|
@ -2862,9 +2820,7 @@ def fir_GlobalLenOp : fir_Op<"global_len", []> {
|
|||
|
||||
let arguments = (ins StrAttr:$lenparam, APIntAttr:$intval);
|
||||
|
||||
let parser = "return parseGlobalLenOp(parser, result);";
|
||||
|
||||
let printer = "::print(p, *this);";
|
||||
let hasCustomAssemblyFormat = 1;
|
||||
|
||||
let extraClassDeclaration = [{
|
||||
static constexpr llvm::StringRef lenParamAttrName() { return "lenparam"; }
|
||||
|
@ -2894,11 +2850,8 @@ def fir_DispatchTableOp : fir_Op<"dispatch_table",
|
|||
```
|
||||
}];
|
||||
|
||||
let parser = "return parseDispatchTableOp(parser, result);";
|
||||
|
||||
let printer = "::print(p, *this);";
|
||||
|
||||
let verifier = "return ::verify(*this);";
|
||||
let hasCustomAssemblyFormat = 1;
|
||||
let hasVerifier = 1;
|
||||
|
||||
let regions = (region SizedRegion<1>:$region);
|
||||
|
||||
|
@ -2940,9 +2893,7 @@ def fir_DTEntryOp : fir_Op<"dt_entry", [HasParent<"DispatchTableOp">]> {
|
|||
|
||||
let arguments = (ins StrAttr:$method, SymbolRefAttr:$proc);
|
||||
|
||||
let parser = "return parseDTEntryOp(parser, result);";
|
||||
|
||||
let printer = "::print(p, *this);";
|
||||
let hasCustomAssemblyFormat = 1;
|
||||
|
||||
let extraClassDeclaration = [{
|
||||
static constexpr llvm::StringRef getMethodAttrNameStr() { return "method"; }
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue