[PATCH] D99149: [LoopUnrollAndJam] Change LoopUnrollAndJamPass to LoopNest pass

toshiki maekawa via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 25 07:13:42 PDT 2021


uint256_t added inline comments.


================
Comment at: llvm/include/llvm/Transforms/Scalar/LoopPassManager.h:255
   void markLoopAsDeleted(Loop &L, llvm::StringRef Name) {
-    assert((!LoopNestMode || L.isOutermost()) &&
+    assert((!LoopNestMode || CurrentL == &L) &&
            "L should be a top-level loop in loop-nest mode.");
----------------
Whitney wrote:
> uint256_t wrote:
> > I don't know if this change is ok, but I think CurrentL is always a top-level loop if it's loop nest mode.
> If CurrentL is always a top-level loop if it's loop nest mode, then why do we need to change from `L.isOutermost()` to `CurrentL == &L`?
I found that `markLoopAsDeleted` is sometimes called on loops that are already destroyed (e.g. by `LI->erase(L)`). Then `L.isOutermost()` is invalid since the destructor of `L` is called. (asan detected it)



CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99149/new/

https://reviews.llvm.org/D99149



More information about the llvm-commits mailing list