this argument can be an arbitrary value, it doesn't need to be an instruction.
authorChris Lattner <sabre@nondot.org>
Thu, 12 Nov 2009 01:37:43 +0000 (01:37 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 12 Nov 2009 01:37:43 +0000 (01:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86923 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/JumpThreading.cpp

index a380857235b6bee059f5559095d509f5541e429e..e7ca0f4b50fd71f28fc9b8ec83e1b1b2145f9769 100644 (file)
@@ -95,7 +95,7 @@ namespace {
     
     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 @@ FindMostPopularDest(BasicBlock *BB,
   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");