Replace some calls to isa<LandingPadInst> with isEHPad()
authorDavid Majnemer <david.majnemer@gmail.com>
Wed, 19 Aug 2015 19:54:02 +0000 (19:54 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Wed, 19 Aug 2015 19:54:02 +0000 (19:54 +0000)
No functionality change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245487 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/ConstantHoisting.cpp
lib/Transforms/Scalar/IndVarSimplify.cpp
lib/Transforms/Scalar/LoopStrengthReduce.cpp
lib/Transforms/Utils/SimplifyCFG.cpp
tools/bugpoint/CrashDebugger.cpp

index 4288742dd3eb13d32ebcb608c3f52451a72361bb..af3edcf7228fc4e0860ed40244bafff3b95e6fc0 100644 (file)
@@ -223,10 +223,10 @@ Instruction *ConstantHoisting::findMatInsertPt(Instruction *Inst,
   }
 
   // The simple and common case. This also includes constant expressions.
-  if (!isa<PHINode>(Inst) && !isa<LandingPadInst>(Inst))
+  if (!isa<PHINode>(Inst) && !Inst->isEHPad())
     return Inst;
 
-  // We can't insert directly before a phi node or landing pad. Insert before
+  // We can't insert directly before a phi node or an eh pad. Insert before
   // the terminator of the incoming or dominating block.
   assert(Entry != Inst->getParent() && "PHI or landing pad in entry block!");
   if (Idx != ~0U && isa<PHINode>(Inst))
index 66f8aef98d4c160a9259ec89ed0733eff49cbb0f..41aeea50554a1316f0036cd0c7c6a712b1e51da1 100644 (file)
@@ -1885,8 +1885,8 @@ void IndVarSimplify::SinkUnusedInvariants(Loop *L) {
     if (isa<DbgInfoIntrinsic>(I))
       continue;
 
-    // Skip landingpad instructions.
-    if (isa<LandingPadInst>(I))
+    // Skip eh pad instructions.
+    if (I->isEHPad())
       continue;
 
     // Don't sink alloca: we never want to sink static alloca's out of the
index e18d284367f65420365bf61b90e1cfabe9aed46e..4cb1955cafb1fe090bcc7d669f734c71e3ed7221 100644 (file)
@@ -4420,7 +4420,7 @@ LSRInstance::AdjustInsertPositionForExpand(BasicBlock::iterator LowestIP,
     }
   }
 
-  assert(!isa<PHINode>(LowestIP) && !isa<LandingPadInst>(LowestIP)
+  assert(!isa<PHINode>(LowestIP) && !LowestIP->isEHPad()
          && !isa<DbgInfoIntrinsic>(LowestIP) &&
          "Insertion point must be a normal instruction");
 
@@ -4432,7 +4432,7 @@ LSRInstance::AdjustInsertPositionForExpand(BasicBlock::iterator LowestIP,
   while (isa<PHINode>(IP)) ++IP;
 
   // Ignore landingpad instructions.
-  while (isa<LandingPadInst>(IP)) ++IP;
+  while (IP->isEHPad()) ++IP;
 
   // Ignore debug intrinsics.
   while (isa<DbgInfoIntrinsic>(IP)) ++IP;
index 874604da438745486b95f11cecf289219373e551..71455813b50ad505f5acfbed9a60b3e5ba615647 100644 (file)
@@ -1265,7 +1265,7 @@ static bool SinkThenElseCodeToEnd(BranchInst *BI1) {
     // Cannot move control-flow-involving, volatile loads, vaarg, etc.
     if (isa<PHINode>(I1) || isa<PHINode>(I2) ||
         isa<TerminatorInst>(I1) || isa<TerminatorInst>(I2) ||
-        isa<LandingPadInst>(I1) || isa<LandingPadInst>(I2) ||
+        I1->isEHPad() || I2->isEHPad() ||
         isa<AllocaInst>(I1) || isa<AllocaInst>(I2) ||
         I1->mayHaveSideEffects() || I2->mayHaveSideEffects() ||
         I1->mayReadOrWriteMemory() || I2->mayReadOrWriteMemory() ||
index e2aaf6b01fc5daad3c260b34f4e251fb4d3bb2e7..6564ccea4831fe9262cf8100de2a2654a1283ee1 100644 (file)
@@ -470,7 +470,7 @@ bool ReduceCrashingInstructions::TestInsts(std::vector<const Instruction*>
       for (BasicBlock::iterator I = FI->begin(), E = FI->end(); I != E;) {
         Instruction *Inst = I++;
         if (!Instructions.count(Inst) && !isa<TerminatorInst>(Inst) &&
-            !isa<LandingPadInst>(Inst)) {
+            !Inst->isEHPad()) {
           if (!Inst->getType()->isVoidTy())
             Inst->replaceAllUsesWith(UndefValue::get(Inst->getType()));
           Inst->eraseFromParent();