[PATCH] D84320: [LoopSimplifyCFG] Delete landing pads in dead exit blocks

Yevgeny Rouban via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 24 09:35:01 PDT 2020


yrouban marked an inline comment as done.
yrouban added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LoopSimplifyCFG.cpp:370
+      // Eliminate all Phis and LandingPads from dead exits.
+      SmallVector<Instruction *, 4> DeadInstructions;
       for (auto &PN : BB->phis())
----------------
mkazantsev wrote:
> Why do we only delete phis and landingpad? If this block is proved dead, we can remove all its instructions and insert `unreachable` instead of its terminator.
I think we do minimal changes for the sake of validity.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84320





More information about the llvm-commits mailing list