Commit 500a1e9b authored by Kevin Modzelewski's avatar Kevin Modzelewski

Flesh out rewriter stats a little bit

parent 15230c41
...@@ -651,6 +651,9 @@ void Rewriter::abort() { ...@@ -651,6 +651,9 @@ void Rewriter::abort() {
finished = true; finished = true;
rewrite->abort(); rewrite->abort();
static StatCounter rewriter_aborts("rewriter_aborts");
rewriter_aborts.log();
for (auto v : args) { for (auto v : args) {
v->decUse(); v->decUse();
} }
...@@ -663,8 +666,8 @@ void Rewriter::commit() { ...@@ -663,8 +666,8 @@ void Rewriter::commit() {
assert(!finished); assert(!finished);
finished = true; finished = true;
static StatCounter rewriter2_commits("rewriter2_commits"); static StatCounter rewriter_commits("rewriter_commits");
rewriter2_commits.log(); rewriter_commits.log();
assert(done_guarding && "Could call setDoneGuarding for you, but probably best to do it yourself"); assert(done_guarding && "Could call setDoneGuarding for you, but probably best to do it yourself");
// if (!done_guarding) // if (!done_guarding)
...@@ -969,9 +972,9 @@ Rewriter::Rewriter(ICSlotRewrite* rewrite, int num_args, const std::vector<int>& ...@@ -969,9 +972,9 @@ Rewriter::Rewriter(ICSlotRewrite* rewrite, int num_args, const std::vector<int>&
args.push_back(var); args.push_back(var);
} }
static StatCounter rewriter_starts("rewriter2_starts"); static StatCounter rewriter_starts("rewriter_starts");
rewriter_starts.log(); rewriter_starts.log();
static StatCounter rewriter_spillsavoided("rewriter2_spillsavoided"); static StatCounter rewriter_spillsavoided("rewriter_spillsavoided");
// Calculate the list of live-ins based off the live-outs list, // Calculate the list of live-ins based off the live-outs list,
// and create a Use of them so that they get preserved // and create a Use of them so that they get preserved
...@@ -1008,13 +1011,22 @@ Rewriter::Rewriter(ICSlotRewrite* rewrite, int num_args, const std::vector<int>& ...@@ -1008,13 +1011,22 @@ Rewriter::Rewriter(ICSlotRewrite* rewrite, int num_args, const std::vector<int>&
Rewriter* Rewriter::createRewriter(void* rtn_addr, int num_args, const char* debug_name) { Rewriter* Rewriter::createRewriter(void* rtn_addr, int num_args, const char* debug_name) {
ICInfo* ic = getICInfo(rtn_addr); ICInfo* ic = getICInfo(rtn_addr);
static StatCounter rewriter_attempts("rewriter_attempts");
rewriter_attempts.log();
static StatCounter rewriter_nopatch("rewriter_nopatch"); static StatCounter rewriter_nopatch("rewriter_nopatch");
static StatCounter rewriter_skipped("rewriter_skipped");
if (!ic || !ic->shouldAttempt()) { if (!ic) {
rewriter_nopatch.log(); rewriter_nopatch.log();
return NULL; return NULL;
} }
if (!ic->shouldAttempt()) {
rewriter_skipped.log();
return NULL;
}
return new Rewriter(ic->startRewrite(debug_name), num_args, ic->getLiveOuts()); return new Rewriter(ic->startRewrite(debug_name), num_args, ic->getLiveOuts());
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment