[Mlir-commits] [mlir] [mlir][bufferization] Simplify helper `potentiallyAliasesMemref` (PR #78690)

Martin Erhart llvmlistbot at llvm.org
Fri Jan 19 03:54:58 PST 2024


================
@@ -314,11 +308,13 @@ struct SplitDeallocWhenNotAliasingAnyOther
 
     SmallVector<Value> remainingMemrefs, remainingConditions;
     SmallVector<SmallVector<Value>> updatedConditions;
-    for (auto [memref, cond] :
-         llvm::zip(deallocOp.getMemrefs(), deallocOp.getConditions())) {
+    for (int64_t i = 0, e = deallocOp.getMemrefs().size(); i < e; ++i) {
+      Value memref = deallocOp.getMemrefs()[i];
+      Value cond = deallocOp.getConditions()[i];
+      SmallVector<Value> otherMemrefs(deallocOp.getMemrefs());
+      otherMemrefs.erase(otherMemrefs.begin() + i);
----------------
maerhart wrote:

Makes sense. It's a bit annoying that MLIR doesn't have the utility to easily test individual patterns :/

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


More information about the Mlir-commits mailing list