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

Unified Diff: src/PNaClTranslator.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/IceTimerTree.def ('k') | src/llvm2ice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/PNaClTranslator.cpp
diff --git a/src/PNaClTranslator.cpp b/src/PNaClTranslator.cpp
index af78e2f3e802e3f29af026d6a9f3aa69d2762c20..f05835a17f63fa7a4506895a69094c4932ed343f 100644
--- a/src/PNaClTranslator.cpp
+++ b/src/PNaClTranslator.cpp
@@ -843,6 +843,11 @@ public:
NextLocalInstIndex(Context->getNumGlobalValueIDs()),
InstIsTerminating(false) {
Func->setFunctionName(LLVMFunc->getName());
+ if (getFlags().TimeEachFunction)
+ getTranslator().getContext()->pushTimer(
+ getTranslator().getContext()->getTimerID(
+ Ice::GlobalContext::TSK_Funcs, Func->getFunctionName()),
+ Ice::GlobalContext::TSK_Funcs);
Func->setReturnType(Context->convertToIceType(LLVMFunc->getReturnType()));
Func->setInternal(LLVMFunc->hasInternalLinkage());
CurrentNode = InstallNextBasicBlock();
@@ -1404,6 +1409,11 @@ void FunctionParser::ExitBlock() {
// for such parsing errors.
if (Context->getNumErrors() == 0)
getTranslator().translateFcn(Func);
+ if (getFlags().TimeEachFunction)
+ getTranslator().getContext()->popTimer(
+ getTranslator().getContext()->getTimerID(Ice::GlobalContext::TSK_Funcs,
+ Func->getFunctionName()),
+ Ice::GlobalContext::TSK_Funcs);
}
void FunctionParser::ReportInvalidBinaryOp(Ice::InstArithmetic::OpKind Op,
« no previous file with comments | « src/IceTimerTree.def ('k') | src/llvm2ice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698