From 8ddfc09e7ac778e6a2215e345b0cd5d1c4fa3b8c Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Tue, 16 Aug 2011 20:45:24 +0000 Subject: Use the getFirstInsertionPt() method instead of getFirstNonPHI + an 'isa<>' check for a LandingPadInst. llvm-svn: 137745 --- llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp | 3 +-- llvm/lib/Transforms/InstCombine/InstructionCombining.cpp | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Transforms/InstCombine') diff --git a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp index b987340e13f..7446a51a4db 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp @@ -600,8 +600,7 @@ bool InstCombiner::SimplifyStoreAtEndOfBlock(StoreInst &SI) { // Advance to a place where it is safe to insert the new store and // insert it. - BBI = DestBB->getFirstNonPHI(); - if (isa(BBI)) ++BBI; + BBI = DestBB->getFirstInsertionPt(); StoreInst *NewSI = new StoreInst(MergedVal, SI.getOperand(1), SI.isVolatile(), SI.getAlignment(), diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp index f13733cf05c..47e7dd4c220 100644 --- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp @@ -1435,8 +1435,7 @@ static bool TryToSinkInstruction(Instruction *I, BasicBlock *DestBlock) { return false; } - BasicBlock::iterator InsertPos = DestBlock->getFirstNonPHI(); - if (isa(InsertPos)) ++InsertPos; // Skip landingpad inst. + BasicBlock::iterator InsertPos = DestBlock->getFirstInsertionPt(); I->moveBefore(InsertPos); ++NumSunkInst; return true; -- cgit v1.2.3