[llvm-commits] CVS: llvm/lib/CodeGen/LLVMTargetMachine.cpp
Chris Lattner
sabre at nondot.org
Fri Mar 30 17:25:00 PDT 2007
Changes in directory llvm/lib/CodeGen:
LLVMTargetMachine.cpp updated: 1.10 -> 1.11
---
Log message:
Add a -print-lsr-output option to LLC, to print the output of the LSR pass.
---
Diffs of the changes: (+9 -1)
LLVMTargetMachine.cpp | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletion(-)
Index: llvm/lib/CodeGen/LLVMTargetMachine.cpp
diff -u llvm/lib/CodeGen/LLVMTargetMachine.cpp:1.10 llvm/lib/CodeGen/LLVMTargetMachine.cpp:1.11
--- llvm/lib/CodeGen/LLVMTargetMachine.cpp:1.10 Tue Mar 6 15:14:09 2007
+++ llvm/lib/CodeGen/LLVMTargetMachine.cpp Fri Mar 30 19:24:43 2007
@@ -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 @@
// 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());
More information about the llvm-commits
mailing list