[llvm] r245311 - use minSize wrapper; NFCI

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 18 09:44:23 PDT 2015


Author: spatel
Date: Tue Aug 18 11:44:23 2015
New Revision: 245311

URL: http://llvm.org/viewvc/llvm-project?rev=245311&view=rev
Log:
use minSize wrapper; NFCI

These were missed when other uses were switched over:
http://llvm.org/viewvc/llvm-project?view=revision&revision=243994


Modified:
    llvm/trunk/lib/CodeGen/GlobalMerge.cpp
    llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp
    llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp

Modified: llvm/trunk/lib/CodeGen/GlobalMerge.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GlobalMerge.cpp?rev=245311&r1=245310&r2=245311&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/GlobalMerge.cpp (original)
+++ llvm/trunk/lib/CodeGen/GlobalMerge.cpp Tue Aug 18 11:44:23 2015
@@ -306,8 +306,7 @@ bool GlobalMerge::doMerge(SmallVectorImp
         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];

Modified: llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp?rev=245311&r1=245310&r2=245311&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp Tue Aug 18 11:44:23 2015
@@ -286,7 +286,7 @@ bool ARMSubtarget::enableAtomicExpand()
 }
 
 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 {

Modified: llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp?rev=245311&r1=245310&r2=245311&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp Tue Aug 18 11:44:23 2015
@@ -2995,8 +2995,6 @@ combineInstructionsOverFunction(Function
                                 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
     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;




More information about the llvm-commits mailing list