[llvm-commits] [llvm] r60337 - in /llvm/trunk/lib/Transforms/Scalar: JumpThreading.cpp LoopUnswitch.cpp

Chris Lattner sabre at nondot.org
Sun Nov 30 22:52:58 PST 2008


Author: lattner
Date: Mon Dec  1 00:52:57 2008
New Revision: 60337

URL: http://llvm.org/viewvc/llvm-project?rev=60337&view=rev
Log:
switch a couple more calls to use array_pod_sort.

Modified:
    llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp
    llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp?rev=60337&r1=60336&r2=60337&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp Mon Dec  1 00:52:57 2008
@@ -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 @@
   
   // 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());

Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp?rev=60337&r1=60336&r2=60337&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp Mon Dec  1 00:52:57 2008
@@ -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 @@
   
   // 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.





More information about the llvm-commits mailing list