[llvm-commits] CVS: reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp
Brian Gaeke
gaeke at cs.uiuc.edu
Tue Jan 13 13:47:01 PST 2004
Changes in directory reopt/lib/LightWtProfiling:
RuntimeOptimizations.cpp updated: 1.13 -> 1.14
---
Log message:
Include llvm/Target/TargetJITInfo.h so that I can use TargetJITInfo.
Fix up some comments; get rid of the #if 0'd-out stuff.
---
Diffs of the changes: (+8 -14)
Index: reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp
diff -u reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp:1.13 reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp:1.14
--- reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp:1.13 Tue Jan 13 12:17:49 2004
+++ reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp Tue Jan 13 13:46:07 2004
@@ -18,6 +18,7 @@
#include "llvm/Assembly/CachedWriter.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetMachineImpls.h"
+#include "llvm/Target/TargetJITInfo.h"
#include "llvm/IntrinsicLowering.h"
#include <fstream>
@@ -44,7 +45,7 @@
if (!MP)
initModules ();
- // Dump the trace to the standard error stream if we are in debug mode.
+ // Dump the basic blocks to the standard error stream if we are in debug mode.
DEBUG(std::cerr << "In optimizeTrace; a = " << a << "\n"
<< "Trace for function " << vBB[0]->getParent ()->getName ()
<< ", blocks:\n");
@@ -56,34 +57,27 @@
}
#endif // NDEBUG
- // Create Trace object.
+ // Turn vector of basic blocks into a Trace object.
Trace T (vBB);
- // Try to turn it into a function.
+ // Turn the Trace object into a function.
Function *TF = runTraceToFunction (T);
DEBUG(std::cerr << "Function created from trace: \n" << *TF);
- // Run some passes on it.
+ // Verify that the generated function's bytecode is good.
FunctionPassManager PM (MP);
PM.add (createVerifierPass ());
PM.run (*TF);
- // Allocate a target...
+ // Allocate a target machine.
IntrinsicLowering *IL = new DefaultIntrinsicLowering ();
TargetMachine *Target = allocateSparcTargetMachine (*MP->getModule (), IL);
assert (Target && "Could not allocate target machine!");
-#if 0
+ // FIXME: Register allocation hints need to be added to the PassManager.
+
// Compile LLVM Code down to machine code in the intermediate representation
Target->getJITInfo ()->addPassesToJITCompile (PM);
-
- // Make the ExecutionEngine generate code for the function and give us
- // the MachineFunctions so that we can run UnpackTraceFunction on them.
- // FIXME: Register allocation hints presumably would need to be added
- // to the PassManager of the ExecutionEngine.
- ExecutionEngine *EE = new ExecutionEngine (TF->getParent (), false, false);
- void (*p)() = EE->getPointerToFunction (TF);
-#endif
}
} // end namespace llvm
More information about the llvm-commits
mailing list