From 08c1ad0c381c10b537200470b73e53c82cfde1b5 Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Tue, 18 Aug 2015 16:44:23 +0000 Subject: [PATCH] use minSize wrapper; NFCI These were missed when other uses were switched over: http://llvm.org/viewvc/llvm-project?view=revision&revision=243994 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245311 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/GlobalMerge.cpp | 3 +-- lib/Target/ARM/ARMSubtarget.cpp | 2 +- lib/Transforms/InstCombine/InstructionCombining.cpp | 4 +--- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/CodeGen/GlobalMerge.cpp b/lib/CodeGen/GlobalMerge.cpp index d8739c4aaac..ee3860df522 100644 --- a/lib/CodeGen/GlobalMerge.cpp +++ b/lib/CodeGen/GlobalMerge.cpp @@ -306,8 +306,7 @@ bool GlobalMerge::doMerge(SmallVectorImpl &Globals, 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]; diff --git a/lib/Target/ARM/ARMSubtarget.cpp b/lib/Target/ARM/ARMSubtarget.cpp index 6c07a2f43a3..50e9e6a7397 100644 --- a/lib/Target/ARM/ARMSubtarget.cpp +++ b/lib/Target/ARM/ARMSubtarget.cpp @@ -286,7 +286,7 @@ bool ARMSubtarget::enableAtomicExpand() const { } 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 { diff --git a/lib/Transforms/InstCombine/InstructionCombining.cpp b/lib/Transforms/InstCombine/InstructionCombining.cpp index d39b49fca86..48e0fd15680 100644 --- a/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/lib/Transforms/InstCombine/InstructionCombining.cpp @@ -2995,8 +2995,6 @@ combineInstructionsOverFunction(Function &F, InstCombineWorklist &Worklist, 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 @@ -3019,7 +3017,7 @@ combineInstructionsOverFunction(Function &F, InstCombineWorklist &Worklist, 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; -- 2.34.1