[PATCH] D102615: [LoopDeletion] Break backedge if we can prove that the loop is exited on 1st iteration (try 3)

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 17 23:04:13 PDT 2021


mkazantsev added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LoopDeletion.cpp:302
+        if (DT.dominates(Incoming, BB->getTerminator()))
+          FirstIterValue[&PN] =
+              getValueOnFirstIteration(Incoming, FirstIterValue, SQ);
----------------
nikic wrote:
> This acquired a reference to `FirstIterValue[&PN]`, then calls `getValueOnFirstIteration()` which may invalidate it and then writes to it.
Wow, that's fishy! Thanks!


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

https://reviews.llvm.org/D102615



More information about the llvm-commits mailing list