@@ -253,7 +253,7 @@ static ParseResult parseOneOpBundle(
253253 SmallVector<SmallVector<OpAsmParser::UnresolvedOperand>> &opBundleOperands,
254254 SmallVector<SmallVector<Type>> &opBundleOperandTypes,
255255 SmallVector<std::string> &opBundleTags) {
256- auto currentParserLoc = p.getCurrentLocation ();
256+ SMLoc currentParserLoc = p.getCurrentLocation ();
257257 SmallVector<OpAsmParser::UnresolvedOperand> operands;
258258 SmallVector<Type> types;
259259 std::string tag;
@@ -1189,18 +1189,12 @@ LogicalResult verifyCallOpVarCalleeType(OpTy callOp) {
11891189template <typename OpType>
11901190static LogicalResult verifyOperandBundles (OpType &op) {
11911191 OperandRangeRange opBundleOperands = op.getOpBundleOperands ();
1192- std::optional< ArrayRef<std::string> > opBundleTags = op.getOpBundleTags ();
1192+ ArrayRef<std::string> opBundleTags = op.getOpBundleTags ();
11931193
1194- if (!opBundleTags.has_value ()) {
1195- if (!opBundleOperands.empty ())
1196- return op.emitError (" expected operand bundle tags" );
1197- return success ();
1198- }
1199-
1200- if (opBundleTags->size () != opBundleOperands.size ())
1194+ if (opBundleTags.size () != opBundleOperands.size ())
12011195 return op.emitError (" expected " )
12021196 << opBundleOperands.size ()
1203- << " operand bundle tags, but actually got " << opBundleTags-> size ();
1197+ << " operand bundle tags, but actually got " << opBundleTags. size ();
12041198
12051199 return success ();
12061200}
@@ -1405,12 +1399,9 @@ static ParseResult resolveOpBundleOperands(
14051399 ArrayRef<SmallVector<OpAsmParser::UnresolvedOperand>> opBundleOperands,
14061400 ArrayRef<SmallVector<Type>> opBundleOperandTypes,
14071401 StringAttr opBundleSizesAttrName) {
1408- assert (opBundleOperands.size () == opBundleOperandTypes.size () &&
1409- " operand bundle operand groups and type groups should match" );
1410-
14111402 unsigned opBundleIndex = 0 ;
14121403 for (const auto &[operands, types] :
1413- llvm::zip (opBundleOperands, opBundleOperandTypes)) {
1404+ llvm::zip_equal (opBundleOperands, opBundleOperandTypes)) {
14141405 if (operands.size () != types.size ())
14151406 return parser.emitError (loc, " expected " )
14161407 << operands.size ()
@@ -1422,9 +1413,8 @@ static ParseResult resolveOpBundleOperands(
14221413
14231414 SmallVector<int32_t > opBundleSizes;
14241415 opBundleSizes.reserve (opBundleOperands.size ());
1425- for (const auto &operands : opBundleOperands) {
1416+ for (const auto &operands : opBundleOperands)
14261417 opBundleSizes.push_back (operands.size ());
1427- }
14281418
14291419 state.addAttribute (
14301420 opBundleSizesAttrName,
@@ -1436,10 +1426,8 @@ static ParseResult resolveOpBundleOperands(
14361426// <operation> ::= `llvm.call` (cconv)? (tailcallkind)? (function-id | ssa-use)
14371427// `(` ssa-use-list `)`
14381428// ( `vararg(` var-callee-type `)` )?
1439- // ( `bundlearg(` ssa-use-list-list `)` )?
1440- // ( `bundletags(` str-elements-attr `) )
1429+ // ( `[` op-bundles-list `]` )?
14411430// attribute-dict? `:` (type `,`)? function-type
1442- // (`,` `bundletype(` type-list-list `)`)?
14431431ParseResult CallOp::parse (OpAsmParser &parser, OperationState &result) {
14441432 SymbolRefAttr funcAttr;
14451433 TypeAttr varCalleeType;
@@ -1487,10 +1475,10 @@ ParseResult CallOp::parse(OpAsmParser &parser, OperationState &result) {
14871475 return failure ();
14881476 }
14891477
1490- auto opBundlesLoc = parser.getCurrentLocation ();
1491- if (auto result = parseOpBundles (parser, opBundleOperands,
1492- opBundleOperandTypes, opBundleTags);
1493- result. has_value () && failed (*result))
1478+ SMLoc opBundlesLoc = parser.getCurrentLocation ();
1479+ if (std::optional<ParseResult> result = parseOpBundles (
1480+ parser, opBundleOperands, opBundleOperandTypes, opBundleTags);
1481+ result && failed (*result))
14941482 return failure ();
14951483 if (!opBundleTags.empty ())
14961484 result.getOrAddProperties <CallOp::Properties>().op_bundle_tags =
@@ -1657,10 +1645,8 @@ void InvokeOp::print(OpAsmPrinter &p) {
16571645// `to` bb-id (`[` ssa-use-and-type-list `]`)?
16581646// `unwind` bb-id (`[` ssa-use-and-type-list `]`)?
16591647// ( `vararg(` var-callee-type `)` )?
1660- // ( `bundlearg(` ssa-use-list-list `)` )?
1661- // ( `bundletags(` str-elements-attr `) )
1648+ // ( `[` op-bundles-list `]` )?
16621649// attribute-dict? `:` (type `,`)? function-type
1663- // (`,` `bundletype(` type-list-list `)`)?
16641650ParseResult InvokeOp::parse (OpAsmParser &parser, OperationState &result) {
16651651 SmallVector<OpAsmParser::UnresolvedOperand, 8 > operands;
16661652 SymbolRefAttr funcAttr;
@@ -1708,10 +1694,10 @@ ParseResult InvokeOp::parse(OpAsmParser &parser, OperationState &result) {
17081694 return failure ();
17091695 }
17101696
1711- auto opBundlesLoc = parser.getCurrentLocation ();
1712- if (auto result = parseOpBundles (parser, opBundleOperands,
1713- opBundleOperandTypes, opBundleTags);
1714- result. has_value () && failed (*result))
1697+ SMLoc opBundlesLoc = parser.getCurrentLocation ();
1698+ if (std::optional<ParseResult> result = parseOpBundles (
1699+ parser, opBundleOperands, opBundleOperandTypes, opBundleTags);
1700+ result && failed (*result))
17151701 return failure ();
17161702 if (!opBundleTags.empty ())
17171703 result.getOrAddProperties <InvokeOp::Properties>().op_bundle_tags =
0 commit comments