Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Unified Diff: src/IceConverter.cpp

Issue 620373004: Subzero: Add a few performance measurement tools. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Improve the use of containers Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceClFlags.h ('k') | src/IceDefs.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceConverter.cpp
diff --git a/src/IceConverter.cpp b/src/IceConverter.cpp
index df64cff9ab92db0510b3630fac16f60a81c98cea..cdb0052972bd68205fd7237f85de4e81b7a2708f 100644
--- a/src/IceConverter.cpp
+++ b/src/IceConverter.cpp
@@ -59,15 +59,13 @@ public:
// Caller is expected to delete the returned Ice::Cfg object.
Ice::Cfg *convertFunction(const Function *F) {
- static Ice::TimerIdT IDllvmConvert =
- Ice::GlobalContext::getTimerID("llvmConvert");
- Ice::TimerMarker T(IDllvmConvert, Ctx);
VarMap.clear();
NodeMap.clear();
Func = new Ice::Cfg(Ctx);
Func->setFunctionName(F->getName());
Func->setReturnType(convertToIceType(F->getReturnType()));
Func->setInternal(F->hasInternalLinkage());
+ Ice::TimerMarker T(Ice::TimerStack::TT_llvmConvert, Func);
// The initial definition/use of each arg is the entry node.
for (auto ArgI = F->arg_begin(), ArgE = F->arg_end(); ArgI != ArgE;
@@ -617,8 +615,7 @@ private:
namespace Ice {
void Converter::convertToIce() {
- static TimerIdT IDconvertToIce = GlobalContext::getTimerID("convertToIce");
- TimerMarker T(IDconvertToIce, Ctx);
+ TimerMarker T(TimerStack::TT_convertToIce, Ctx);
nameUnnamedGlobalAddresses(Mod);
if (!Ctx->getFlags().DisableGlobals)
convertGlobals(Mod);
@@ -626,13 +623,21 @@ void Converter::convertToIce() {
}
void Converter::convertFunctions() {
+ TimerStackIdT StackID = GlobalContext::TSK_Funcs;
for (const Function &I : *Mod) {
if (I.empty())
continue;
+ TimerIdT TimerID = 0;
+ if (Ctx->getFlags().TimeEachFunction) {
+ TimerID = Ctx->getTimerID(StackID, I.getName());
+ Ctx->pushTimer(TimerID, StackID);
+ }
LLVM2ICEConverter FunctionConverter(Ctx, Mod->getContext());
Cfg *Fcn = FunctionConverter.convertFunction(&I);
translateFcn(Fcn);
+ if (Ctx->getFlags().TimeEachFunction)
+ Ctx->popTimer(TimerID, StackID);
}
emitConstants();
« no previous file with comments | « src/IceClFlags.h ('k') | src/IceDefs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698