From: David Majnemer Date: Wed, 19 Aug 2015 19:54:02 +0000 (+0000) Subject: Replace some calls to isa with isEHPad() X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=42bf5e9e58d4c539e2a8f7363bdc7134f1b343c5;p=oota-llvm.git Replace some calls to isa with isEHPad() No functionality change is intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245487 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/ConstantHoisting.cpp b/lib/Transforms/Scalar/ConstantHoisting.cpp index 4288742dd3e..af3edcf7228 100644 --- a/lib/Transforms/Scalar/ConstantHoisting.cpp +++ b/lib/Transforms/Scalar/ConstantHoisting.cpp @@ -223,10 +223,10 @@ Instruction *ConstantHoisting::findMatInsertPt(Instruction *Inst, } // The simple and common case. This also includes constant expressions. - if (!isa(Inst) && !isa(Inst)) + if (!isa(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(Inst)) diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp index 66f8aef98d4..41aeea50554 100644 --- a/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -1885,8 +1885,8 @@ void IndVarSimplify::SinkUnusedInvariants(Loop *L) { if (isa(I)) continue; - // Skip landingpad instructions. - if (isa(I)) + // Skip eh pad instructions. + if (I->isEHPad()) continue; // Don't sink alloca: we never want to sink static alloca's out of the diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index e18d284367f..4cb1955cafb 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -4420,7 +4420,7 @@ LSRInstance::AdjustInsertPositionForExpand(BasicBlock::iterator LowestIP, } } - assert(!isa(LowestIP) && !isa(LowestIP) + assert(!isa(LowestIP) && !LowestIP->isEHPad() && !isa(LowestIP) && "Insertion point must be a normal instruction"); @@ -4432,7 +4432,7 @@ LSRInstance::AdjustInsertPositionForExpand(BasicBlock::iterator LowestIP, while (isa(IP)) ++IP; // Ignore landingpad instructions. - while (isa(IP)) ++IP; + while (IP->isEHPad()) ++IP; // Ignore debug intrinsics. while (isa(IP)) ++IP; diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp index 874604da438..71455813b50 100644 --- a/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/lib/Transforms/Utils/SimplifyCFG.cpp @@ -1265,7 +1265,7 @@ static bool SinkThenElseCodeToEnd(BranchInst *BI1) { // Cannot move control-flow-involving, volatile loads, vaarg, etc. if (isa(I1) || isa(I2) || isa(I1) || isa(I2) || - isa(I1) || isa(I2) || + I1->isEHPad() || I2->isEHPad() || isa(I1) || isa(I2) || I1->mayHaveSideEffects() || I2->mayHaveSideEffects() || I1->mayReadOrWriteMemory() || I2->mayReadOrWriteMemory() || diff --git a/tools/bugpoint/CrashDebugger.cpp b/tools/bugpoint/CrashDebugger.cpp index e2aaf6b01fc..6564ccea483 100644 --- a/tools/bugpoint/CrashDebugger.cpp +++ b/tools/bugpoint/CrashDebugger.cpp @@ -470,7 +470,7 @@ bool ReduceCrashingInstructions::TestInsts(std::vector for (BasicBlock::iterator I = FI->begin(), E = FI->end(); I != E;) { Instruction *Inst = I++; if (!Instructions.count(Inst) && !isa(Inst) && - !isa(Inst)) { + !Inst->isEHPad()) { if (!Inst->getType()->isVoidTy()) Inst->replaceAllUsesWith(UndefValue::get(Inst->getType())); Inst->eraseFromParent();