initLoopData();
Function *F = loopHeader->getParent();
- // Do not unswitch if the function is optimized for size.
- if (!F->isDeclaration() && F->hasFnAttr(Attribute::OptimizeForSize))
- return false;
// Check to see if it would be profitable to unswitch current loop.
unsigned Cost = getLoopUnswitchCost(LoopCond);
// Do not do non-trivial unswitch while optimizing for size.
if (Cost && OptimizeForSize)
return false;
+ if (Cost && !F->isDeclaration() && F->hasFnAttr(Attribute::OptimizeForSize))
+ return false;
if (Cost > Threshold) {
// FIXME: this should estimate growth by the amount of code shared by the