Move function dependent resetting of a subtarget variable out of the
[oota-llvm.git] / lib / Target / ARM / ARMBaseInstrInfo.cpp
index eec5d14100c2a986e3b58ff96245450b1d4ce657..0288db91dcbf01d9ee0ed3c539899f77b21421c6 100644 (file)
@@ -1887,7 +1887,8 @@ bool llvm::tryFoldSPUpdateIntoPushPop(const ARMSubtarget &Subtarget,
                                       unsigned NumBytes) {
   // This optimisation potentially adds lots of load and store
   // micro-operations, it's only really a great benefit to code-size.
-  if (!Subtarget.isMinSize())
+  if (!MF.getFunction()->getAttributes().hasAttribute(
+          AttributeSet::FunctionIndex, Attribute::MinSize))
     return false;
 
   // If only one register is pushed/popped, LLVM can use an LDR/STR