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

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 22 22:01:58 PDT 2020


mkazantsev 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())
----------------
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.


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