mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-29 08:16:51 +00:00
Simplify and reduce indentation using early exits.
No intended functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78888 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -133,11 +133,9 @@ bool LoopUnroll::runOnLoop(Loop *L, LPPassManager &LPM) {
|
|||||||
// completely unroll (subject to the threshold, checked below); otherwise
|
// completely unroll (subject to the threshold, checked below); otherwise
|
||||||
// try to find greatest modulo of the trip count which is still under
|
// try to find greatest modulo of the trip count which is still under
|
||||||
// threshold value.
|
// threshold value.
|
||||||
if (TripCount != 0) {
|
if (TripCount == 0)
|
||||||
Count = TripCount;
|
|
||||||
} else {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
Count = TripCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enforce the threshold.
|
// Enforce the threshold.
|
||||||
@@ -148,7 +146,11 @@ bool LoopUnroll::runOnLoop(Loop *L, LPPassManager &LPM) {
|
|||||||
if (TripCount != 1 && Size > UnrollThreshold) {
|
if (TripCount != 1 && Size > UnrollThreshold) {
|
||||||
DEBUG(errs() << " Too large to fully unroll with count: " << Count
|
DEBUG(errs() << " Too large to fully unroll with count: " << Count
|
||||||
<< " because size: " << Size << ">" << UnrollThreshold << "\n");
|
<< " because size: " << Size << ">" << UnrollThreshold << "\n");
|
||||||
if (UnrollAllowPartial) {
|
if (!UnrollAllowPartial) {
|
||||||
|
DEBUG(errs() << " will not try to unroll partially because "
|
||||||
|
<< "-unroll-allow-partial not given\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
// Reduce unroll count to be modulo of TripCount for partial unrolling
|
// Reduce unroll count to be modulo of TripCount for partial unrolling
|
||||||
Count = UnrollThreshold / LoopSize;
|
Count = UnrollThreshold / LoopSize;
|
||||||
while (Count != 0 && TripCount%Count != 0) {
|
while (Count != 0 && TripCount%Count != 0) {
|
||||||
@@ -157,15 +159,8 @@ bool LoopUnroll::runOnLoop(Loop *L, LPPassManager &LPM) {
|
|||||||
if (Count < 2) {
|
if (Count < 2) {
|
||||||
DEBUG(errs() << " could not unroll partially\n");
|
DEBUG(errs() << " could not unroll partially\n");
|
||||||
return false;
|
return false;
|
||||||
} else {
|
|
||||||
DEBUG(errs() << " partially unrolling with count: "
|
|
||||||
<< Count << "\n");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
DEBUG(errs() << " will not try to unroll partially because "
|
|
||||||
<< "-unroll-allow-partial not given\n");
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
DEBUG(errs() << " partially unrolling with count: " << Count << "\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user