/// addPassesToEmitFile - Add passes to the specified pass manager to get
/// the specified file emitted. Typically this will involve several steps of
- /// code generation. This method should return true if emission of this file
- /// type is not supported.
+ /// code generation. If Fast is set to true, the code generator should emit
+ /// code as fast as possible, without regard for compile time. This method
+ /// should return true if emission of this file type is not supported.
///
virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
- CodeGenFileType FileType) {
+ CodeGenFileType FileType, bool Fast) {
return true;
}
///
bool PPCTargetMachine::addPassesToEmitFile(PassManager &PM,
std::ostream &Out,
- CodeGenFileType FileType) {
+ CodeGenFileType FileType,
+ bool Fast) {
if (FileType != TargetMachine::AssemblyFile) return true;
// Run loop strength reduction before anything else.
- PM.add(createLoopStrengthReducePass());
+ if (!Fast) PM.add(createLoopStrengthReducePass());
// FIXME: Implement efficient support for garbage collection intrinsics.
PM.add(createLowerGCPass());
PM.add(createLowerInvokePass());
// Clean up after other passes, e.g. merging critical edges.
- PM.add(createCFGSimplificationPass());
+ if (!Fast) PM.add(createCFGSimplificationPass());
// FIXME: Implement the switch instruction in the instruction selector!
PM.add(createLowerSwitchPass());
static unsigned getModuleMatchQuality(const Module &M);
virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
- CodeGenFileType FileType);
+ CodeGenFileType FileType, bool Fast);
bool addPassesToEmitMachineCode(FunctionPassManager &PM,
MachineCodeEmitter &MCE);