diff options
author | Brian Gaeke <gaeke@uiuc.edu> | 2004-06-14 05:05:45 +0000 |
---|---|---|
committer | Brian Gaeke <gaeke@uiuc.edu> | 2004-06-14 05:05:45 +0000 |
commit | 99c6539bce05f69f2caa6042f1ef566c2817061a (patch) | |
tree | e9b49cb5e4cbad3a60480d8c589b9f8548bd4498 /llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp | |
parent | d5a21b05758ae367b7e2220d4e14151442f52529 (diff) | |
download | bcm5719-llvm-99c6539bce05f69f2caa6042f1ef566c2817061a.tar.gz bcm5719-llvm-99c6539bce05f69f2caa6042f1ef566c2817061a.zip |
Make -print-machineinstrs even stronger. You get to see the final code after
peepholing, and make it work the same way in the JIT as in LLC.
llvm-svn: 14170
Diffstat (limited to 'llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp')
-rw-r--r-- | llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp b/llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp index 4c92105bfe5..d7d5ab7364c 100644 --- a/llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp +++ b/llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp @@ -179,6 +179,9 @@ SparcV9TargetMachine::addPassesToEmitAssembly(PassManager &PM, std::ostream &Out if (!DisablePeephole) PM.add(createPeepholeOptsPass(*this)); + if (PrintMachineCode) + PM.add(createMachineFunctionPrinterPass(&std::cerr, "Final code:\n")); + if (EmitMappingInfo) { PM.add(createInternalGlobalMapperPass()); PM.add(getMappingInfoAsmPrinterPass(Out)); @@ -234,6 +237,11 @@ void SparcV9JITInfo::addPassesToJITCompile(FunctionPassManager &PM) { //PM.add(createLICMPass()); //PM.add(createGCSEPass()); + // If the user's trying to read the generated code, they'll need to see the + // transformed input. + if (PrintMachineCode) + PM.add(new PrintFunctionPass()); + // Construct and initialize the MachineFunction object for this fn. PM.add(createMachineCodeConstructionPass(TM)); @@ -251,6 +259,9 @@ void SparcV9JITInfo::addPassesToJITCompile(FunctionPassManager &PM) { if (!DisablePeephole) PM.add(createPeepholeOptsPass(TM)); + + if (PrintMachineCode) + PM.add(createMachineFunctionPrinterPass(&std::cerr, "Final code:\n")); } /// allocateSparcV9TargetMachine - Allocate and return a subclass of TargetMachine |