summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
diff options
context:
space:
mode:
authorMichael Zolotukhin <mzolotukhin@apple.com>2015-06-11 22:17:39 +0000
committerMichael Zolotukhin <mzolotukhin@apple.com>2015-06-11 22:17:39 +0000
commitc4e4f33e290ba21f97a871828ee2d1d39a620058 (patch)
tree8a273816b6ae7c0f5648c5e4df7d688e7afb2a70 /llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
parent3f9960a9692216a45e5c352e6e5ae060ee51e835 (diff)
downloadbcm5719-llvm-c4e4f33e290ba21f97a871828ee2d1d39a620058.tar.gz
bcm5719-llvm-c4e4f33e290ba21f97a871828ee2d1d39a620058.zip
Update stale comment before analyzeLoopUnrollCost. NFC.
llvm-svn: 239565
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp b/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
index 4ccbfc953e0..9e7558d9c45 100644
--- a/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
@@ -455,13 +455,15 @@ struct EstimatedUnrollCost {
///
/// Complete loop unrolling can make some loads constant, and we need to know
/// if that would expose any further optimization opportunities. This routine
-/// estimates this optimization. It assigns computed number of instructions,
-/// that potentially might be optimized away, to
-/// NumberOfOptimizedInstructions, and total number of instructions to
-/// UnrolledLoopSize (not counting blocks that won't be reached, if we were
-/// able to compute the condition).
-/// \returns false if we can't analyze the loop, or if we discovered that
-/// unrolling won't give anything. Otherwise, returns true.
+/// estimates this optimization. It computes cost of unrolled loop
+/// (UnrolledCost) and dynamic cost of the original loop (RolledDynamicCost). By
+/// dynamic cost we mean that we won't count costs of blocks that are known not
+/// to be executed (i.e. if we have a branch in the loop and we know that at the
+/// given iteration its condition would be resolved to true, we won't add up the
+/// cost of the 'false'-block).
+/// \returns Optional value, holding the RolledDynamicCost and UnrolledCost. If
+/// the analysis failed (no benefits expected from the unrolling, or the loop is
+/// too big to analyze), the returned value is None.
Optional<EstimatedUnrollCost>
analyzeLoopUnrollCost(const Loop *L, unsigned TripCount, ScalarEvolution &SE,
const TargetTransformInfo &TTI,
OpenPOWER on IntegriCloud