[Mlir-commits] [mlir] [mlir][affine] Fix crash when rolling back vectorization of reduction loops (PR #226912)
Federico Bruzzone
llvmlistbot at llvm.org
Mon Sep 28 07:48:01 PDT 2026
=?utf-8?q?Mattéo?= Rizza Murgier,=?utf-8?q?Mattéo?= Rizza Murgier
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/226912 at github.com>
================
@@ -891,6 +891,15 @@ static void eraseLoopNest(AffineForOp forOp) {
forOp.erase();
}
+/// Recursively erases the users of the results of 'op'.
+static void eraseUsers(Operation *op) {
+ while (!op->use_empty()) {
+ Operation *user = *op->user_begin();
+ eraseUsers(user);
+ user->erase();
+ }
----------------
FedericoBruzzone wrote:
Thank you, makes sense to me. FWIW, `eliminateTriviallyDeadOps` already handles cascading dead-op chains without recursion:
https://github.com/llvm/llvm-project/blob/6282d7def18fa4f9ccb7158baa70c273d7168387/mlir/lib/Transforms/Utils/RegionUtils.cpp#L513-L514
Not a drop-in here (needs side-effect-free ops + a region), but worth to take a look.
https://github.com/llvm/llvm-project/pull/226912
More information about the Mlir-commits
mailing list