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 | 6f34e317e956da45a8015fe89e4b2ce4d7814fc3 (patch) | |
| tree | 9596c9b5e4c1ca7f70992aa831460815e5a80a7f /llvm/lib | |
| parent | 740e98704d13e789b794656e4ad594ff2230dd08 (diff) | |
| download | bcm5719-llvm-6f34e317e956da45a8015fe89e4b2ce4d7814fc3.tar.gz bcm5719-llvm-6f34e317e956da45a8015fe89e4b2ce4d7814fc3.zip | |
Fix PR3353, infinitely jump threading an infinite loop make from switches.
llvm-svn: 62529
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/JumpThreading.cpp | 5 | 
1 files changed, 5 insertions, 0 deletions
| diff --git a/llvm/lib/Transforms/Scalar/JumpThreading.cpp b/llvm/lib/Transforms/Scalar/JumpThreading.cpp index 94d33aa7879..f96fc208ae1 100644 --- a/llvm/lib/Transforms/Scalar/JumpThreading.cpp +++ b/llvm/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()); | 

