diff options
author | Chris Lattner <sabre@nondot.org> | 2007-03-31 00:24:43 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-03-31 00:24:43 +0000 |
commit | bafc837c835fc6d63184df566f78b2d28fd59768 (patch) | |
tree | 6052f99a6b9afc1fdac9bd9ebb571729caabd664 /llvm/lib | |
parent | 1eb94d973a30191382a8ceecdb6039012e5f02b9 (diff) | |
download | bcm5719-llvm-bafc837c835fc6d63184df566f78b2d28fd59768.tar.gz bcm5719-llvm-bafc837c835fc6d63184df566f78b2d28fd59768.zip |
Add a -print-lsr-output option to LLC, to print the output of the LSR pass.
llvm-svn: 35522
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/LLVMTargetMachine.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LLVMTargetMachine.cpp b/llvm/lib/CodeGen/LLVMTargetMachine.cpp index d7b27bd84d2..641c04653a0 100644 --- a/llvm/lib/CodeGen/LLVMTargetMachine.cpp +++ b/llvm/lib/CodeGen/LLVMTargetMachine.cpp @@ -14,12 +14,16 @@ #include "llvm/Target/TargetMachine.h" #include "llvm/PassManager.h" #include "llvm/Pass.h" +#include "llvm/Assembly/PrintModulePass.h" #include "llvm/Analysis/LoopPass.h" #include "llvm/CodeGen/Passes.h" #include "llvm/Target/TargetOptions.h" #include "llvm/Transforms/Scalar.h" +#include "llvm/Support/CommandLine.h" using namespace llvm; +static cl::opt<bool> PrintLSR("print-lsr-output"); + FileModel::Model LLVMTargetMachine::addPassesToEmitFile(FunctionPassManager &PM, std::ostream &Out, @@ -28,7 +32,11 @@ LLVMTargetMachine::addPassesToEmitFile(FunctionPassManager &PM, // Standard LLVM-Level Passes. // Run loop strength reduction before anything else. - if (!Fast) PM.add(createLoopStrengthReducePass(getTargetLowering())); + if (!Fast) { + PM.add(createLoopStrengthReducePass(getTargetLowering())); + if (PrintLSR) + PM.add(new PrintFunctionPass("\n\n*** Code after LSR *** \n", &cerr)); + } // FIXME: Implement efficient support for garbage collection intrinsics. PM.add(createLowerGCPass()); |