summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDinesh Dwivedi <dinesh.d@samsung.com>2014-06-19 14:11:53 +0000
committerDinesh Dwivedi <dinesh.d@samsung.com>2014-06-19 14:11:53 +0000
commit8bb5fb06612d82ecee463fce5aa6f9fae826cd71 (patch)
tree44782b137ed9b50f4969da8f300a3e74908edbb5
parent955bf016ee1b01884c15de92b631b709a1015707 (diff)
downloadbcm5719-llvm-8bb5fb06612d82ecee463fce5aa6f9fae826cd71.tar.gz
bcm5719-llvm-8bb5fb06612d82ecee463fce5aa6f9fae826cd71.zip
Updated comments as suggested by Rafael. Thanks.
llvm-svn: 211268
-rw-r--r--llvm/lib/Transforms/Scalar/JumpThreading.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/JumpThreading.cpp b/llvm/lib/Transforms/Scalar/JumpThreading.cpp
index e501ff29d03..6e50d3331df 100644
--- a/llvm/lib/Transforms/Scalar/JumpThreading.cpp
+++ b/llvm/lib/Transforms/Scalar/JumpThreading.cpp
@@ -158,7 +158,13 @@ bool JumpThreading::runOnFunction(Function &F) {
TLI = &getAnalysis<TargetLibraryInfo>();
LVI = &getAnalysis<LazyValueInfo>();
- // Remove unreachable blocks from function as they may result in infinite loop.
+ // Remove unreachable blocks from function as they may result in infinite
+ // loop. We do threading if we found something profitable. Jump threading a
+ // branch can create other opportunities. If these opportunities form a cycle
+ // i.e. if any jump treading is undoing previous threading in the path, then
+ // we will loop forever. We take care of this issue by not jump threading for
+ // back edges. This works for normal cases but not for unreachable blocks as
+ // they may have cycle with no back edge.
removeUnreachableBlocks(F);
FindLoopHeaders(F);
OpenPOWER on IntegriCloud