[llvm] r211268 - Updated comments as suggested by Rafael. Thanks.
Dinesh Dwivedi
dinesh.d at samsung.com
Thu Jun 19 07:11:53 PDT 2014
Author: dinesh
Date: Thu Jun 19 09:11:53 2014
New Revision: 211268
URL: http://llvm.org/viewvc/llvm-project?rev=211268&view=rev
Log:
Updated comments as suggested by Rafael. Thanks.
Modified:
llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp?rev=211268&r1=211267&r2=211268&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp Thu Jun 19 09:11:53 2014
@@ -158,7 +158,13 @@ bool JumpThreading::runOnFunction(Functi
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);
More information about the llvm-commits
mailing list