1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

Fix a bug in the loop in JumpThreading::ProcessThreadableEdges() where it could falsely produce a MultipleDestSentinel value if the first predecessor ended with an 'indirectbr'. If that happened, it caused an unnecessary FindMostPopularDest() call.

This wasn't a correctness problem, but it broke the fast path for single-predecessor blocks.

llvm-svn: 121966
This commit is contained in:
Frits van Bommel 2010-12-16 12:16:00 +00:00
parent 22de496ae3
commit 56dc4fc838

View File

@ -984,7 +984,7 @@ FindMostPopularDest(BasicBlock *BB,
}
}
// Okay, now we know the most popular destination. If there is more than
// Okay, now we know the most popular destination. If there is more than one
// destination, we need to determine one. This is arbitrary, but we need
// to make a deterministic decision. Pick the first one that appears in the
// successor list.
@ -1064,7 +1064,7 @@ bool JumpThreading::ProcessThreadableEdges(Value *Cond, BasicBlock *BB,
}
// If we have exactly one destination, remember it for efficiency below.
if (i == 0)
if (PredToDestList.empty())
OnlyDest = DestBB;
else if (OnlyDest != DestBB)
OnlyDest = MultipleDestSentinel;