[PATCH] D11377: x86: check hasOpaqueSPAdjustment in canRealignStack

JF Bastien jfb at chromium.org
Fri Jul 31 11:28:48 PDT 2015


This revision was automatically updated to reflect the committed changes.
Closed by commit rL243772: x86: check hasOpaqueSPAdjustment in canRealignStack (authored by jfb).

Changed prior to commit:
  http://reviews.llvm.org/D11377?vs=30218&id=31147#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D11377

Files:
  llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp

Index: llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp
===================================================================
--- llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp
+++ llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp
@@ -433,6 +433,10 @@
 // Stack Frame Processing methods
 //===----------------------------------------------------------------------===//
 
+static bool CantUseSP(const MachineFrameInfo *MFI) {
+  return MFI->hasVarSizedObjects() || MFI->hasOpaqueSPAdjustment();
+}
+
 bool X86RegisterInfo::hasBasePointer(const MachineFunction &MF) const {
    const MachineFrameInfo *MFI = MF.getFrameInfo();
 
@@ -445,9 +449,7 @@
    // reference locals while also adjusting the stack pointer.  When we can't
    // use both the SP and the FP, we need a separate base pointer register.
    bool CantUseFP = needsStackRealignment(MF);
-   bool CantUseSP =
-       MFI->hasVarSizedObjects() || MFI->hasOpaqueSPAdjustment();
-   return CantUseFP && CantUseSP;
+   return CantUseFP && CantUseSP(MFI);
 }
 
 bool X86RegisterInfo::canRealignStack(const MachineFunction &MF) const {
@@ -464,7 +466,7 @@
 
   // If a base pointer is necessary.  Check that it isn't too late to reserve
   // it.
-  if (MFI->hasVarSizedObjects())
+  if (CantUseSP(MFI))
     return MRI->canReserveReg(BasePtr);
   return true;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11377.31147.patch
Type: text/x-patch
Size: 1311 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150731/5a9103e8/attachment.bin>


More information about the llvm-commits mailing list