[llvm] r260110 - [JumpThreading] Change a return of ComputeValueKnownInPredecessors()

Haicheng Wu via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 8 09:00:40 PST 2016


Author: haicheng
Date: Mon Feb  8 11:00:39 2016
New Revision: 260110

URL: http://llvm.org/viewvc/llvm-project?rev=260110&view=rev
Log:
[JumpThreading] Change a return of ComputeValueKnownInPredecessors()

Change a return statement of ComputeValueKnownInPredecessors() to be the same as
the rest return statements of the function. Otherwise, it might return true with
an empty Result when the current basic block has no predecessors and trigger the
first assert of JumpThreading::ProcessThreadableEdges().

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=260110&r1=260109&r2=260110&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp Mon Feb  8 11:00:39 2016
@@ -415,7 +415,7 @@ ComputeValueKnownInPredecessors(Value *V
     for (BasicBlock *Pred : predecessors(BB))
       Result.push_back(std::make_pair(KC, Pred));
 
-    return true;
+    return !Result.empty();
   }
 
   // If V is a non-instruction value, or an instruction in a different block,




More information about the llvm-commits mailing list