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/IceGlobalContext.cpp

Issue 795063003: Subzero: Add memory usage to "-szstats" output. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 6 years 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/IceGlobalContext.h ('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 84d7b685b75bc3b08833f7e12fa0420b36d5c928..2903ddedc82fef6b1fc872e62fec46969b0dd89a 100644
--- a/src/IceGlobalContext.cpp
+++ b/src/IceGlobalContext.cpp
@@ -16,6 +16,8 @@
#include <locale> // locale
#include <unordered_map>
+#include "llvm/Support/Timer.h"
+
#include "IceCfg.h"
#include "IceClFlags.h"
#include "IceDefs.h"
@@ -105,6 +107,23 @@ public:
UndefPool Undefs;
};
+void CodeStats::dump(const IceString &Name, Ostream &Str) {
+ if (!ALLOW_DUMP)
+ return;
+ Str << "|" << Name << "|Inst Count |" << InstructionsEmitted << "\n";
+ Str << "|" << Name << "|Regs Saved |" << RegistersSaved << "\n";
+ Str << "|" << Name << "|Frame Bytes |" << FrameBytes << "\n";
+ Str << "|" << Name << "|Spills |" << Spills << "\n";
+ Str << "|" << Name << "|Fills |" << Fills << "\n";
+ Str << "|" << Name << "|Spills+Fills|" << Spills + Fills << "\n";
+ Str << "|" << Name << "|Memory Usage|";
+ if (ssize_t MemUsed = llvm::TimeRecord::getCurrentTime(false).getMemUsed())
+ Str << MemUsed;
+ else
+ Str << "(requires '-track-memory')";
+ Str << "\n";
+}
+
GlobalContext::GlobalContext(Ostream *OsDump, Ostream *OsEmit,
ELFStreamer *ELFStr, VerboseMask Mask,
TargetArch Arch, OptLevel Opt,
« no previous file with comments | « src/IceGlobalContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698