[llvm-commits] [llvm] r86923 - /llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp

Chris Lattner sabre at nondot.org
Wed Nov 11 17:37:43 PST 2009


Author: lattner
Date: Wed Nov 11 19:37:43 2009
New Revision: 86923

URL: http://llvm.org/viewvc/llvm-project?rev=86923&view=rev
Log:
this argument can be an arbitrary value, it doesn't need to be an instruction.

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

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

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp Wed Nov 11 19:37:43 2009
@@ -95,7 +95,7 @@
     
     bool ComputeValueKnownInPredecessors(Value *V, BasicBlock *BB,
                                          PredValueInfo &Result);
-    bool ProcessThreadableEdges(Instruction *CondInst, BasicBlock *BB);
+    bool ProcessThreadableEdges(Value *Cond, BasicBlock *BB);
     
     
     bool ProcessBranchOnDuplicateCond(BasicBlock *PredBB, BasicBlock *DestBB);
@@ -927,15 +927,14 @@
   return MostPopularDest;
 }
 
-bool JumpThreading::ProcessThreadableEdges(Instruction *CondInst,
-                                           BasicBlock *BB) {
+bool JumpThreading::ProcessThreadableEdges(Value *Cond, BasicBlock *BB) {
   // If threading this would thread across a loop header, don't even try to
   // thread the edge.
   if (LoopHeaders.count(BB))
     return false;
   
   SmallVector<std::pair<ConstantInt*, BasicBlock*>, 8> PredValues;
-  if (!ComputeValueKnownInPredecessors(CondInst, BB, PredValues))
+  if (!ComputeValueKnownInPredecessors(Cond, BB, PredValues))
     return false;
   assert(!PredValues.empty() &&
          "ComputeValueKnownInPredecessors returned true with no values");





More information about the llvm-commits mailing list