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

Yevgeny Rouban via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 22 06:36:47 PDT 2020


yrouban created this revision.
yrouban added reviewers: asbirlea, mkazantsev, anna.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

In addition to removing phi nodes this patch removes any landing pad the dead exit block might have.
Without this fix Verifier complains about a new switch instruction jumps to a block with a landing pad:

  Block containing LandingPadInst must be jumped to only by the unwind edge of an invoke.
    %res = landingpad token
            cleanup
  in function test_remove_lpad
  LLVM ERROR: Broken function found, compilation aborted!

Regression tests provided.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D84320

Files:
  llvm/lib/Transforms/Scalar/LoopSimplifyCFG.cpp
  llvm/test/Transforms/LoopSimplifyCFG/handle_dead_exits.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84320.279800.patch
Type: text/x-patch
Size: 3462 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200722/74c5045c/attachment.bin>


More information about the llvm-commits mailing list