Add option -enable-x86-lsr to enable x86 loop strength reduction pass.

llvm-svn: 26665
This commit is contained in:
Evan Cheng 2006-03-09 21:51:28 +00:00
parent ff4d4ee163
commit 306c13a8fb
1 changed files with 7 additions and 0 deletions

View File

@ -37,6 +37,10 @@ namespace {
cl::opt<bool> DisableOutput("disable-x86-llc-output", cl::Hidden,
cl::desc("Disable the X86 asm printer, for use "
"when profiling the code generator."));
cl::opt<bool> EnableX86LSR("enable-x86-lsr", cl::Hidden,
cl::desc("Enable the X86 loop strength reduction "
"pass."));
// Register the target.
RegisterTarget<X86TargetMachine> X("x86", " IA-32 (Pentium and above)");
}
@ -92,6 +96,9 @@ bool X86TargetMachine::addPassesToEmitFile(PassManager &PM, std::ostream &Out,
if (FileType != TargetMachine::AssemblyFile &&
FileType != TargetMachine::ObjectFile) return true;
// Run loop strength reduction before anything else.
if (EnableX86LSR) PM.add(createLoopStrengthReducePass());
// FIXME: Implement efficient support for garbage collection intrinsics.
PM.add(createLowerGCPass());