[llvm-commits] CVS: reopt/lib/LightWtProfiling/ReoptimizerInternal.h RuntimeOptimizations.cpp

Brian Gaeke gaeke at cs.uiuc.edu
Sun Jun 27 21:29:01 PDT 2004


Changes in directory reopt/lib/LightWtProfiling:

ReoptimizerInternal.h updated: 1.5 -> 1.6
RuntimeOptimizations.cpp updated: 1.44 -> 1.45

---
Log message:

Make optimizeTrace return false for "skip this trace", true otherwise.
Wrap some long lines.


---
Diffs of the changes:  (+11 -8)

Index: reopt/lib/LightWtProfiling/ReoptimizerInternal.h
diff -u reopt/lib/LightWtProfiling/ReoptimizerInternal.h:1.5 reopt/lib/LightWtProfiling/ReoptimizerInternal.h:1.6
--- reopt/lib/LightWtProfiling/ReoptimizerInternal.h:1.5	Wed May 26 16:23:36 2004
+++ reopt/lib/LightWtProfiling/ReoptimizerInternal.h	Sun Jun 27 21:28:05 2004
@@ -154,7 +154,7 @@
 
 // RuntimeOptimizations.cpp /////////////////////////////////////////////
 
-void optimizeTrace (std::vector<BasicBlock *> &vBB, uint64_t a);
+bool optimizeTrace (std::vector<BasicBlock *> &vBB, uint64_t a);
 
 // TraceWriter.cpp //////////////////////////////////////////////////////
 


Index: reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp
diff -u reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp:1.44 reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp:1.45
--- reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp:1.44	Fri Jun 25 00:15:27 2004
+++ reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp	Sun Jun 27 21:28:05 2004
@@ -54,20 +54,20 @@
 /// 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 the starting
-/// address for the trace.
+/// address for the trace. Returns false if we're skipping this trace.
 ///
-void optimizeTrace (std::vector<BasicBlock *> &vBB, uint64_t a) {
+bool optimizeTrace (std::vector<BasicBlock *> &vBB, uint64_t a) {
   static std::set<uint64_t> alreadyDone;
   if (alreadyDone.find (a) != alreadyDone.end ())
     // Used to have debug msg here, but it generated megabytes of spam.
-    return;
+    return false;
   else
     alreadyDone.insert (a);
     
   DEBUG(++TraceCount;
         if (skipTrace.find (TraceCount) != skipTrace.end ()) {
           std::cerr << "optimizeTrace: skipping trace " << TraceCount << "\n";
-          return;
+          return false;
         });
   
   // Initialization stuff: ensure module has been read in, and allocate a
@@ -88,8 +88,9 @@
   DEBUG (WriteTraceToFile (&T));
   TraceFunction *TF = TraceFunction::get (T);
 
-  // Compile the TraceFunction to machine code using the optimizing trace JIT compiler, and
-  // unpack the resulting optimized trace back into its matrix function.
+  // Compile the TraceFunction to machine code using the optimizing trace JIT
+  // compiler, and unpack the resulting optimized trace back into its matrix
+  // function.
   uint64_t traceStartAddr = TJIT->compileTraceFunction (TF);
 
   // Add a branch from address A (the parameter to this method) to the 
@@ -97,9 +98,11 @@
   // will proceed from the optimized version of the code.
   DEBUG(std::cerr << "Writing branch at 0x" << std::hex << a
                   << " to point to 0x" << traceStartAddr << std::dec << "\n");
-  TraceOptimizerDone(a, traceStartAddr, TJIT->getEmitter ()->getCurrentPCValue ());
+  TraceOptimizerDone(a, traceStartAddr,
+                     TJIT->getEmitter ()->getCurrentPCValue ());
   vm->writeBranchInstruction(a, traceStartAddr);
   doFlush (a, a + 4);
+  return true;
 }
 
 } // end namespace llvm





More information about the llvm-commits mailing list