summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils
diff options
context:
space:
mode:
authorFlorian Hahn <florian.hahn@arm.com>2018-03-23 10:38:12 +0000
committerFlorian Hahn <florian.hahn@arm.com>2018-03-23 10:38:12 +0000
commit52436a587e4e9937a908dc221083824e9eed6fe2 (patch)
treef20ee62eee2064ef70d3a8e374445c5d4e3df355 /llvm/lib/Transforms/Utils
parentfbd4df2176a8d2d2f21d1bed9bddcda4f56f17ce (diff)
downloadbcm5719-llvm-52436a587e4e9937a908dc221083824e9eed6fe2.tar.gz
bcm5719-llvm-52436a587e4e9937a908dc221083824e9eed6fe2.zip
[LoopUnroll] Simplify induction variables after peeling too.
Loop peeling also has an impact on the induction variables, so we should benefit from induction variable simplification after peeling too. Reviewers: sanjoy, bogner, mzolotukhin, efriedma Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D43878 llvm-svn: 328301
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r--llvm/lib/Transforms/Utils/LoopUnroll.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUnroll.cpp b/llvm/lib/Transforms/Utils/LoopUnroll.cpp
index 506edf945eb..9fb7d68e5fd 100644
--- a/llvm/lib/Transforms/Utils/LoopUnroll.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUnroll.cpp
@@ -403,8 +403,9 @@ LoopUnrollResult llvm::UnrollLoop(
"Did not expect runtime trip-count unrolling "
"and peeling for the same loop");
+ bool Peeled = false;
if (PeelCount) {
- bool Peeled = peelLoop(L, PeelCount, LI, SE, DT, AC, PreserveLCSSA);
+ Peeled = peelLoop(L, PeelCount, LI, SE, DT, AC, PreserveLCSSA);
// Successful peeling may result in a change in the loop preheader/trip
// counts. If we later unroll the loop, we want these to be updated.
@@ -790,7 +791,7 @@ LoopUnrollResult llvm::UnrollLoop(
}
// Simplify any new induction variables in the partially unrolled loop.
- if (SE && !CompletelyUnroll && Count > 1) {
+ if (SE && !CompletelyUnroll && (Count > 1 || Peeled)) {
SmallVector<WeakTrackingVH, 16> DeadInsts;
simplifyLoopIVs(L, SE, DT, LI, DeadInsts);
OpenPOWER on IntegriCloud