[llvm-commits] CVS: reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp
Brian Gaeke
gaeke at cs.uiuc.edu
Wed Jan 14 16:10:40 PST 2004
Changes in directory reopt/lib/LightWtProfiling:
RuntimeOptimizations.cpp updated: 1.14 -> 1.15
---
Log message:
Include llvm/CodeGen/MachineFunction.h.
Expand one of my FIXME comments.
Run code generation passes and print out the machine code. (It works!)
---
Diffs of the changes: (+8 -2)
Index: reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp
diff -u reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp:1.14 reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp:1.15
--- reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp:1.14 Tue Jan 13 13:46:07 2004
+++ reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp Wed Jan 14 16:08:45 2004
@@ -19,6 +19,7 @@
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetMachineImpls.h"
#include "llvm/Target/TargetJITInfo.h"
+#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/IntrinsicLowering.h"
#include <fstream>
@@ -67,17 +68,22 @@
// Verify that the generated function's bytecode is good.
FunctionPassManager PM (MP);
PM.add (createVerifierPass ());
- PM.run (*TF);
// Allocate a target machine.
IntrinsicLowering *IL = new DefaultIntrinsicLowering ();
TargetMachine *Target = allocateSparcTargetMachine (*MP->getModule (), IL);
assert (Target && "Could not allocate target machine!");
- // FIXME: Register allocation hints need to be added to the PassManager.
+ // FIXME: Register allocation hints need to be added to the PassManager,
+ // so that we do not get clobbered by the overhead of adding copies in
+ // UnpackTraceFunction.
// Compile LLVM Code down to machine code in the intermediate representation
Target->getJITInfo ()->addPassesToJITCompile (PM);
+ PM.run (*TF);
+
+ MachineFunction &MF = MachineFunction::get (TF);
+ DEBUG(std::cerr << "Generated machine code: "; MF.print (std::cerr));
}
} // end namespace llvm
More information about the llvm-commits
mailing list