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

Unified Diff: src/IceGlobalContext.cpp

Issue 1850163003: Subzero. Outputs liveness memory usage. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fixes make presubmit 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
« src/IceCfg.h ('K') | « src/IceCfg.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceGlobalContext.cpp
diff --git a/src/IceGlobalContext.cpp b/src/IceGlobalContext.cpp
index b85b470cf10dd8a354bf0143228496c778511ca4..42d26f7c1eb1b2ec68b5614d142dcbf756cd8352 100644
--- a/src/IceGlobalContext.cpp
+++ b/src/IceGlobalContext.cpp
@@ -258,11 +258,13 @@ void GlobalContext::CodeStats::dump(const Cfg *Func, GlobalContext *Ctx) {
#undef X
Str << "|" << Name << "|Spills+Fills|"
<< Stats[CS_NumSpills] + Stats[CS_NumFills] << "\n";
- Str << "|" << Name << "|Memory Usage|";
- if (ssize_t MemUsed = llvm::TimeRecord::getCurrentTime(false).getMemUsed())
- Str << MemUsed;
- else
+ Str << "|" << Name << "|Memory Usage |";
+ if (ssize_t MemUsed = llvm::TimeRecord::getCurrentTime(false).getMemUsed()) {
+ static constexpr size_t _1MB = 1024 * 1024;
Jim Stichnoth 2016/04/01 15:22:34 So this got me thinking, why were we seeing seeing
John 2016/04/01 18:05:51 Done.
+ Str << (MemUsed / _1MB) << " MB";
+ } else {
Str << "(requires '-track-memory')";
+ }
Str << "\n";
Str << "|" << Name << "|CPool Sizes ";
{
@@ -279,7 +281,9 @@ void GlobalContext::CodeStats::dump(const Cfg *Func, GlobalContext *Ctx) {
}
Str << "\n";
if (Func != nullptr) {
- Str << "|" << Name << "|Cfg Memory |" << Func->getTotalMemoryMB()
+ Str << "|" << Name << "|Cfg Memory |" << Func->getTotalMemoryMB()
+ << " MB\n";
+ Str << "|" << Name << "|Liveness Memory |" << Func->getLivenessMemoryMB()
<< " MB\n";
}
}
« src/IceCfg.h ('K') | « src/IceCfg.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698