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

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: Addresses comments. 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.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..bacaec390541720bebf904425d9e2c8472f9bfa3 100644
--- a/src/IceGlobalContext.cpp
+++ b/src/IceGlobalContext.cpp
@@ -258,11 +258,14 @@ 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 (const auto MemUsed = static_cast<size_t>(
+ llvm::TimeRecord::getCurrentTime(false).getMemUsed())) {
+ static constexpr size_t _1MB = 1024 * 1024;
+ Str << (MemUsed / _1MB) << " MB";
+ } else {
Str << "(requires '-track-memory')";
+ }
Str << "\n";
Str << "|" << Name << "|CPool Sizes ";
{
@@ -279,7 +282,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";
}
}
« no previous file with comments | « src/IceCfg.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698