[Mlir-commits] [mlir] [mlir][LLVM] Add dedicated operations for assume align and separate_storage (PR #113317)

Benjamin Maxwell llvmlistbot at llvm.org
Tue Oct 22 07:27:47 PDT 2024


================
@@ -887,9 +891,29 @@ llvm::CallInst *mlir::LLVM::detail::createIntrinsicCall(
   }
 
   // Map operands and attributes to LLVM values.
-  auto opOperands = intrOp->getOperands().drop_back(numOpBundleOperands);
+  auto opOperands =
+      intrOp->getOperands().drop_back(numVariadicOpBundleOperands);
   auto operands = moduleTranslation.lookupValues(opOperands);
-  SmallVector<llvm::Value *> args(immArgPositions.size() + operands.size());
+
+  // Map operand bundle operands to LLVM operand bundles.
+  DenseSet<unsigned> opBundleOperandPositionsSet;
+  for (auto [positions, tag] :
+       llvm::zip(opBundleOperandPositions, opBundleTags)) {
+    opBundleOperandPositionsSet.insert(positions.begin(), positions.end());
----------------
MacDue wrote:

Just a note that a small vector lookup table is likely going to be more efficient than a hash map.
E.g. something like:
```suggestion
  SmallVector<bool> isOpBundleOperandPosition(immArgPositions.size() + operands.size(), false);
  for (auto [positions, tag] :
       llvm::zip(opBundleOperandPositions, opBundleTags)) {
    for (unsigned pos : positions)
       isOpBundleOperandPosition[pos] = true;
```

https://github.com/llvm/llvm-project/pull/113317


More information about the Mlir-commits mailing list