[Mlir-commits] [mlir] [mlir][LLVM] Add operand bundle support (PR #108933)
Markus Böck
llvmlistbot at llvm.org
Mon Sep 23 09:31:41 PDT 2024
================
@@ -220,6 +220,88 @@ static RetTy parseOptionalLLVMKeyword(OpAsmParser &parser,
return static_cast<RetTy>(index);
}
+//===----------------------------------------------------------------------===//
+// Operand bundle helpers.
+//===----------------------------------------------------------------------===//
+
+static void printOneOpBundle(OpAsmPrinter &p, OperandRange operands,
+ TypeRange operandTypes, StringRef tag) {
+ p.printString(tag);
+ p << "(";
+ p.printOperands(operands);
+ p << " : ";
+ llvm::interleaveComma(operandTypes, p);
+ p << ")";
+}
+
+static void printOpBundles(OpAsmPrinter &p, Operation *op,
+ OperandRangeRange opBundleOperands,
+ TypeRangeRange opBundleOperandTypes,
+ ArrayRef<std::string> opBundleTags) {
+ p << "[";
+ llvm::interleaveComma(
+ llvm::zip(opBundleOperands, opBundleOperandTypes, opBundleTags), p,
+ [&p](auto bundle) {
+ printOneOpBundle(p, std::get<0>(bundle), std::get<1>(bundle),
+ std::get<2>(bundle));
+ });
+ p << "]";
+}
+
+static ParseResult parseOneOpBundle(
+ OpAsmParser &p,
+ SmallVector<SmallVector<OpAsmParser::UnresolvedOperand>> &opBundleOperands,
+ SmallVector<SmallVector<Type>> &opBundleOperandTypes,
+ SmallVector<std::string> &opBundleTags) {
+ auto currentParserLoc = p.getCurrentLocation();
----------------
zero9178 wrote:
```suggestion
SMLoc currentParserLoc = p.getCurrentLocation();
```
expand the auto here
https://github.com/llvm/llvm-project/pull/108933
More information about the Mlir-commits
mailing list