From: Jakub Staszak Date: Mon, 27 Jun 2011 21:51:12 +0000 (+0000) Subject: Calculate GetBestDestForJumpOnUndef correctly. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f227b50a8e30598464c244a675d8e857b62a52ac;p=oota-llvm.git Calculate GetBestDestForJumpOnUndef correctly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133946 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/JumpThreading.cpp b/lib/Transforms/Scalar/JumpThreading.cpp index cf18ff040bd..b500d5b4fdf 100644 --- a/lib/Transforms/Scalar/JumpThreading.cpp +++ b/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;