diff options
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp | 34 | ||||
-rw-r--r-- | llvm/lib/Transforms/Scalar/ADCE.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/Transforms/Scalar/BDCE.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/Transforms/Scalar/JumpThreading.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/Transforms/Scalar/SCCP.cpp | 10 | ||||
-rw-r--r-- | llvm/lib/Transforms/Utils/BasicBlockUtils.cpp | 5 | ||||
-rw-r--r-- | llvm/lib/Transforms/Utils/Local.cpp | 5 |
7 files changed, 14 insertions, 51 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp index ee77882e7ca..286a5633024 100644 --- a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp @@ -2653,30 +2653,6 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> { setOrigin(&I, getCleanOrigin()); } - void visitCleanupBlockInst(CleanupBlockInst &I) { - if (!I.getType()->isVoidTy()) { - setShadow(&I, getCleanShadow(&I)); - setOrigin(&I, getCleanOrigin()); - } - } - - void visitCatchBlock(CatchBlockInst &I) { - if (!I.getType()->isVoidTy()) { - setShadow(&I, getCleanShadow(&I)); - setOrigin(&I, getCleanOrigin()); - } - } - - void visitTerminateBlock(TerminateBlockInst &I) { - DEBUG(dbgs() << "TerminateBlock: " << I << "\n"); - // Nothing to do here. - } - - void visitCatchEndBlockInst(CatchEndBlockInst &I) { - DEBUG(dbgs() << "CatchEndBlock: " << I << "\n"); - // Nothing to do here. - } - void visitGetElementPtrInst(GetElementPtrInst &I) { handleShadowOr(I); } @@ -2720,16 +2696,6 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> { // Nothing to do here. } - void visitCleanupReturnInst(CleanupReturnInst &CRI) { - DEBUG(dbgs() << "CleanupReturn: " << CRI << "\n"); - // Nothing to do here. - } - - void visitCatchReturnInst(CatchReturnInst &CRI) { - DEBUG(dbgs() << "CatchReturn: " << CRI << "\n"); - // Nothing to do here. - } - void visitInstruction(Instruction &I) { // Everything else: stop propagating and check for poisoned shadow. if (ClDumpStrictInstructions) diff --git a/llvm/lib/Transforms/Scalar/ADCE.cpp b/llvm/lib/Transforms/Scalar/ADCE.cpp index 0c707c49425..d6fc9164158 100644 --- a/llvm/lib/Transforms/Scalar/ADCE.cpp +++ b/llvm/lib/Transforms/Scalar/ADCE.cpp @@ -58,8 +58,8 @@ bool ADCE::runOnFunction(Function& F) { // Collect the set of "root" instructions that are known live. for (Instruction &I : inst_range(F)) { - if (isa<TerminatorInst>(I) || isa<DbgInfoIntrinsic>(I) || I.isEHBlock() || - I.mayHaveSideEffects()) { + if (isa<TerminatorInst>(I) || isa<DbgInfoIntrinsic>(I) || + isa<LandingPadInst>(I) || I.mayHaveSideEffects()) { Alive.insert(&I); Worklist.push_back(&I); } diff --git a/llvm/lib/Transforms/Scalar/BDCE.cpp b/llvm/lib/Transforms/Scalar/BDCE.cpp index e484069f82a..09c605e7673 100644 --- a/llvm/lib/Transforms/Scalar/BDCE.cpp +++ b/llvm/lib/Transforms/Scalar/BDCE.cpp @@ -77,8 +77,8 @@ INITIALIZE_PASS_END(BDCE, "bdce", "Bit-Tracking Dead Code Elimination", false, false) static bool isAlwaysLive(Instruction *I) { - return isa<TerminatorInst>(I) || isa<DbgInfoIntrinsic>(I) || I->isEHBlock() || - I->mayHaveSideEffects(); + return isa<TerminatorInst>(I) || isa<DbgInfoIntrinsic>(I) || + isa<LandingPadInst>(I) || I->mayHaveSideEffects(); } void BDCE::determineLiveOperandBits(const Instruction *UserI, diff --git a/llvm/lib/Transforms/Scalar/JumpThreading.cpp b/llvm/lib/Transforms/Scalar/JumpThreading.cpp index e845a7f586b..1130d228acb 100644 --- a/llvm/lib/Transforms/Scalar/JumpThreading.cpp +++ b/llvm/lib/Transforms/Scalar/JumpThreading.cpp @@ -669,8 +669,7 @@ bool JumpThreading::ProcessBlock(BasicBlock *BB) { // because now the condition in this block can be threaded through // predecessors of our predecessor block. if (BasicBlock *SinglePred = BB->getSinglePredecessor()) { - const TerminatorInst *TI = SinglePred->getTerminator(); - if (!TI->isExceptional() && TI->getNumSuccessors() == 1 && + if (SinglePred->getTerminator()->getNumSuccessors() == 1 && SinglePred != BB && !hasAddressTakenAndUsed(BB)) { // If SinglePred was a loop header, BB becomes one. if (LoopHeaders.erase(SinglePred)) diff --git a/llvm/lib/Transforms/Scalar/SCCP.cpp b/llvm/lib/Transforms/Scalar/SCCP.cpp index c625b0f3362..4d3a708fa20 100644 --- a/llvm/lib/Transforms/Scalar/SCCP.cpp +++ b/llvm/lib/Transforms/Scalar/SCCP.cpp @@ -539,9 +539,9 @@ void SCCPSolver::getFeasibleSuccessors(TerminatorInst &TI, return; } - // Unwinding instructions successors are always executable. - if (TI.isExceptional()) { - Succs.assign(TI.getNumSuccessors(), true); + if (isa<InvokeInst>(TI)) { + // Invoke instructions successors are always executable. + Succs[0] = Succs[1] = true; return; } @@ -605,8 +605,8 @@ bool SCCPSolver::isEdgeFeasible(BasicBlock *From, BasicBlock *To) { return BI->getSuccessor(CI->isZero()) == To; } - // Unwinding instructions successors are always executable. - if (TI->isExceptional()) + // Invoke instructions successors are always executable. + if (isa<InvokeInst>(TI)) return true; if (SwitchInst *SI = dyn_cast<SwitchInst>(TI)) { diff --git a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp index c761934162d..53471de6154 100644 --- a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp +++ b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp @@ -119,9 +119,8 @@ bool llvm::MergeBlockIntoPredecessor(BasicBlock *BB, DominatorTree *DT, // Don't break self-loops. if (PredBB == BB) return false; - // Don't break unwinding instructions. - if (PredBB->getTerminator()->isExceptional()) - return false; + // Don't break invokes. + if (isa<InvokeInst>(PredBB->getTerminator())) return false; succ_iterator SI(succ_begin(PredBB)), SE(succ_end(PredBB)); BasicBlock *OnlySucc = BB; diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index e1788c9e287..56085579b61 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -283,9 +283,8 @@ bool llvm::isInstructionTriviallyDead(Instruction *I, const TargetLibraryInfo *TLI) { if (!I->use_empty() || isa<TerminatorInst>(I)) return false; - // We don't want the landingpad-like instructions removed by anything this - // general. - if (I->isEHBlock()) + // We don't want the landingpad instruction removed by anything this general. + if (isa<LandingPadInst>(I)) return false; // We don't want debug info removed by anything this general, unless |