[llvm-commits] CVS: llvm/lib/Reoptimizer/LightWtProfiling/Trigger/SecondTrigger.cpp
Brian Gaeke
gaeke at niobe.cs.uiuc.edu
Tue Aug 12 22:08:21 PDT 2003
Changes in directory llvm/lib/Reoptimizer/LightWtProfiling/Trigger:
SecondTrigger.cpp updated: 1.12 -> 1.13
---
Log message:
Move forward decls to SecondTrigger.h.
Include Globals.h and SecondTrigger.h to pull in extern & forward decls instead
of declaring them here.
Move optimizeTrace to RuntimeOptimizations.cpp.
---
Diffs of the changes:
Index: llvm/lib/Reoptimizer/LightWtProfiling/Trigger/SecondTrigger.cpp
diff -u llvm/lib/Reoptimizer/LightWtProfiling/Trigger/SecondTrigger.cpp:1.12 llvm/lib/Reoptimizer/LightWtProfiling/Trigger/SecondTrigger.cpp:1.13
--- llvm/lib/Reoptimizer/LightWtProfiling/Trigger/SecondTrigger.cpp:1.12 Mon Aug 11 14:08:46 2003
+++ llvm/lib/Reoptimizer/LightWtProfiling/Trigger/SecondTrigger.cpp Tue Aug 12 22:07:16 2003
@@ -9,7 +9,9 @@
//===----------------------------------------------------------------------===//
#include "GetTimer.h"
+#include "SecondTrigger.h"
#include "RegSaveRestore.h"
+#include "Globals.h"
#include "scheduler.h"
#include "Timer.h"
#include "llvm/Reoptimizer/Mapping/LLVMinfo.h"
@@ -33,56 +35,16 @@
#define CALL 0x40000000
-long THRESHOLD_LEVEL_2;
-
-// If a trace selected as "hot" is exited more than a certain number
-// of times, then it will be rejected; this certain number is set to
-// 1/3 of the THRESHOLD_LEVEL_2 value.
-long LEVEL_TWO_EXITS;
-
-extern TraceCache *tr;
-extern TraceCache *tr2;
-extern VirtualMem *vm;
-extern Module *M;
-
static std::map<uint64_t, std::map<uint64_t, int> *> pathCounter;
static std::map<uint64_t, int> totalCount;
+static std::map<uint64_t, int> exitCounter;
+static std::map<uint64_t, pair<long, long> > backOffCounters;
extern "C" void llvm_first_trigger(int *cnt);
+extern void optimizeTrace (vector<BasicBlock *> &vBB, uint64_t a);
-// Forward declarations
-void generateTraces(uint64_t start, uint64_t end,
- std::vector<uint64_t> &paths,
- uint64_t firstLevelTraceStartAddr);
-void getReturnCode(vector<unsigned int> &traces, int &index,
- uint64_t ret);
-void getBranchExitCode(std::vector<unsigned int> &instVec,
- std::map<int, uint64_t> &branchMap,
- std::map<int, uint64_t> &targetMap,
- std::map<int, uint64_t> &callMap);
-
-std::map<uint64_t, int> exitCounter;
-std::map<uint64_t, uint64_t> firstTriggerAddr; //tracestart addr
-std::map<uint64_t, pair<long, long> > backOffCounters;
-
-/// 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 (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
-}
-
+std::map<uint64_t, uint64_t> firstTriggerAddr;
+
extern "C" void llvm_time_start(){
#ifdef __sparc
cpc_count_usr_events(1);
More information about the llvm-commits
mailing list