[llvm-commits] CVS: reopt/lib/LightWtProfiling/Initialization.cpp

Brian Gaeke gaeke at cs.uiuc.edu
Mon Oct 4 13:23:19 PDT 2004



Changes in directory reopt/lib/LightWtProfiling:

Initialization.cpp updated: 1.19 -> 1.20
---
Log message:

Rearrange cl::opts. Add more descriptions of options.
We only need one option for the timer threshold.


---
Diffs of the changes:  (+28 -17)

Index: reopt/lib/LightWtProfiling/Initialization.cpp
diff -u reopt/lib/LightWtProfiling/Initialization.cpp:1.19 reopt/lib/LightWtProfiling/Initialization.cpp:1.20
--- reopt/lib/LightWtProfiling/Initialization.cpp:1.19	Thu Sep  2 11:55:43 2004
+++ reopt/lib/LightWtProfiling/Initialization.cpp	Mon Oct  4 15:23:09 2004
@@ -21,6 +21,8 @@
 #include "reopt/TraceCache.h"
 #include "reopt/VirtualMem.h"
 #include <cassert>
+#include <cstdlib>
+#include <cmath>
 #include <set>
 
 namespace llvm { 
@@ -49,27 +51,32 @@
 
 // FIXME: What are the units of these next two?
 cl::opt<int32_t>
-InstTraceCacheSize("inst-trace-cache-size", cl::init(30000),
-		   cl::desc("Trace cache size for SLI-instrumented code"));
+ InstTraceCacheSize("inst-trace-cache-size", cl::init(30000),
+ cl::desc("Trace cache size for SLI-instrumented code"));
 cl::opt<int32_t>
-OptTraceCacheSize("opt-trace-cache-size", cl::init(30000),
-		  cl::desc("Trace cache size for optimized code"));
+ OptTraceCacheSize("opt-trace-cache-size", cl::init(30000),
+ cl::desc("Trace cache size for optimized code"));
 cl::opt<int32_t, true>
-FLIThreshold("fli-threshold", cl::location(reopt_threshold), cl::init(30));
+ FLIThreshold("fli-threshold", cl::location(reopt_threshold), cl::init(30),
+ cl::desc("Number of times FLI must trigger before attempting SLI"));
 cl::opt<int32_t, true>
-SLIThreshold("sli-threshold", cl::location(THRESHOLD_LEVEL_2), cl::init(50));
-cl::opt<int32_t, true>
-TimerIntS("timer-int-s", cl::location(timer_interval_sec), cl::init(3));
-cl::opt<int32_t, true>
-TimerIntNS("timer-int-ns", cl::location(timer_interval_nsec), cl::init(0));
+ SLIThreshold("sli-threshold", cl::location(THRESHOLD_LEVEL_2), cl::init(50),
+ cl::desc("Number of iterations of SLI before path counters are sampled"));
 cl::opt<bool, true>
-CountTraceCycles("count-trace-cycles", cl::location(count_trace_cycles));
+ CountTraceCycles("count-trace-cycles", cl::location(count_trace_cycles),
+ cl::desc("Insert entry/exit instrumentation calls to libcpc to count cycles, when using trace layout engine"));
 cl::opt<bool, true>
-EnableTraceOpt("enable-trace-opt", cl::location(enable_trace_optimizer));
-cl::opt<bool, true>
-EnablePhaseDetect("enable-phase-detect", cl::location(enable_phase_detect));
+ EnableTraceOpt("enable-trace-opt", cl::location(enable_trace_optimizer),
+ cl::desc("Use the new trace optimizer instead of the old trace layout engine"));
 cl::opt<int>
-SkipTraceOpt("skip-trace", cl::init(-1));
+ SkipTraceOpt("skip-trace", cl::init(-1),
+ cl::desc("Don't optimize the Nth trace, when using trace optimizer"));
+cl::opt<bool, true>
+ EnablePhaseDetect("enable-phase-detect", cl::location(enable_phase_detect),
+ cl::desc("Use a timer interrupt to remove traces periodically from the trace cache"));
+cl::opt<double>
+ TimerIntS("timer-int-s", cl::init(3.0),
+ cl::desc("Interval (in seconds) between phase detection sweeps"));
 
 /// reoptimizerInitialize - Initialization method for the
 /// reoptimizer. A call to this function from main() is inserted by
@@ -88,8 +95,12 @@
   LEVEL_TWO_EXITS = THRESHOLD_LEVEL_2/3;
 
   // Set up the phase-change detection stuff (normally disabled).
-  if (enable_phase_detect)
-    initialize_timer();
+  if (enable_phase_detect) {
+    double d = TimerIntS;
+    timer_interval_sec = (int32_t) trunc (d);
+    timer_interval_nsec = (int32_t) ((d - trunc (d)) * 1.0e9);
+    initialize_timer ();
+  }
 
   if (SkipTraceOpt != -1) { skipTrace.insert((int)SkipTraceOpt); }
   






More information about the llvm-commits mailing list