Function *ParentFn = I->getParent()->getParent();
// If we're only optimizing for size, ignore non-minsize functions.
- if (OnlyOptimizeForSize &&
- !ParentFn->hasFnAttribute(Attribute::MinSize))
+ if (OnlyOptimizeForSize && !ParentFn->optForMinSize())
continue;
size_t UGSIdx = GlobalUsesByFunction[ParentFn];
}
bool ARMSubtarget::useStride4VFPs(const MachineFunction &MF) const {
- return isSwift() && !MF.getFunction()->hasFnAttribute(Attribute::MinSize);
+ return isSwift() && !MF.getFunction()->optForMinSize();
}
bool ARMSubtarget::useMovt(const MachineFunction &MF) const {
AliasAnalysis *AA, AssumptionCache &AC,
TargetLibraryInfo &TLI, DominatorTree &DT,
LoopInfo *LI = nullptr) {
- // Minimizing size?
- bool MinimizeSize = F.hasFnAttribute(Attribute::MinSize);
auto &DL = F.getParent()->getDataLayout();
/// Builder - This is an IRBuilder that automatically inserts new
if (prepareICWorklistFromFunction(F, DL, &TLI, Worklist))
Changed = true;
- InstCombiner IC(Worklist, &Builder, MinimizeSize,
+ InstCombiner IC(Worklist, &Builder, F.optForMinSize(),
AA, &AC, &TLI, &DT, DL, LI);
if (IC.run())
Changed = true;