[llvm-commits] CVS: reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp TraceOptEmitter.cpp
Brian Gaeke
gaeke at cs.uiuc.edu
Wed Apr 14 12:19:02 PDT 2004
Changes in directory reopt/lib/LightWtProfiling:
RuntimeOptimizations.cpp updated: 1.25 -> 1.26
TraceOptEmitter.cpp updated: 1.2 -> 1.3
---
Log message:
Make sure that a TargetData is added to the PassManager, and that
createTraceOptEmitter ends up in the llvm namespace
---
Diffs of the changes: (+9 -3)
Index: reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp
diff -u reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp:1.25 reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp:1.26
--- reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp:1.25 Tue Apr 13 16:29:43 2004
+++ reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp Wed Apr 14 12:18:42 2004
@@ -34,6 +34,7 @@
static TargetMachine *Target = 0;
static IntrinsicLowering *IL = 0;
+static MachineCodeEmitter *MCE = 0;
extern bool SaveStateToModule;
extern bool SaveRegAllocState;
@@ -56,6 +57,8 @@
if (!MP) initModules ();
if (!IL) IL = new DefaultIntrinsicLowering ();
if (!Target) Target = allocateSparcV9TargetMachine (*MP->getModule (), IL);
+ const TargetData &TD = Target->getTargetData ();
+ if (!MCE) MCE = createTraceOptEmitter (TD);
// Turn the vector of basic blocks into a Trace, and then turn the Trace into
// a TraceFunction.
@@ -76,14 +79,13 @@
DEBUG(PM.add (new PrintFunctionPass ("Function created from trace for "
+ T.getFunction ()->getName () + ":\n",
&std::cerr)));
+ PM.add (new TargetData (TD));
PM.add (createVerifierPass ());
Target->getJITInfo ()->addPassesToJITCompile (PM);
DEBUG(PM.add (createMachineFunctionPrinterPass (&std::cerr, "Before unpacking:\n")));
PM.add (createUnpackTraceFunctionPass (Target, TF));
DEBUG(PM.add (createMachineFunctionPrinterPass (&std::cerr, "After unpacking:\n")));
Target->getJITInfo ()->addPassesToJITCompile (PM);
- const TargetData &TD = Target->getTargetData ();
- MachineCodeEmitter *MCE = createTraceOptEmitter (TD);
Target->addPassesToEmitMachineCode (PM, *MCE);
PM.run (*TF->TraceFn);
Index: reopt/lib/LightWtProfiling/TraceOptEmitter.cpp
diff -u reopt/lib/LightWtProfiling/TraceOptEmitter.cpp:1.2 reopt/lib/LightWtProfiling/TraceOptEmitter.cpp:1.3
--- reopt/lib/LightWtProfiling/TraceOptEmitter.cpp:1.2 Tue Apr 13 16:29:44 2004
+++ reopt/lib/LightWtProfiling/TraceOptEmitter.cpp Wed Apr 14 12:18:42 2004
@@ -80,11 +80,15 @@
//
virtual uint64_t forceCompilationOf(Function *F);
};
-}
+} // end anonymous namespace
+
+namespace llvm {
MachineCodeEmitter *createTraceOptEmitter(const TargetData &TD) {
return new TraceOptEmitter(TD);
}
+
+} // end namespace llvm
void TraceOptEmitter::startFunction(MachineFunction &F) {
// Round up to a 64-bit word boundary.
More information about the llvm-commits
mailing list