[Mlir-commits] [mlir] [Affine] Parallelize loops with MemoryEffects::Free ops. (PR #172388)

Slava Zakharin llvmlistbot at llvm.org
Tue Dec 16 10:22:18 PST 2025


================
@@ -152,6 +171,7 @@ bool mlir::affine::isLoopMemoryParallel(AffineForOp forOp) {
         loadAndStoreOps.push_back(op);
     } else if (!isa<AffineForOp, AffineYieldOp, AffineIfOp>(op) &&
                !hasSingleEffect<MemoryEffects::Allocate>(op) &&
+               !isDeallocationOfLocallyDefined(op, forOp) &&
----------------
vzakhari wrote:

I wonder if it is safe to just check for `!hasSingleEffect<MemoryEffects::Free>(op)` instead. Shouldn't it be always safe to free in parallel regardless of what the freed memory is?

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


More information about the Mlir-commits mailing list