forked from OSchip/llvm-project
Provide option for enabling-disabling stack realignment
llvm-svn: 50156
This commit is contained in:
parent
ca150edda6
commit
9328fbc4c7
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue