[llvm-commits] CVS: llvm/lib/Reoptimizer/LightWtProfiling/Trigger/RuntimeOptimizations.cpp
Brian Gaeke
gaeke at cs.uiuc.edu
Tue Aug 19 14:23:01 PDT 2003
Changes in directory llvm/lib/Reoptimizer/LightWtProfiling/Trigger:
RuntimeOptimizations.cpp updated: 1.2 -> 1.3
---
Log message:
Keep a set of traces which we've already seen, and don't re-run optimizations
on them.
Tighten up the debug output.
---
Diffs of the changes:
Index: llvm/lib/Reoptimizer/LightWtProfiling/Trigger/RuntimeOptimizations.cpp
diff -u llvm/lib/Reoptimizer/LightWtProfiling/Trigger/RuntimeOptimizations.cpp:1.2 llvm/lib/Reoptimizer/LightWtProfiling/Trigger/RuntimeOptimizations.cpp:1.3
--- llvm/lib/Reoptimizer/LightWtProfiling/Trigger/RuntimeOptimizations.cpp:1.2 Mon Aug 18 15:37:31 2003
+++ llvm/lib/Reoptimizer/LightWtProfiling/Trigger/RuntimeOptimizations.cpp Tue Aug 19 14:21:53 2003
@@ -21,16 +21,23 @@
/// addresses for the trace.
///
void optimizeTrace (std::vector<BasicBlock *> &vBB, uint64_t a) {
+ static std::set<uint64_t> alreadyDone;
+ if (alreadyDone.find (a) != alreadyDone.end ()) {
+ DEBUG(std::cerr << "In optimizeTrace; already did this trace! a = "
+ << a << "\n");
+ return;
+ } else {
+ alreadyDone.insert(a);
+ }
+
// Dump the trace to the standard error stream if we are in debug mode.
- DEBUG(std::cerr << "=== In optimizeTrace; a = " << a << "================\n"
- << "--- Function where the trace starts -----------------\n"
- << vBB[0]->getParent ()
- << "--- BasicBlocks in the trace ------------------------\n");
+ DEBUG(std::cerr << "In optimizeTrace; a = " << a << "\n"
+ << "Trace for function " << vBB[0]->getParent ()->getName ()
+ << ", blocks:\n");
#ifndef NDEBUG
for (unsigned i = 0; i < vBB.size (); ++i)
DEBUG(std::cerr << *vBB[i]);
#endif // NDEBUG
- DEBUG(std::cerr << "=====================================================\n");
if (!M)
initModules ();
More information about the llvm-commits
mailing list