[llvm-commits] [llvm] r142780 - /llvm/trunk/lib/Analysis/BranchProbabilityInfo.cpp
Chandler Carruth
chandlerc at gmail.com
Sun Oct 23 15:40:13 PDT 2011
Author: chandlerc
Date: Sun Oct 23 17:40:13 2011
New Revision: 142780
URL: http://llvm.org/viewvc/llvm-project?rev=142780&view=rev
Log:
Tidy up a loop to be more idiomatic for LLVM's codebase, and remove some
extraneous whitespace. Trying to clean-up this pass as much as I can
before I start making functional changes.
Modified:
llvm/trunk/lib/Analysis/BranchProbabilityInfo.cpp
Modified: llvm/trunk/lib/Analysis/BranchProbabilityInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BranchProbabilityInfo.cpp?rev=142780&r1=142779&r2=142780&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/BranchProbabilityInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/BranchProbabilityInfo.cpp Sun Oct 23 17:40:13 2011
@@ -424,34 +424,25 @@
}
bool BranchProbabilityAnalysis::runOnFunction(Function &F) {
-
- for (Function::iterator I = F.begin(), E = F.end(); I != E; ) {
- BasicBlock *BB = I++;
-
- if (calcMetadataWeights(BB))
+ for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I) {
+ if (calcMetadataWeights(I))
continue;
-
- if (calcLoopBranchHeuristics(BB))
+ if (calcLoopBranchHeuristics(I))
continue;
-
- if (calcReturnHeuristics(BB))
+ if (calcReturnHeuristics(I))
continue;
-
- if (calcPointerHeuristics(BB))
+ if (calcPointerHeuristics(I))
continue;
-
- if (calcZeroHeuristics(BB))
+ if (calcZeroHeuristics(I))
continue;
-
- calcFloatingPointHeuristics(BB);
+ calcFloatingPointHeuristics(I);
}
-
return false;
}
void BranchProbabilityInfo::getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<LoopInfo>();
- AU.setPreservesAll();
+ AU.addRequired<LoopInfo>();
+ AU.setPreservesAll();
}
bool BranchProbabilityInfo::runOnFunction(Function &F) {
More information about the llvm-commits
mailing list