Subzero: Rewrite the pass timing infrastructure. This makes it much more useful for individual analysis and long-term translation performance tracking. 1. Collect and report aggregated across the entire translation, instead of function-by-function. If you really care about a single function, just extract it and translate it separately for analysis. 2. Remove "-verbose time" and just use -timing. 3. Collects two kinds of timings: cumulative and flat. Cumulative measures the total time, even if a callee also times itself. Flat only measures the currently active timer at the top of the stack. The flat times should add up to 100%, but cumulative will usually add up to much more than 100%. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/610813002
diff --git a/src/IceTranslator.cpp b/src/IceTranslator.cpp index e0c7e2d..91dcfd4 100644 --- a/src/IceTranslator.cpp +++ b/src/IceTranslator.cpp
@@ -12,12 +12,11 @@ // //===----------------------------------------------------------------------===// -#include "IceTranslator.h" - #include "IceCfg.h" #include "IceClFlags.h" #include "IceDefs.h" #include "IceTargetLowering.h" +#include "IceTranslator.h" #include "llvm/IR/Module.h" #include "llvm/IR/Constant.h" #include "llvm/IR/Constants.h" @@ -80,24 +79,13 @@ if (Ctx->getFlags().DisableTranslation) { Func->dump(); } else { - Timer TTranslate; Func->translate(); - if (Ctx->getFlags().SubzeroTimingEnabled) { - std::cerr << "[Subzero timing] Translate function " - << Func->getFunctionName() << ": " << TTranslate.getElapsedSec() - << " sec\n"; - } if (Func->hasError()) { std::cerr << "ICE translation error: " << Func->getError() << "\n"; ErrorStatus = true; } - Timer TEmit; Func->emit(); - if (Ctx->getFlags().SubzeroTimingEnabled) { - std::cerr << "[Subzero timing] Emit function " << Func->getFunctionName() - << ": " << TEmit.getElapsedSec() << " sec\n"; - } Ctx->dumpStats(Func->getFunctionName()); } }