Supporting inline memmove isn't going to be worthwhile. The only way to avoid
[oota-llvm.git] / lib / Target / ARM / ARMBaseRegisterInfo.cpp
index 48e3c524606bcdb787ea8217f220316d18811f16..7c42342229a266bbd40086a59d88d594157ea3d3 100644 (file)
@@ -626,10 +626,13 @@ bool ARMBaseRegisterInfo::hasBasePointer(const MachineFunction &MF) const {
 
 bool ARMBaseRegisterInfo::canRealignStack(const MachineFunction &MF) const {
   const MachineFrameInfo *MFI = MF.getFrameInfo();
+  const ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>();
   // We can't realign the stack if:
   // 1. Dynamic stack realignment is explicitly disabled,
-  // 2. There are VLAs in the function and the base pointer is disabled.
-  return (RealignStack && (!MFI->hasVarSizedObjects() || EnableBasePointer));
+  // 2. This is a Thumb1 function (it's not useful, so we don't bother), or
+  // 3. There are VLAs in the function and the base pointer is disabled.
+  return (RealignStack && !AFI->isThumb1OnlyFunction() &&
+          (!MFI->hasVarSizedObjects() || EnableBasePointer));
 }
 
 bool ARMBaseRegisterInfo::