diff options
| author | Roman Divacky <rdivacky@FreeBSD.org> | 2009-12-15 18:09:07 +0000 |
|---|---|---|
| committer | Roman Divacky <rdivacky@FreeBSD.org> | 2009-12-15 18:09:07 +0000 |
| commit | 571945e6affd20b19264ec22495da418d0fbdbb4 (patch) | |
| tree | 076117cdf3579003f07cad4cdf0593347ce58150 /lib/Transforms/Scalar/JumpThreading.cpp | |
| parent | 06f9d4012fb8acea3e9861d5722b5965dbb724d9 (diff) | |
Notes
Diffstat (limited to 'lib/Transforms/Scalar/JumpThreading.cpp')
| -rw-r--r-- | lib/Transforms/Scalar/JumpThreading.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/JumpThreading.cpp b/lib/Transforms/Scalar/JumpThreading.cpp index 1b93f3441e413..d58b9c9de012b 100644 --- a/lib/Transforms/Scalar/JumpThreading.cpp +++ b/lib/Transforms/Scalar/JumpThreading.cpp @@ -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. |
