summaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorDinesh Dwivedi <dinesh.d@samsung.com>2014-06-17 14:34:19 +0000
committerDinesh Dwivedi <dinesh.d@samsung.com>2014-06-17 14:34:19 +0000
commit199da600f3afd6804af2077203a2d4086d7242a9 (patch)
treec8ab06ea6cbcd20fd797c90ff36c2e005b1fcf75 /lib/Transforms
parent3b2a2563322161a609fd6672af2d879c6bd65e8d (diff)
downloadllvm-199da600f3afd6804af2077203a2d4086d7242a9.tar.gz
llvm-199da600f3afd6804af2077203a2d4086d7242a9.tar.bz2
llvm-199da600f3afd6804af2077203a2d4086d7242a9.tar.xz
Fixed jump threading going to infinite loop.
This patch add code to remove unreachable blocks from function as they may cause jump threading to stuck in infinite loop. Differential Revision: http://reviews.llvm.org/D3991 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211103 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/JumpThreading.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/JumpThreading.cpp b/lib/Transforms/Scalar/JumpThreading.cpp
index 230a381593..e501ff29d0 100644
--- a/lib/Transforms/Scalar/JumpThreading.cpp
+++ b/lib/Transforms/Scalar/JumpThreading.cpp
@@ -158,6 +158,9 @@ bool JumpThreading::runOnFunction(Function &F) {
TLI = &getAnalysis<TargetLibraryInfo>();
LVI = &getAnalysis<LazyValueInfo>();
+ // Remove unreachable blocks from function as they may result in infinite loop.
+ removeUnreachableBlocks(F);
+
FindLoopHeaders(F);
bool Changed, EverChanged = false;