mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-03-04 02:18:46 +00:00
[LoopUnroll] Check partial unrolling is enabled before initialization. NFC.
Differential Revision: https://reviews.llvm.org/D23891 llvm-svn: 285330
This commit is contained in:
parent
68d206a9d2
commit
78fd509204
@ -803,8 +803,6 @@ static bool computeUnrollCount(
|
|||||||
// 4rd priority is partial unrolling.
|
// 4rd priority is partial unrolling.
|
||||||
// Try partial unroll only when TripCount could be staticaly calculated.
|
// Try partial unroll only when TripCount could be staticaly calculated.
|
||||||
if (TripCount) {
|
if (TripCount) {
|
||||||
if (UP.Count == 0)
|
|
||||||
UP.Count = TripCount;
|
|
||||||
UP.Partial |= ExplicitUnroll;
|
UP.Partial |= ExplicitUnroll;
|
||||||
if (!UP.Partial) {
|
if (!UP.Partial) {
|
||||||
DEBUG(dbgs() << " will not try to unroll partially because "
|
DEBUG(dbgs() << " will not try to unroll partially because "
|
||||||
@ -812,6 +810,8 @@ static bool computeUnrollCount(
|
|||||||
UP.Count = 0;
|
UP.Count = 0;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (UP.Count == 0)
|
||||||
|
UP.Count = TripCount;
|
||||||
if (UP.PartialThreshold != NoThreshold) {
|
if (UP.PartialThreshold != NoThreshold) {
|
||||||
// Reduce unroll count to be modulo of TripCount for partial unrolling.
|
// Reduce unroll count to be modulo of TripCount for partial unrolling.
|
||||||
UnrolledSize = (uint64_t)(LoopSize - BEInsns) * UP.Count + BEInsns;
|
UnrolledSize = (uint64_t)(LoopSize - BEInsns) * UP.Count + BEInsns;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user