mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-13 23:26:25 +00:00
Calculate GetBestDestForJumpOnUndef correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133946 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -600,8 +600,10 @@ static unsigned GetBestDestForJumpOnUndef(BasicBlock *BB) {
|
|||||||
for (unsigned i = 1, e = BBTerm->getNumSuccessors(); i != e; ++i) {
|
for (unsigned i = 1, e = BBTerm->getNumSuccessors(); i != e; ++i) {
|
||||||
TestBB = BBTerm->getSuccessor(i);
|
TestBB = BBTerm->getSuccessor(i);
|
||||||
unsigned NumPreds = std::distance(pred_begin(TestBB), pred_end(TestBB));
|
unsigned NumPreds = std::distance(pred_begin(TestBB), pred_end(TestBB));
|
||||||
if (NumPreds < MinNumPreds)
|
if (NumPreds < MinNumPreds) {
|
||||||
MinSucc = i;
|
MinSucc = i;
|
||||||
|
MinNumPreds = NumPreds;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return MinSucc;
|
return MinSucc;
|
||||||
|
Reference in New Issue
Block a user