mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
Weight loop unrolling counts by nesting depth. Unrolling deeply nested loops tends to cause high
register pressure and thus excess spills, which we don't currently recover from well. This should be re-evaluated in the future if our ability to generate good spills/splits improves. Partial fix for <rdar://problem/7635585>. llvm-svn: 114919
This commit is contained in:
parent
ffbf83e49f
commit
4e6951b92f
@ -158,7 +158,12 @@ bool LoopUnroll::runOnLoop(Loop *L, LPPassManager &LPM) {
|
||||
DEBUG(dbgs() << " Not unrolling loop with inlinable calls.\n");
|
||||
return false;
|
||||
}
|
||||
uint64_t Size = (uint64_t)LoopSize*Count;
|
||||
|
||||
// NOTE: We multiply by the loop depth because unrolling inner loops of
|
||||
// very deep nests tends to result in high register pressure, which we don't
|
||||
// currently recover from very well. When and if the register allocator/
|
||||
// spiller improves to compensate, this should be re-evaluated.
|
||||
uint64_t Size = (uint64_t)LoopSize*Count*L->getLoopDepth();
|
||||
if (TripCount != 1 && Size > CurrentThreshold) {
|
||||
DEBUG(dbgs() << " Too large to fully unroll with count: " << Count
|
||||
<< " because size: " << Size << ">" << CurrentThreshold << "\n");
|
||||
|
Loading…
Reference in New Issue
Block a user