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

Unified Diff: src/IceCfg.cpp

Issue 1784243006: Subzero: Improve the use of timers. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review changes Created 4 years, 9 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/IceCfg.h ('k') | src/IceCompiler.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceCfg.cpp
diff --git a/src/IceCfg.cpp b/src/IceCfg.cpp
index a44e6b3b4a8a125149150e7ed4326eeaf4e92969..c3d91e65c3f3d24a283a2cfefbe4fcab6469693b 100644
--- a/src/IceCfg.cpp
+++ b/src/IceCfg.cpp
@@ -187,9 +187,6 @@ void Cfg::addCallToProfileSummary() {
void Cfg::translate() {
if (hasError())
return;
- // FunctionTimer conditionally pushes/pops a TimerMarker if TimeEachFunction
- // is enabled.
- std::unique_ptr<TimerMarker> FunctionTimer;
if (BuildDefs::dump()) {
const IceString &TimingFocusOn =
getContext()->getFlags().getTimingFocusOn();
@@ -199,15 +196,12 @@ void Cfg::translate() {
getContext()->resetTimer(GlobalContext::TSK_Default);
getContext()->setTimerName(GlobalContext::TSK_Default, Name);
}
- if (getContext()->getFlags().getTimeEachFunction())
- FunctionTimer.reset(new TimerMarker(
- getContext()->getTimerID(GlobalContext::TSK_Funcs, Name),
- getContext(), GlobalContext::TSK_Funcs));
if (isVerbose(IceV_Status)) {
getContext()->getStrDump() << ">>>Translating "
<< getFunctionNameAndSize() << "\n";
}
}
+ TimerMarker T_func(getContext(), getFunctionName());
TimerMarker T(TimerStack::TT_translate, this);
dump("Initial CFG");
@@ -573,6 +567,7 @@ void Cfg::sortAndCombineAllocas(CfgVector<Inst *> &Allocas,
}
void Cfg::processAllocas(bool SortAndCombine) {
+ TimerMarker _(TimerStack::TT_alloca, this);
const uint32_t StackAlignment = getTarget()->getStackAlignment();
CfgNode *EntryNode = getEntryNode();
// LLVM enforces power of 2 alignment.
@@ -1083,14 +1078,14 @@ size_t Cfg::getTotalMemoryMB() {
}
// Dumps the IR with an optional introductory message.
-void Cfg::dump(const IceString &Message) {
+void Cfg::dump(const char *Message) {
if (!BuildDefs::dump())
return;
if (!isVerbose())
return;
OstreamLocker L(Ctx);
Ostream &Str = Ctx->getStrDump();
- if (!Message.empty())
+ if (Message[0])
Str << "================ " << Message << " ================\n";
if (isVerbose(IceV_Mem)) {
Str << "Memory size = " << getTotalMemoryMB() << " MB\n";
« no previous file with comments | « src/IceCfg.h ('k') | src/IceCompiler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698