add an option to turn on LSR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26080 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2006-02-09 05:06:36 +00:00
parent 239862ce99
commit 9413678f91
2 changed files with 62 additions and 1 deletions

View File

@ -27,6 +27,8 @@ using namespace llvm;
namespace {
// Register the target.
RegisterTarget<SparcTargetMachine> X("sparc", " SPARC");
cl::opt<bool> EnableLSR("enable-sparc-lsr", cl::Hidden);
}
/// SparcTargetMachine ctor - Create an ILP32 architecture model
@ -65,6 +67,9 @@ bool SparcTargetMachine::addPassesToEmitFile(PassManager &PM, std::ostream &Out,
bool Fast) {
if (FileType != TargetMachine::AssemblyFile) return true;
// Run loop strength reduction before anything else.
if (EnableLSR && !Fast) PM.add(createLoopStrengthReducePass());
// FIXME: Implement efficient support for garbage collection intrinsics.
PM.add(createLowerGCPass());
@ -73,7 +78,7 @@ bool SparcTargetMachine::addPassesToEmitFile(PassManager &PM, std::ostream &Out,
// FIXME: implement the switch instruction in the instruction selector.
PM.add(createLowerSwitchPass());
// Print LLVM code input to instruction selector:
if (PrintMachineCode)
PM.add(new PrintFunctionPass());