[Mlir-commits] [mlir] [mlir][LLVMIR] Add operand bundle support for llvm.intr.assume (PR #112143)
Tobias Gysi
llvmlistbot at llvm.org
Mon Oct 14 01:26:22 PDT 2024
================
@@ -241,13 +241,18 @@ static void printOneOpBundle(OpAsmPrinter &p, OperandRange operands,
static void printOpBundles(OpAsmPrinter &p, Operation *op,
OperandRangeRange opBundleOperands,
TypeRangeRange opBundleOperandTypes,
- ArrayRef<std::string> opBundleTags) {
+ std::optional<ArrayAttr> opBundleTags) {
+ if (opBundleOperands.empty())
+ return;
+ assert(opBundleTags && "expect operand bundle tags");
+
p << "[";
llvm::interleaveComma(
- llvm::zip(opBundleOperands, opBundleOperandTypes, opBundleTags), p,
+ llvm::zip(opBundleOperands, opBundleOperandTypes, *opBundleTags), p,
[&p](auto bundle) {
+ auto bundleTag = llvm::cast<StringAttr>(std::get<2>(bundle)).getValue();
----------------
gysit wrote:
```suggestion
auto bundleTag = cast<StringAttr>(std::get<2>(bundle)).getValue();
```
ultra nit: I think the namespace is not needed.
https://github.com/llvm/llvm-project/pull/112143
More information about the Mlir-commits
mailing list