mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-24 12:36:30 +00:00
Don't unswitch really large loops even if they are mostly filled with empty
blocks. llvm-svn: 28959
This commit is contained in:
parent
e123f47232
commit
1d8a141786
@ -333,6 +333,12 @@ unsigned LoopUnswitch::getLoopUnswitchCost(Loop *L, Value *LIC) {
|
||||
if (IsTrivialUnswitchCondition(L, LIC))
|
||||
return 0;
|
||||
|
||||
// If the loop is really large (over twice our threshold) don't even consider
|
||||
// unswitching it. This will produce a really large loop with lots of empty
|
||||
// blocks.
|
||||
if (L->getBlocks().size() > 2*Threshold)
|
||||
return 2*Threshold;
|
||||
|
||||
unsigned Cost = 0;
|
||||
// FIXME: this is brain dead. It should take into consideration code
|
||||
// shrinkage.
|
||||
|
Loading…
Reference in New Issue
Block a user