[Mlir-commits] [mlir] [mlir][LLVM] Add operand bundle support (PR #108933)
Markus Böck
llvmlistbot at llvm.org
Thu Sep 19 07:48:32 PDT 2024
================
@@ -1285,14 +1349,102 @@ static ParseResult parseOptionalCallFuncPtr(
return success();
}
+static ParseResult parseOpBundleArgsAndTags(
+ OpAsmParser &parser,
+ SmallVector<OpAsmParser::UnresolvedOperand> &opBundleOperands,
+ SmallVector<int32_t> &opBundleSizes,
+ SmallVector<std::string> &opBundleTags) {
+ if (succeeded(parser.parseOptionalKeyword("bundlearg"))) {
+ if (parser.parseLParen())
+ return failure();
+
+ int32_t curSize = 0;
+ do {
+ if (parser.parseOptionalLParen())
+ break;
+ if (parser.parseOperandList(opBundleOperands) || parser.parseRParen())
+ return failure();
+ opBundleSizes.push_back(opBundleOperands.size() - curSize);
+ curSize = opBundleOperands.size();
+ } while (succeeded(parser.parseOptionalComma()));
----------------
zero9178 wrote:
Can this be rewritten using `parseCommaSeparatedList`? It has an overload taking delimiters that handles these common cases.
https://github.com/llvm/llvm-project/pull/108933
More information about the Mlir-commits
mailing list