diff options
author | Chris Lattner <sabre@nondot.org> | 2008-12-01 06:52:57 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-12-01 06:52:57 +0000 |
commit | e2dca52d02603269c399774024dd630184239f3d (patch) | |
tree | 686fb51449b2bc877a9608cb7afd3ceb8427a3fc | |
parent | 079de80ee866fa94ca996da459773b6bba6ff325 (diff) | |
download | external_llvm-e2dca52d02603269c399774024dd630184239f3d.zip external_llvm-e2dca52d02603269c399774024dd630184239f3d.tar.gz external_llvm-e2dca52d02603269c399774024dd630184239f3d.tar.bz2 |
switch a couple more calls to use array_pod_sort.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60337 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/JumpThreading.cpp | 3 | ||||
-rw-r--r-- | lib/Transforms/Scalar/LoopUnswitch.cpp | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/JumpThreading.cpp b/lib/Transforms/Scalar/JumpThreading.cpp index 35b73be..0a02351 100644 --- a/lib/Transforms/Scalar/JumpThreading.cpp +++ b/lib/Transforms/Scalar/JumpThreading.cpp @@ -17,6 +17,7 @@ #include "llvm/Pass.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/Statistic.h" +#include "llvm/ADT/STLExtras.h" #include "llvm/Analysis/ConstantFolding.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" #include "llvm/Transforms/Utils/Local.h" @@ -380,7 +381,7 @@ bool JumpThreading::SimplifyPartiallyRedundantLoad(LoadInst *LI) { // Now we know that each predecessor of this block has a value in // AvailablePreds, sort them for efficient access as we're walking the preds. - std::sort(AvailablePreds.begin(), AvailablePreds.end()); + array_pod_sort(AvailablePreds.begin(), AvailablePreds.end()); // Create a PHI node at the start of the block for the PRE'd load value. PHINode *PN = PHINode::Create(LI->getType(), "", LoadBB->begin()); diff --git a/lib/Transforms/Scalar/LoopUnswitch.cpp b/lib/Transforms/Scalar/LoopUnswitch.cpp index 31e8752..2bf194d 100644 --- a/lib/Transforms/Scalar/LoopUnswitch.cpp +++ b/lib/Transforms/Scalar/LoopUnswitch.cpp @@ -41,6 +41,7 @@ #include "llvm/Transforms/Utils/BasicBlockUtils.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/SmallPtrSet.h" +#include "llvm/ADT/STLExtras.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/Debug.h" @@ -834,14 +835,14 @@ void LoopUnswitch::RemoveBlockIfDead(BasicBlock *BB, // Remove phi node entries in successors for this block. TerminatorInst *TI = BB->getTerminator(); - std::vector<BasicBlock*> Succs; + SmallVector<BasicBlock*, 4> Succs; for (unsigned i = 0, e = TI->getNumSuccessors(); i != e; ++i) { Succs.push_back(TI->getSuccessor(i)); TI->getSuccessor(i)->removePredecessor(BB); } // Unique the successors, remove anything with multiple uses. - std::sort(Succs.begin(), Succs.end()); + array_pod_sort(Succs.begin(), Succs.end()); Succs.erase(std::unique(Succs.begin(), Succs.end()), Succs.end()); // Remove the basic block, including all of the instructions contained in it. |