[llvm] r314350 - Rename LoopUnrollStatus to LoopUnrollResult; NFC
Sanjoy Das via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 27 14:45:19 PDT 2017
Author: sanjoy
Date: Wed Sep 27 14:45:19 2017
New Revision: 314350
URL: http://llvm.org/viewvc/llvm-project?rev=314350&view=rev
Log:
Rename LoopUnrollStatus to LoopUnrollResult; NFC
A "Result" suffix is more appropriate here
Modified:
llvm/trunk/include/llvm/Transforms/Utils/UnrollLoop.h
llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp
llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp
Modified: llvm/trunk/include/llvm/Transforms/Utils/UnrollLoop.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/UnrollLoop.h?rev=314350&r1=314349&r2=314350&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/Utils/UnrollLoop.h (original)
+++ llvm/trunk/include/llvm/Transforms/Utils/UnrollLoop.h Wed Sep 27 14:45:19 2017
@@ -40,7 +40,7 @@ const Loop* addClonedBlockToLoopInfo(Bas
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,
Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp?rev=314350&r1=314349&r2=314350&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp Wed Sep 27 14:45:19 2017
@@ -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);
Modified: llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp?rev=314350&r1=314349&r2=314350&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp Wed Sep 27 14:45:19 2017
@@ -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
More information about the llvm-commits
mailing list