summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2017-09-27 21:45:19 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2017-09-27 21:45:19 +0000
commit3567d3d2ecad91a135de45841f130a480d722006 (patch)
tree243e3d744de32c438cc353b50157f4e5bac4d4d2
parent283f56ac03cfa4168cdd45045539e28e8d9fc92e (diff)
downloadbcm5719-llvm-3567d3d2ecad91a135de45841f130a480d722006.tar.gz
bcm5719-llvm-3567d3d2ecad91a135de45841f130a480d722006.zip
Rename LoopUnrollStatus to LoopUnrollResult; NFC
A "Result" suffix is more appropriate here llvm-svn: 314350
-rw-r--r--llvm/include/llvm/Transforms/Utils/UnrollLoop.h4
-rw-r--r--llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp6
-rw-r--r--llvm/lib/Transforms/Utils/LoopUnroll.cpp22
3 files changed, 16 insertions, 16 deletions
diff --git a/llvm/include/llvm/Transforms/Utils/UnrollLoop.h b/llvm/include/llvm/Transforms/Utils/UnrollLoop.h
index 1f7af92edc6..5893726710d 100644
--- a/llvm/include/llvm/Transforms/Utils/UnrollLoop.h
+++ b/llvm/include/llvm/Transforms/Utils/UnrollLoop.h
@@ -40,7 +40,7 @@ const Loop* addClonedBlockToLoopInfo(BasicBlock *OriginalBB,
NewLoopsMap &NewLoops);
/// Represents the result of a \c UnrollLoop invocation.
-enum class LoopUnrollStatus {
+enum class LoopUnrollResult {
/// The loop was not modified.
Unmodified,
@@ -54,7 +54,7 @@ enum class LoopUnrollStatus {
FullyUnrolled
};
-LoopUnrollStatus UnrollLoop(Loop *L, unsigned Count, unsigned TripCount,
+LoopUnrollResult UnrollLoop(Loop *L, unsigned Count, unsigned TripCount,
bool Force, bool AllowRuntime,
bool AllowExpensiveTripCount, bool PreserveCondBr,
bool PreserveOnlyFirst, unsigned TripMultiple,
diff --git a/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp b/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
index 40fcf97d657..4887967de44 100644
--- a/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
@@ -1045,18 +1045,18 @@ static bool tryToUnrollLoop(
UP.Count = TripCount;
// Unroll the loop.
- LoopUnrollStatus UnrollStatus = UnrollLoop(
+ LoopUnrollResult UnrollStatus = UnrollLoop(
L, UP.Count, TripCount, UP.Force, UP.Runtime, UP.AllowExpensiveTripCount,
UseUpperBound, MaxOrZero, TripMultiple, UP.PeelCount, UP.UnrollRemainder,
LI, &SE, &DT, &AC, &ORE, PreserveLCSSA);
- if (UnrollStatus == LoopUnrollStatus::Unmodified)
+ if (UnrollStatus == LoopUnrollResult::Unmodified)
return false;
// If loop has an unroll count pragma or unrolled by explicitly set count
// mark loop as unrolled to prevent unrolling beyond that requested.
// If the loop was peeled, we already "used up" the profile information
// we had, so we don't want to unroll or peel again.
- if (UnrollStatus != LoopUnrollStatus::FullyUnrolled &&
+ if (UnrollStatus != LoopUnrollResult::FullyUnrolled &&
(IsCountSetExplicitly || UP.PeelCount))
SetLoopAlreadyUnrolled(L);
diff --git a/llvm/lib/Transforms/Utils/LoopUnroll.cpp b/llvm/lib/Transforms/Utils/LoopUnroll.cpp
index 1e645ecce1f..53575963737 100644
--- a/llvm/lib/Transforms/Utils/LoopUnroll.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUnroll.cpp
@@ -291,7 +291,7 @@ static bool isEpilogProfitable(Loop *L) {
///
/// This utility preserves LoopInfo. It will also preserve ScalarEvolution and
/// DominatorTree if they are non-null.
-LoopUnrollStatus llvm::UnrollLoop(
+LoopUnrollResult llvm::UnrollLoop(
Loop *L, unsigned Count, unsigned TripCount, bool Force, bool AllowRuntime,
bool AllowExpensiveTripCount, bool PreserveCondBr, bool PreserveOnlyFirst,
unsigned TripMultiple, unsigned PeelCount, bool UnrollRemainder,
@@ -301,19 +301,19 @@ LoopUnrollStatus llvm::UnrollLoop(
BasicBlock *Preheader = L->getLoopPreheader();
if (!Preheader) {
DEBUG(dbgs() << " Can't unroll; loop preheader-insertion failed.\n");
- return LoopUnrollStatus::Unmodified;
+ return LoopUnrollResult::Unmodified;
}
BasicBlock *LatchBlock = L->getLoopLatch();
if (!LatchBlock) {
DEBUG(dbgs() << " Can't unroll; loop exit-block-insertion failed.\n");
- return LoopUnrollStatus::Unmodified;
+ return LoopUnrollResult::Unmodified;
}
// Loops with indirectbr cannot be cloned.
if (!L->isSafeToClone()) {
DEBUG(dbgs() << " Can't unroll; Loop body cannot be cloned.\n");
- return LoopUnrollStatus::Unmodified;
+ return LoopUnrollResult::Unmodified;
}
// The current loop unroll pass can only unroll loops with a single latch
@@ -327,7 +327,7 @@ LoopUnrollStatus llvm::UnrollLoop(
// The loop-rotate pass can be helpful to avoid this in many cases.
DEBUG(dbgs() <<
" Can't unroll; loop not terminated by a conditional branch.\n");
- return LoopUnrollStatus::Unmodified;
+ return LoopUnrollResult::Unmodified;
}
auto CheckSuccessors = [&](unsigned S1, unsigned S2) {
@@ -337,14 +337,14 @@ LoopUnrollStatus llvm::UnrollLoop(
if (!CheckSuccessors(0, 1) && !CheckSuccessors(1, 0)) {
DEBUG(dbgs() << "Can't unroll; only loops with one conditional latch"
" exiting the loop can be unrolled\n");
- return LoopUnrollStatus::Unmodified;
+ return LoopUnrollResult::Unmodified;
}
if (Header->hasAddressTaken()) {
// The loop-rotate pass can be helpful to avoid this in many cases.
DEBUG(dbgs() <<
" Won't unroll loop: address of header block is taken.\n");
- return LoopUnrollStatus::Unmodified;
+ return LoopUnrollResult::Unmodified;
}
if (TripCount != 0)
@@ -360,7 +360,7 @@ LoopUnrollStatus llvm::UnrollLoop(
// Don't enter the unroll code if there is nothing to do.
if (TripCount == 0 && Count < 2 && PeelCount == 0) {
DEBUG(dbgs() << "Won't unroll; almost nothing to do\n");
- return LoopUnrollStatus::Unmodified;
+ return LoopUnrollResult::Unmodified;
}
assert(Count > 0);
@@ -436,7 +436,7 @@ LoopUnrollStatus llvm::UnrollLoop(
DEBUG(
dbgs() << "Wont unroll; remainder loop could not be generated"
"when assuming runtime trip count\n");
- return LoopUnrollStatus::Unmodified;
+ return LoopUnrollResult::Unmodified;
}
}
@@ -861,8 +861,8 @@ LoopUnrollStatus llvm::UnrollLoop(
}
}
- return CompletelyUnroll ? LoopUnrollStatus::FullyUnrolled
- : LoopUnrollStatus::PartiallyUnrolled;
+ return CompletelyUnroll ? LoopUnrollResult::FullyUnrolled
+ : LoopUnrollResult::PartiallyUnrolled;
}
/// Given an llvm.loop loop id metadata node, returns the loop hint metadata
OpenPOWER on IntegriCloud