summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorMichael Zolotukhin <mzolotukhin@apple.com>2016-05-18 21:20:12 +0000
committerMichael Zolotukhin <mzolotukhin@apple.com>2016-05-18 21:20:12 +0000
commitd2268a73bc8b505fa5d124e9b95e9cfe50698b14 (patch)
treecdb8f8b0ac64d91adacff191fea2f7325f023f48 /llvm/lib/Transforms
parent6989ebf6619711a6dcb04fd5dc4fabf175d9207a (diff)
downloadbcm5719-llvm-d2268a73bc8b505fa5d124e9b95e9cfe50698b14.tar.gz
bcm5719-llvm-d2268a73bc8b505fa5d124e9b95e9cfe50698b14.zip
[LoopUnrollAnalyzer] Take into account cost of instructions controlling branches, along with their operands.
Previously, we didn't add their and their operands cost, which could've resulted in unrolling loops for no actual benefit. llvm-svn: 269985
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp b/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
index 034cb04dc50..d167c44c19c 100644
--- a/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
@@ -506,6 +506,7 @@ analyzeLoopUnrollCost(const Loop *L, unsigned TripCount, DominatorTree &DT,
BBWorklist.insert(Succ);
else
ExitWorklist.insert({BB, Succ});
+ AddCostRecursively(*TI, Iteration);
}
// If we found no optimization opportunities on the first iteration, we
OpenPOWER on IntegriCloud