Make stack alignment options global for all targets

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50157 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Anton Korobeynikov 2008-04-23 18:18:10 +00:00
parent cfcd20e7be
commit 45709ae09b
4 changed files with 22 additions and 9 deletions

View File

@ -86,6 +86,13 @@ namespace llvm {
/// OptimizeForSize - When this flag is set, the code generator avoids
/// optimizations that increase size.
extern bool OptimizeForSize;
/// StackAlignment - Override default stack alignment for target.
extern unsigned StackAlignment;
/// RealignStack - This flag indicates, whether stack should be automatically
/// realigned, if needed.
extern bool RealignStack;
} // End llvm namespace
#endif

View File

@ -36,6 +36,8 @@ namespace llvm {
CodeModel::Model CMModel;
bool PerformTailCallOpt;
bool OptimizeForSize;
bool RealignStack;
unsigned StackAlignment;
}
namespace {
cl::opt<bool, true> PrintCode("print-machineinstrs",
@ -135,6 +137,18 @@ namespace {
cl::desc("Optimize for size."),
cl::location(OptimizeForSize),
cl::init(false));
cl::opt<bool, true>
EnableRealignStack("realign-stack",
cl::desc("Realign stack if needed"),
cl::location(RealignStack),
cl::init(true));
cl::opt<unsigned, true>
OverrideStackAlignment("stack-alignment",
cl::desc("Override default stack alignment"),
cl::location(StackAlignment),
cl::init(0));
}
//---------------------------------------------------------------------------

View File

@ -29,7 +29,6 @@
#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"
@ -39,10 +38,6 @@
#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),

View File

@ -16,6 +16,7 @@
#include "llvm/Module.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetOptions.h"
using namespace llvm;
cl::opt<X86Subtarget::AsmWriterFlavorTy>
@ -26,10 +27,6 @@ AsmWriterFlavor("x86-asm-syntax", cl::init(X86Subtarget::Unset),
clEnumValN(X86Subtarget::Intel, "intel", " Emit Intel-style assembly"),
clEnumValEnd));
cl::opt<unsigned>
StackAlignment("stack-alignment", cl::init(0),
cl::desc("Override default stack alignment"));
/// True if accessing the GV requires an extra load. For Windows, dllimported
/// symbols are indirect, loading the value at address GV rather then the