mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-15 22:25:31 +00:00
fix PR5698
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90708 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -718,6 +718,11 @@ bool JumpThreading::ProcessSwitchOnDuplicateCond(BasicBlock *PredBB,
|
||||
if (PredSI->getSuccessor(PredCase) != DestBB &&
|
||||
DestSI->getSuccessor(i) != DestBB)
|
||||
continue;
|
||||
|
||||
// Do not forward this if it already goes to this destination, this would
|
||||
// be an infinite loop.
|
||||
if (PredSI->getSuccessor(PredCase) == DestSucc)
|
||||
continue;
|
||||
|
||||
// Otherwise, we're safe to make the change. Make sure that the edge from
|
||||
// DestSI to DestSucc is not critical and has no PHI nodes.
|
||||
|
Reference in New Issue
Block a user