mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-22 03:39:03 +00:00
LoopUnrollPass: Use variable "Threshold" instead of "CurrentThreshold" when
reducing unroll count, otherwise the reduced unroll count is not taking the "OptimizeForSize" attribute into account. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154007 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a95b4ebf3c
commit
00b73a5e44
@ -197,13 +197,13 @@ bool LoopUnroll::runOnLoop(Loop *L, LPPassManager &LPM) {
|
|||||||
}
|
}
|
||||||
if (TripCount) {
|
if (TripCount) {
|
||||||
// Reduce unroll count to be modulo of TripCount for partial unrolling
|
// Reduce unroll count to be modulo of TripCount for partial unrolling
|
||||||
Count = CurrentThreshold / LoopSize;
|
Count = Threshold / LoopSize;
|
||||||
while (Count != 0 && TripCount%Count != 0)
|
while (Count != 0 && TripCount%Count != 0)
|
||||||
Count--;
|
Count--;
|
||||||
}
|
}
|
||||||
else if (UnrollRuntime) {
|
else if (UnrollRuntime) {
|
||||||
// Reduce unroll count to be a lower power-of-two value
|
// Reduce unroll count to be a lower power-of-two value
|
||||||
while (Count != 0 && Size > CurrentThreshold) {
|
while (Count != 0 && Size > Threshold) {
|
||||||
Count >>= 1;
|
Count >>= 1;
|
||||||
Size = LoopSize*Count;
|
Size = LoopSize*Count;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user