[InstCombine] Improve check for catchswitch BBs (NFC)
authorHeejin Ahn <aheejin@gmail.com>
Tue, 14 Jun 2022 23:41:17 +0000 (16:41 -0700)
committerHeejin Ahn <aheejin@gmail.com>
Wed, 15 Jun 2022 08:06:13 +0000 (01:06 -0700)
Reviewed By: nikic

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

llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp

index 83f7846bbfce53d2f61a782e7fe0c9ebad06c871..90a796a0939ef5fb134eb3dffc820be08943ac4b 100644 (file)
@@ -1125,7 +1125,7 @@ Instruction *InstCombinerImpl::SliceUpIllegalIntegerPHI(PHINode &FirstPhi) {
     // extract the value within that BB because we cannot insert any non-PHI
     // instructions in the BB.
     for (auto *Pred : PN->blocks())
-      if (isa<CatchSwitchInst>(Pred->getFirstNonPHI()))
+      if (Pred->getFirstInsertionPt() == Pred->end())
         return nullptr;
 
     for (User *U : PN->users()) {