| 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";
|
| }
|
| }
|
|
|