[all-commits] [llvm/llvm-project] fc150c: [SimplifyCFG] simplifyUnreachable(): erase instruc...

Roman Lebedev via All-commits all-commits at lists.llvm.org
Sat Jul 3 00:46:31 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fc150cecd7484e47328fc78d4a3d597e2791b0fe
      https://github.com/llvm/llvm-project/commit/fc150cecd7484e47328fc78d4a3d597e2791b0fe
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2021-07-03 (Sat, 03 Jul 2021)

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

  Log Message:
  -----------
  [SimplifyCFG] simplifyUnreachable(): erase instructions iff they are guaranteed to transfer execution to unreachable

This replaces the current ad-hoc implementation,
by syncing the code from 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.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D105374




More information about the All-commits mailing list