summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/JumpThreading.cpp
diff options
context:
space:
mode:
authorJakub Staszak <jstaszak@apple.com>2011-06-27 21:51:12 +0000
committerJakub Staszak <jstaszak@apple.com>2011-06-27 21:51:12 +0000
commit423651e46ae650d862c0ecc45f4556015349555a (patch)
tree1ca24a0b49b6d82d9d790de9e4aec1e22c493600 /llvm/lib/Transforms/Scalar/JumpThreading.cpp
parent1a13cd77f184eb34bbf58194bae76342b922a13a (diff)
downloadbcm5719-llvm-423651e46ae650d862c0ecc45f4556015349555a.tar.gz
bcm5719-llvm-423651e46ae650d862c0ecc45f4556015349555a.zip
Calculate GetBestDestForJumpOnUndef correctly.
llvm-svn: 133946
Diffstat (limited to 'llvm/lib/Transforms/Scalar/JumpThreading.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/JumpThreading.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/JumpThreading.cpp b/llvm/lib/Transforms/Scalar/JumpThreading.cpp
index cf18ff040bd..b500d5b4fdf 100644
--- a/llvm/lib/Transforms/Scalar/JumpThreading.cpp
+++ b/llvm/lib/Transforms/Scalar/JumpThreading.cpp
@@ -600,8 +600,10 @@ static unsigned GetBestDestForJumpOnUndef(BasicBlock *BB) {
for (unsigned i = 1, e = BBTerm->getNumSuccessors(); i != e; ++i) {
TestBB = BBTerm->getSuccessor(i);
unsigned NumPreds = std::distance(pred_begin(TestBB), pred_end(TestBB));
- if (NumPreds < MinNumPreds)
+ if (NumPreds < MinNumPreds) {
MinSucc = i;
+ MinNumPreds = NumPreds;
+ }
}
return MinSucc;
OpenPOWER on IntegriCloud