diff options
author | Chris Lattner <sabre@nondot.org> | 2009-01-19 21:20:34 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-01-19 21:20:34 +0000 |
commit | efb15909b9165205ba4a1ad1dcf588acaa515679 (patch) | |
tree | ad65f21b2124cfa1059b64978a94f2ff2b2e5a04 /lib/Transforms | |
parent | 462be70572e34f24d148ce0d718455fc97ed8eaa (diff) | |
download | external_llvm-efb15909b9165205ba4a1ad1dcf588acaa515679.zip external_llvm-efb15909b9165205ba4a1ad1dcf588acaa515679.tar.gz external_llvm-efb15909b9165205ba4a1ad1dcf588acaa515679.tar.bz2 |
Fix PR3353, infinitely jump threading an infinite loop make from switches.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62529 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-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 94d33aa..f96fc20 100644 --- a/lib/Transforms/Scalar/JumpThreading.cpp +++ b/lib/Transforms/Scalar/JumpThreading.cpp @@ -419,6 +419,11 @@ bool JumpThreading::ProcessBranchOnDuplicateCond(BasicBlock *PredBB, /// switches out of repeated 'if' conditions. bool JumpThreading::ProcessSwitchOnDuplicateCond(BasicBlock *PredBB, BasicBlock *DestBB) { + // Can't thread edge to self. + if (PredBB == DestBB) + return false; + + SwitchInst *PredSI = cast<SwitchInst>(PredBB->getTerminator()); SwitchInst *DestSI = cast<SwitchInst>(DestBB->getTerminator()); |