Clarify what we mean by a dead loop.
authorOwen Anderson <resistor@mac.com>
Tue, 29 Apr 2008 06:34:55 +0000 (06:34 +0000)
committerOwen Anderson <resistor@mac.com>
Tue, 29 Apr 2008 06:34:55 +0000 (06:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50406 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/DeadLoopElimination.cpp

index 3ae59c32f5829178c9f7febef6dfdf6b7bc880e2..fc11cab809da20a14e145a49640f04a30bf81799 100644 (file)
@@ -126,6 +126,10 @@ bool DeadLoopElimination::IsLoopDead(Loop* L) {
   return true;
 }
 
+/// runOnLoop - Remove dead loops, by which we mean loops that do not impact the
+/// observable behavior of the program other than finite running time.  Note 
+/// we do ensure that this never remove a loop that might be infinite, as doing
+/// so could change the halting/non-halting nature of a program.
 bool DeadLoopElimination::runOnLoop(Loop* L, LPPassManager& LPM) {
   // Don't remove loops for which we can't solve the trip count.
   // They could be infinite, in which case we'd be changing program behavior.