summaryrefslogtreecommitdiffstats
path: root/llvm/lib
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
commit9328fbc4c7c241b3d3df19f7fec071a90ca9d19a (patch)
treea329af4f924e3c502857065226233e02bcce24e3 /llvm/lib
parentca150edda61a0995e833196c0708f56de257e0cc (diff)
downloadbcm5719-llvm-9328fbc4c7c241b3d3df19f7fec071a90ca9d19a.tar.gz
bcm5719-llvm-9328fbc4c7c241b3d3df19f7fec071a90ca9d19a.zip
Provide option for enabling-disabling stack realignment
llvm-svn: 50156
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/X86/X86RegisterInfo.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/lib/Target/X86/X86RegisterInfo.cpp b/llvm/lib/Target/X86/X86RegisterInfo.cpp
index 9059a4e65e7..f923aef60d1 100644
--- a/llvm/lib/Target/X86/X86RegisterInfo.cpp
+++ b/llvm/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 {
OpenPOWER on IntegriCloud