[llvm-commits] CVS: llvm/lib/Reoptimizer/LightWtProfiling/Trigger/RuntimeOptimizations.cpp
Brian Gaeke
gaeke at niobe.cs.uiuc.edu
Tue Aug 12 22:08:10 PDT 2003
Changes in directory llvm/lib/Reoptimizer/LightWtProfiling/Trigger:
RuntimeOptimizations.cpp added (r1.1)
---
Log message:
New file containing driver for optimization passes.
---
Diffs of the changes:
Index: llvm/lib/Reoptimizer/LightWtProfiling/Trigger/RuntimeOptimizations.cpp
diff -c /dev/null llvm/lib/Reoptimizer/LightWtProfiling/Trigger/RuntimeOptimizations.cpp:1.1
*** /dev/null Tue Aug 12 22:07:42 2003
--- llvm/lib/Reoptimizer/LightWtProfiling/Trigger/RuntimeOptimizations.cpp Tue Aug 12 22:07:02 2003
***************
*** 0 ****
--- 1,39 ----
+ //===-- LightWtProfiling/Trigger/RuntimeOptimizations.cpp --------*- C++ -*--=//
+ //
+ // This file contains a method called upon the construction of a new trace of
+ // LLVM BasicBlocks that can be reoptimized. It sets up a PassManager and runs
+ // some predefined set of Passes over the module containing the trace.
+ //
+ //===----------------------------------------------------------------------===//
+
+ #include "llvm/PassManager.h"
+ #include "llvm/BasicBlock.h"
+ #include "GetTimer.h"
+ #include "Globals.h"
+
+ // From Initialization.cpp
+ extern void initModules ();
+
+ /// This method is called when we have finally constructed a
+ /// trace. The first parameter is the vector of basic blocks that form
+ /// the trace; the second parameter is presumably one of the starting
+ /// addresses for the trace.
+ ///
+ void optimizeTrace (std::vector<BasicBlock *> &vBB, uint64_t a) {
+ #ifdef GET_ALL_INFO
+ // Dump the trace to the standard error stream.
+ std::cerr << "=== In optimizeTrace; a = " << a << "================\n";
+ std::cerr << "--- Function where the trace starts -----------------\n";
+ std::cerr << vBB[0]->getParent ();
+ std::cerr << "--- BasicBlocks in the trace ------------------------\n";
+ for (unsigned i = 0; i < vBB.size (); ++i)
+ std::cerr << *vBB[i];
+ std::cerr << "=====================================================\n";
+ #endif // GET_ALL_INFO
+ if (!M)
+ initModules ();
+
+ PassManager PM;
+ // Add your favorite runtime optimization passes here.
+ PM.run (*M);
+ }
More information about the llvm-commits
mailing list