[llvm-commits] [llvm] r92912 - /llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp
Benjamin Kramer
benny.kra at googlemail.com
Thu Jan 7 05:50:08 PST 2010
Author: d0k
Date: Thu Jan 7 07:50:07 2010
New Revision: 92912
URL: http://llvm.org/viewvc/llvm-project?rev=92912&view=rev
Log:
Use a do-while loop instead of while + boolean.
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=92912&r1=92911&r2=92912&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp Thu Jan 7 07:50:07 2010
@@ -124,10 +124,9 @@
FindLoopHeaders(F);
- bool AnotherIteration = true, EverChanged = false;
- while (AnotherIteration) {
- AnotherIteration = false;
- bool Changed = false;
+ bool Changed, EverChanged = false;
+ do {
+ Changed = false;
for (Function::iterator I = F.begin(), E = F.end(); I != E;) {
BasicBlock *BB = I;
// Thread all of the branches we can over this block.
@@ -176,9 +175,8 @@
}
}
}
- AnotherIteration = Changed;
EverChanged |= Changed;
- }
+ } while (Changed);
LoopHeaders.clear();
return EverChanged;
More information about the llvm-commits
mailing list