[llvm-commits] CVS: reopt/lib/LightWtProfiling/Initialization.cpp
Brian Gaeke
gaeke at cs.uiuc.edu
Tue Jan 13 12:26:02 PST 2004
Changes in directory reopt/lib/LightWtProfiling:
Initialization.cpp updated: 1.11 -> 1.12
---
Log message:
Include scheduler.h, for initialize_timer().
Define timer_interval_sec, timer_interval_nsec, enable_phase_detect, and MP.
Add new options to let the user set the timer interval and turn on
enable_phase_detect.
Make enable_phase_detect control whether we run initialize_timer().
---
Diffs of the changes: (+15 -2)
Index: reopt/lib/LightWtProfiling/Initialization.cpp
diff -u reopt/lib/LightWtProfiling/Initialization.cpp:1.11 reopt/lib/LightWtProfiling/Initialization.cpp:1.12
--- reopt/lib/LightWtProfiling/Initialization.cpp:1.11 Wed Nov 19 16:51:48 2003
+++ reopt/lib/LightWtProfiling/Initialization.cpp Tue Jan 13 12:25:01 2004
@@ -9,6 +9,7 @@
#include <cassert>
#include "GetTimer.h"
#include "Globals.h"
+#include "scheduler.h"
#include "Support/CommandLine.h"
#include "Support/DataTypes.h"
#include "llvm/Bytecode/Reader.h"
@@ -20,12 +21,16 @@
int32_t reopt_threshold;
int32_t THRESHOLD_LEVEL_2;
int32_t LEVEL_TWO_EXITS;
+int32_t timer_interval_sec;
+int32_t timer_interval_nsec;
TraceCache *tr;
TraceCache *tr2;
VirtualMem *vm;
Module *M;
bool count_trace_cycles;
bool enable_trace_optimizer;
+bool enable_phase_detect;
+ModuleProvider *MP;
// Command line options. Use these to set the global variables. For
// now the reoptimizer code references the global variables
@@ -44,10 +49,16 @@
FLIThreshold("fli-threshold", cl::location(reopt_threshold), cl::init(30));
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));
cl::opt<bool, true>
CountTraceCycles("count-trace-cycles", cl::location(count_trace_cycles));
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));
/// reoptimizerInitialize - Initialization method for the
/// reoptimizer. A call to this function from main() is inserted by
@@ -63,8 +74,9 @@
LEVEL_TWO_EXITS = THRESHOLD_LEVEL_2/3;
- // FIXME: When do we need to call this?
- //initialize_timer();
+ // Set up the phase-change detection stuff (normally disabled).
+ if (enable_phase_detect)
+ initialize_timer();
}
/// Initialization method for the reoptimizer that parses the bytecode
@@ -76,6 +88,7 @@
std::string err;
M = ParseBytecodeBuffer(LLVMBytecode, llvm_length, "NOFILENAME", &err);
assert(M && "Module parsing failed!");
+ MP = new ExistingModuleProvider (M);
}
} // end namespace llvm
More information about the llvm-commits
mailing list