aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2008-04-23 18:17:11 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2008-04-23 18:17:11 +0000
commitcfcd20e7bece78e79e4509abcdc312aa0b1b6e15 (patch)
tree47549b32e58edfa2c4971df3af8ef0fb43dbc746
parent35410a493bb393d0d8d5868feb5ef901aba64575 (diff)
Provide option for enabling-disabling stack realignment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50156 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/X86/X86RegisterInfo.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/Target/X86/X86RegisterInfo.cpp b/lib/Target/X86/X86RegisterInfo.cpp
index 9059a4e65e..f923aef60d 100644
--- a/lib/Target/X86/X86RegisterInfo.cpp
+++ b/lib/Target/X86/X86RegisterInfo.cpp
@@ -29,6 +29,7 @@
#include "llvm/CodeGen/MachineLocation.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
+#include "llvm/Support/CommandLine.h"
#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/Target/TargetFrameInfo.h"
#include "llvm/Target/TargetInstrInfo.h"
@@ -38,6 +39,10 @@
#include "llvm/ADT/STLExtras.h"
using namespace llvm;
+static cl::opt<bool>
+RealignStack("realign-stack", cl::init(true),
+ cl::desc("Realign stack if needed"));
+
X86RegisterInfo::X86RegisterInfo(X86TargetMachine &tm,
const TargetInstrInfo &tii)
: X86GenRegisterInfo(X86::ADJCALLSTACKDOWN, X86::ADJCALLSTACKUP),
@@ -269,8 +274,9 @@ bool X86RegisterInfo::needsStackRealignment(const MachineFunction &MF) const {
// FIXME: Currently we don't support stack realignment for functions with
// variable-sized allocas
- return (MFI->getMaxAlignment() > StackAlign &&
- !MFI->hasVarSizedObjects());
+ return (RealignStack &&
+ (MFI->getMaxAlignment() > StackAlign &&
+ !MFI->hasVarSizedObjects()));
}
bool X86RegisterInfo::hasReservedCallFrame(MachineFunction &MF) const {