Chromium Code Reviews| 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"; |
| } |
| } |