use minSize wrapper; NFCI
authorSanjay Patel <spatel@rotateright.com>
Tue, 18 Aug 2015 16:44:23 +0000 (16:44 +0000)
committerSanjay Patel <spatel@rotateright.com>
Tue, 18 Aug 2015 16:44:23 +0000 (16:44 +0000)
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
lib/Target/ARM/ARMSubtarget.cpp
lib/Transforms/InstCombine/InstructionCombining.cpp

index d8739c4aaacf7f4ea3fd40d0b480c48fea5b4785..ee3860df522a13d83dd4be28e817e655de9e5840 100644 (file)
@@ -306,8 +306,7 @@ bool GlobalMerge::doMerge(SmallVectorImpl<GlobalVariable*> &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];
index 6c07a2f43a3bbfb80cf0fcf7caf115d96ccb5144..50e9e6a73977a13f666667f343e2bd5e9659b034 100644 (file)
@@ -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 {
index d39b49fca866a1f7809dc6e20d51883d1595c0a2..48e0fd156808151f91e25444ceace16ee8337155 100644 (file)
@@ -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;