Add a new option to indicate we want the code generator to emit code quickly,not spending tons of time microoptimizing it. This is useful for an -O0style of build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24233 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2005-11-08 02:11:51 +00:00
parent 26b91ebb63
commit ce8eb0c16b
17 changed files with 24 additions and 41 deletions

View File

@ -77,7 +77,8 @@ AlphaTargetMachine::AlphaTargetMachine(const Module &M, IntrinsicLowering *IL,
///
bool AlphaTargetMachine::addPassesToEmitFile(PassManager &PM,
std::ostream &Out,
CodeGenFileType FileType) {
CodeGenFileType FileType,
bool Fast) {
if (FileType != TargetMachine::AssemblyFile) return true;
if (EnableAlphaLSR) {

View File

@ -48,17 +48,11 @@ public:
static unsigned getJITMatchQuality();
/// addPassesToEmitMachineCode - Add passes to the specified pass manager to
/// get machine code emitted. This uses a MachineCodeEmitter object to handle
/// actually outputting the machine code and resolving things like the address
/// of functions. This method should returns true if machine code emission is
/// not supported.
///
virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM,
MachineCodeEmitter &MCE);
virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
CodeGenFileType FileType);
CodeGenFileType FileType, bool Fast);
static unsigned getModuleMatchQuality(const Module &M);
};

View File

@ -1725,7 +1725,7 @@ void CWriter::visitVAArgInst(VAArgInst &I) {
//===----------------------------------------------------------------------===//
bool CTargetMachine::addPassesToEmitFile(PassManager &PM, std::ostream &o,
CodeGenFileType FileType) {
CodeGenFileType FileType, bool Fast) {
if (FileType != TargetMachine::AssemblyFile) return true;
PM.add(createLowerGCPass());

View File

@ -26,7 +26,7 @@ struct CTargetMachine : public TargetMachine {
// This is the only thing that actually does anything here.
virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
CodeGenFileType FileType);
CodeGenFileType FileType, bool Fast);
// This class always works, but shouldn't be the default in most cases.
static unsigned getModuleMatchQuality(const Module &M) { return 1; }

View File

@ -1725,7 +1725,7 @@ void CWriter::visitVAArgInst(VAArgInst &I) {
//===----------------------------------------------------------------------===//
bool CTargetMachine::addPassesToEmitFile(PassManager &PM, std::ostream &o,
CodeGenFileType FileType) {
CodeGenFileType FileType, bool Fast) {
if (FileType != TargetMachine::AssemblyFile) return true;
PM.add(createLowerGCPass());

View File

@ -85,7 +85,8 @@ IA64TargetMachine::IA64TargetMachine(const Module &M, IntrinsicLowering *IL,
// does to emit statically compiled machine code.
bool IA64TargetMachine::addPassesToEmitFile(PassManager &PM,
std::ostream &Out,
CodeGenFileType FileType) {
CodeGenFileType FileType,
bool Fast) {
if (FileType != TargetMachine::AssemblyFile) return true;
// FIXME: Implement efficient support for garbage collection intrinsics.

View File

@ -37,7 +37,7 @@ public:
}
virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
CodeGenFileType FileType);
CodeGenFileType FileType, bool Fast);
static unsigned getModuleMatchQuality(const Module &M);
static unsigned compileTimeMatchQuality(void);

View File

@ -40,7 +40,8 @@ SkeletonTargetMachine::SkeletonTargetMachine(const Module &M,
///
bool SkeletonTargetMachine::addPassesToEmitFile(PassManager &PM,
std::ostream &Out,
CodeGenFileType FileType) {
CodeGenFileType FileType,
bool Fast) {
if (FileType != TargetMachine::AssemblyFile) return true;
// <insert instruction selector passes here>
PM.add(createRegisterAllocator());

View File

@ -44,7 +44,7 @@ namespace llvm {
MachineCodeEmitter &MCE);
virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
CodeGenFileType FileType);
CodeGenFileType FileType, bool Fast);
};
} // end namespace llvm

View File

@ -65,7 +65,8 @@ unsigned SparcV8TargetMachine::getModuleMatchQuality(const Module &M) {
///
bool SparcV8TargetMachine::addPassesToEmitFile(PassManager &PM,
std::ostream &Out,
CodeGenFileType FileType) {
CodeGenFileType FileType,
bool Fast) {
if (FileType != TargetMachine::AssemblyFile) return true;
// FIXME: Implement efficient support for garbage collection intrinsics.

View File

@ -45,17 +45,11 @@ public:
static unsigned getModuleMatchQuality(const Module &M);
static unsigned getJITMatchQuality();
/// addPassesToEmitMachineCode - Add passes to the specified pass manager to
/// get machine code emitted. This uses a MachineCodeEmitter object to handle
/// actually outputting the machine code and resolving things like the address
/// of functions. This method should returns true if machine code emission is
/// not supported.
///
virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM,
MachineCodeEmitter &MCE);
virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
CodeGenFileType FileType);
CodeGenFileType FileType, bool Fast);
};
} // end namespace llvm

View File

@ -65,7 +65,8 @@ unsigned SparcV8TargetMachine::getModuleMatchQuality(const Module &M) {
///
bool SparcV8TargetMachine::addPassesToEmitFile(PassManager &PM,
std::ostream &Out,
CodeGenFileType FileType) {
CodeGenFileType FileType,
bool Fast) {
if (FileType != TargetMachine::AssemblyFile) return true;
// FIXME: Implement efficient support for garbage collection intrinsics.

View File

@ -45,17 +45,11 @@ public:
static unsigned getModuleMatchQuality(const Module &M);
static unsigned getJITMatchQuality();
/// addPassesToEmitMachineCode - Add passes to the specified pass manager to
/// get machine code emitted. This uses a MachineCodeEmitter object to handle
/// actually outputting the machine code and resolving things like the address
/// of functions. This method should returns true if machine code emission is
/// not supported.
///
virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM,
MachineCodeEmitter &MCE);
virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
CodeGenFileType FileType);
CodeGenFileType FileType, bool Fast);
};
} // end namespace llvm

View File

@ -162,7 +162,8 @@ SparcV9TargetMachine::SparcV9TargetMachine(const Module &M,
///
bool
SparcV9TargetMachine::addPassesToEmitFile(PassManager &PM, std::ostream &Out,
CodeGenFileType FileType) {
CodeGenFileType FileType,
bool Fast) {
if (FileType != TargetMachine::AssemblyFile) return true;
// FIXME: Implement efficient support for garbage collection intrinsics.

View File

@ -45,7 +45,7 @@ public:
}
virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
CodeGenFileType FileType);
CodeGenFileType FileType, bool Fast);
virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM,
MachineCodeEmitter &MCE);

View File

@ -106,7 +106,8 @@ X86TargetMachine::X86TargetMachine(const Module &M,
// addPassesToEmitFile - We currently use all of the same passes as the JIT
// does to emit statically compiled machine code.
bool X86TargetMachine::addPassesToEmitFile(PassManager &PM, std::ostream &Out,
CodeGenFileType FileType) {
CodeGenFileType FileType,
bool Fast) {
if (FileType != TargetMachine::AssemblyFile &&
FileType != TargetMachine::ObjectFile) return true;

View File

@ -41,17 +41,11 @@ public:
return &InstrInfo.getRegisterInfo();
}
/// addPassesToEmitMachineCode - Add passes to the specified pass manager to
/// get machine code emitted. This uses a MachineCodeEmitter object to handle
/// actually outputting the machine code and resolving things like the address
/// of functions. This method should returns true if machine code emission is
/// not supported.
///
virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM,
MachineCodeEmitter &MCE);
virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
CodeGenFileType FileType);
CodeGenFileType FileType, bool Fast);
static unsigned getModuleMatchQuality(const Module &M);
static unsigned getJITMatchQuality();