[PATCH] D105374: [SimplifyCFG] simplifyUnreachable(): erase instructions iff they are guaranteed to transfer execution to unreachable

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 2 13:39:27 PDT 2021


lebedev.ri created this revision.
lebedev.ri added reviewers: spatel, nikic, efriedma, nlopes, jdoerfert.
lebedev.ri added a project: LLVM.
Herald added subscribers: jfb, hiraditya, nemanjai.
lebedev.ri requested review of this revision.

This synces the code with InstCombine's implementation in `InstCombinerImpl::visitUnreachableInst()`,
with one exception that here in SimplifyCFG we are allowed to remove EH instructions.

Effectively, this now allows SimplifyCFG to remove calls (iff they won't throw and will return),
arithmetic/logic operations, etc.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D105374

Files:
  llvm/lib/Analysis/ValueTracking.cpp
  llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
  llvm/lib/Transforms/Utils/SimplifyCFG.cpp
  llvm/test/CodeGen/PowerPC/2007-11-16-landingpad-split.ll
  llvm/test/Transforms/SimplifyCFG/simplifyUnreachable-degenerate-conditional-branch-with-matching-destinations.ll
  llvm/test/Transforms/SimplifyCFG/switch-range-to-icmp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105374.356268.patch
Type: text/x-patch
Size: 9136 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210702/115ccc93/attachment.bin>


More information about the llvm-commits mailing list