mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-08 21:32:39 +00:00
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:
parent
26b91ebb63
commit
ce8eb0c16b
@ -77,7 +77,8 @@ AlphaTargetMachine::AlphaTargetMachine(const Module &M, IntrinsicLowering *IL,
|
|||||||
///
|
///
|
||||||
bool AlphaTargetMachine::addPassesToEmitFile(PassManager &PM,
|
bool AlphaTargetMachine::addPassesToEmitFile(PassManager &PM,
|
||||||
std::ostream &Out,
|
std::ostream &Out,
|
||||||
CodeGenFileType FileType) {
|
CodeGenFileType FileType,
|
||||||
|
bool Fast) {
|
||||||
if (FileType != TargetMachine::AssemblyFile) return true;
|
if (FileType != TargetMachine::AssemblyFile) return true;
|
||||||
|
|
||||||
if (EnableAlphaLSR) {
|
if (EnableAlphaLSR) {
|
||||||
|
@ -48,17 +48,11 @@ public:
|
|||||||
|
|
||||||
static unsigned getJITMatchQuality();
|
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,
|
virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM,
|
||||||
MachineCodeEmitter &MCE);
|
MachineCodeEmitter &MCE);
|
||||||
|
|
||||||
virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
|
virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
|
||||||
CodeGenFileType FileType);
|
CodeGenFileType FileType, bool Fast);
|
||||||
|
|
||||||
static unsigned getModuleMatchQuality(const Module &M);
|
static unsigned getModuleMatchQuality(const Module &M);
|
||||||
};
|
};
|
||||||
|
@ -1725,7 +1725,7 @@ void CWriter::visitVAArgInst(VAArgInst &I) {
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
bool CTargetMachine::addPassesToEmitFile(PassManager &PM, std::ostream &o,
|
bool CTargetMachine::addPassesToEmitFile(PassManager &PM, std::ostream &o,
|
||||||
CodeGenFileType FileType) {
|
CodeGenFileType FileType, bool Fast) {
|
||||||
if (FileType != TargetMachine::AssemblyFile) return true;
|
if (FileType != TargetMachine::AssemblyFile) return true;
|
||||||
|
|
||||||
PM.add(createLowerGCPass());
|
PM.add(createLowerGCPass());
|
||||||
|
@ -26,7 +26,7 @@ struct CTargetMachine : public TargetMachine {
|
|||||||
|
|
||||||
// This is the only thing that actually does anything here.
|
// This is the only thing that actually does anything here.
|
||||||
virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
|
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.
|
// This class always works, but shouldn't be the default in most cases.
|
||||||
static unsigned getModuleMatchQuality(const Module &M) { return 1; }
|
static unsigned getModuleMatchQuality(const Module &M) { return 1; }
|
||||||
|
@ -1725,7 +1725,7 @@ void CWriter::visitVAArgInst(VAArgInst &I) {
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
bool CTargetMachine::addPassesToEmitFile(PassManager &PM, std::ostream &o,
|
bool CTargetMachine::addPassesToEmitFile(PassManager &PM, std::ostream &o,
|
||||||
CodeGenFileType FileType) {
|
CodeGenFileType FileType, bool Fast) {
|
||||||
if (FileType != TargetMachine::AssemblyFile) return true;
|
if (FileType != TargetMachine::AssemblyFile) return true;
|
||||||
|
|
||||||
PM.add(createLowerGCPass());
|
PM.add(createLowerGCPass());
|
||||||
|
@ -85,7 +85,8 @@ IA64TargetMachine::IA64TargetMachine(const Module &M, IntrinsicLowering *IL,
|
|||||||
// does to emit statically compiled machine code.
|
// does to emit statically compiled machine code.
|
||||||
bool IA64TargetMachine::addPassesToEmitFile(PassManager &PM,
|
bool IA64TargetMachine::addPassesToEmitFile(PassManager &PM,
|
||||||
std::ostream &Out,
|
std::ostream &Out,
|
||||||
CodeGenFileType FileType) {
|
CodeGenFileType FileType,
|
||||||
|
bool Fast) {
|
||||||
if (FileType != TargetMachine::AssemblyFile) return true;
|
if (FileType != TargetMachine::AssemblyFile) return true;
|
||||||
|
|
||||||
// FIXME: Implement efficient support for garbage collection intrinsics.
|
// FIXME: Implement efficient support for garbage collection intrinsics.
|
||||||
|
@ -37,7 +37,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
|
virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
|
||||||
CodeGenFileType FileType);
|
CodeGenFileType FileType, bool Fast);
|
||||||
|
|
||||||
static unsigned getModuleMatchQuality(const Module &M);
|
static unsigned getModuleMatchQuality(const Module &M);
|
||||||
static unsigned compileTimeMatchQuality(void);
|
static unsigned compileTimeMatchQuality(void);
|
||||||
|
@ -40,7 +40,8 @@ SkeletonTargetMachine::SkeletonTargetMachine(const Module &M,
|
|||||||
///
|
///
|
||||||
bool SkeletonTargetMachine::addPassesToEmitFile(PassManager &PM,
|
bool SkeletonTargetMachine::addPassesToEmitFile(PassManager &PM,
|
||||||
std::ostream &Out,
|
std::ostream &Out,
|
||||||
CodeGenFileType FileType) {
|
CodeGenFileType FileType,
|
||||||
|
bool Fast) {
|
||||||
if (FileType != TargetMachine::AssemblyFile) return true;
|
if (FileType != TargetMachine::AssemblyFile) return true;
|
||||||
// <insert instruction selector passes here>
|
// <insert instruction selector passes here>
|
||||||
PM.add(createRegisterAllocator());
|
PM.add(createRegisterAllocator());
|
||||||
|
@ -44,7 +44,7 @@ namespace llvm {
|
|||||||
MachineCodeEmitter &MCE);
|
MachineCodeEmitter &MCE);
|
||||||
|
|
||||||
virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
|
virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
|
||||||
CodeGenFileType FileType);
|
CodeGenFileType FileType, bool Fast);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace llvm
|
} // end namespace llvm
|
||||||
|
@ -65,7 +65,8 @@ unsigned SparcV8TargetMachine::getModuleMatchQuality(const Module &M) {
|
|||||||
///
|
///
|
||||||
bool SparcV8TargetMachine::addPassesToEmitFile(PassManager &PM,
|
bool SparcV8TargetMachine::addPassesToEmitFile(PassManager &PM,
|
||||||
std::ostream &Out,
|
std::ostream &Out,
|
||||||
CodeGenFileType FileType) {
|
CodeGenFileType FileType,
|
||||||
|
bool Fast) {
|
||||||
if (FileType != TargetMachine::AssemblyFile) return true;
|
if (FileType != TargetMachine::AssemblyFile) return true;
|
||||||
|
|
||||||
// FIXME: Implement efficient support for garbage collection intrinsics.
|
// FIXME: Implement efficient support for garbage collection intrinsics.
|
||||||
|
@ -45,17 +45,11 @@ public:
|
|||||||
static unsigned getModuleMatchQuality(const Module &M);
|
static unsigned getModuleMatchQuality(const Module &M);
|
||||||
static unsigned getJITMatchQuality();
|
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,
|
virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM,
|
||||||
MachineCodeEmitter &MCE);
|
MachineCodeEmitter &MCE);
|
||||||
|
|
||||||
virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
|
virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
|
||||||
CodeGenFileType FileType);
|
CodeGenFileType FileType, bool Fast);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace llvm
|
} // end namespace llvm
|
||||||
|
@ -65,7 +65,8 @@ unsigned SparcV8TargetMachine::getModuleMatchQuality(const Module &M) {
|
|||||||
///
|
///
|
||||||
bool SparcV8TargetMachine::addPassesToEmitFile(PassManager &PM,
|
bool SparcV8TargetMachine::addPassesToEmitFile(PassManager &PM,
|
||||||
std::ostream &Out,
|
std::ostream &Out,
|
||||||
CodeGenFileType FileType) {
|
CodeGenFileType FileType,
|
||||||
|
bool Fast) {
|
||||||
if (FileType != TargetMachine::AssemblyFile) return true;
|
if (FileType != TargetMachine::AssemblyFile) return true;
|
||||||
|
|
||||||
// FIXME: Implement efficient support for garbage collection intrinsics.
|
// FIXME: Implement efficient support for garbage collection intrinsics.
|
||||||
|
@ -45,17 +45,11 @@ public:
|
|||||||
static unsigned getModuleMatchQuality(const Module &M);
|
static unsigned getModuleMatchQuality(const Module &M);
|
||||||
static unsigned getJITMatchQuality();
|
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,
|
virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM,
|
||||||
MachineCodeEmitter &MCE);
|
MachineCodeEmitter &MCE);
|
||||||
|
|
||||||
virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
|
virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
|
||||||
CodeGenFileType FileType);
|
CodeGenFileType FileType, bool Fast);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace llvm
|
} // end namespace llvm
|
||||||
|
@ -162,7 +162,8 @@ SparcV9TargetMachine::SparcV9TargetMachine(const Module &M,
|
|||||||
///
|
///
|
||||||
bool
|
bool
|
||||||
SparcV9TargetMachine::addPassesToEmitFile(PassManager &PM, std::ostream &Out,
|
SparcV9TargetMachine::addPassesToEmitFile(PassManager &PM, std::ostream &Out,
|
||||||
CodeGenFileType FileType) {
|
CodeGenFileType FileType,
|
||||||
|
bool Fast) {
|
||||||
if (FileType != TargetMachine::AssemblyFile) return true;
|
if (FileType != TargetMachine::AssemblyFile) return true;
|
||||||
|
|
||||||
// FIXME: Implement efficient support for garbage collection intrinsics.
|
// FIXME: Implement efficient support for garbage collection intrinsics.
|
||||||
|
@ -45,7 +45,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
|
virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
|
||||||
CodeGenFileType FileType);
|
CodeGenFileType FileType, bool Fast);
|
||||||
virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM,
|
virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM,
|
||||||
MachineCodeEmitter &MCE);
|
MachineCodeEmitter &MCE);
|
||||||
|
|
||||||
|
@ -106,7 +106,8 @@ X86TargetMachine::X86TargetMachine(const Module &M,
|
|||||||
// addPassesToEmitFile - We currently use all of the same passes as the JIT
|
// addPassesToEmitFile - We currently use all of the same passes as the JIT
|
||||||
// does to emit statically compiled machine code.
|
// does to emit statically compiled machine code.
|
||||||
bool X86TargetMachine::addPassesToEmitFile(PassManager &PM, std::ostream &Out,
|
bool X86TargetMachine::addPassesToEmitFile(PassManager &PM, std::ostream &Out,
|
||||||
CodeGenFileType FileType) {
|
CodeGenFileType FileType,
|
||||||
|
bool Fast) {
|
||||||
if (FileType != TargetMachine::AssemblyFile &&
|
if (FileType != TargetMachine::AssemblyFile &&
|
||||||
FileType != TargetMachine::ObjectFile) return true;
|
FileType != TargetMachine::ObjectFile) return true;
|
||||||
|
|
||||||
|
@ -41,17 +41,11 @@ public:
|
|||||||
return &InstrInfo.getRegisterInfo();
|
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,
|
virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM,
|
||||||
MachineCodeEmitter &MCE);
|
MachineCodeEmitter &MCE);
|
||||||
|
|
||||||
virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
|
virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
|
||||||
CodeGenFileType FileType);
|
CodeGenFileType FileType, bool Fast);
|
||||||
|
|
||||||
static unsigned getModuleMatchQuality(const Module &M);
|
static unsigned getModuleMatchQuality(const Module &M);
|
||||||
static unsigned getJITMatchQuality();
|
static unsigned getJITMatchQuality();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user