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

Unified Diff: src/llvm2ice.cpp

Issue 620373004: Subzero: Add a few performance measurement tools. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Minor fixes Created 6 years, 2 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/IceTimerTree.h ('K') | « src/PNaClTranslator.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/llvm2ice.cpp
diff --git a/src/llvm2ice.cpp b/src/llvm2ice.cpp
index f95c02eef428d02cd39c3d939639007df7096b23..c3ffbbfba069717e15be6405fda24c4d7b7be997 100644
--- a/src/llvm2ice.cpp
+++ b/src/llvm2ice.cpp
@@ -95,8 +95,22 @@ static cl::opt<bool> SubzeroTimingEnabled(
"timing", cl::desc("Enable breakdown timing of Subzero translation"));
static cl::opt<bool>
- DisableGlobals("disable-globals",
- cl::desc("Disable global initializer translation"));
+TimeEachFunction("timing-funcs",
+ cl::desc("Print total translation time for each function"));
+
+static cl::opt<std::string> TimingFocusOn(
+ "timing-focus",
+ cl::desc("Break down timing for a specific function (use '*' for all)"),
+ cl::init(""));
+
+static cl::opt<std::string> VerboseFocusOn(
+ "verbose-focus",
+ cl::desc("Temporarily enable full verbosity for a specific function"),
+ cl::init(""));
+
+static cl::opt<bool>
+DisableGlobals("disable-globals",
+ cl::desc("Disable global initializer translation"));
// This is currently unused, and is a placeholder for lit tests.
static cl::opt<bool>
@@ -169,8 +183,11 @@ int main(int argc, char **argv) {
Flags.UseIntegratedAssembler = UseIntegratedAssembler;
Flags.UseSandboxing = UseSandboxing;
Flags.DumpStats = DumpStats;
+ Flags.TimeEachFunction = TimeEachFunction;
Flags.DefaultGlobalPrefix = DefaultGlobalPrefix;
Flags.DefaultFunctionPrefix = DefaultFunctionPrefix;
+ Flags.TimingFocusOn = TimingFocusOn;
+ Flags.VerboseFocusOn = VerboseFocusOn;
Ice::GlobalContext Ctx(Ls, Os, VMask, TargetArch, OptLevel, TestPrefix,
Flags);
@@ -199,6 +216,10 @@ int main(int argc, char **argv) {
Converter.convertToIce();
ErrorStatus = Converter.getErrorStatus();
}
+ if (TimeEachFunction) {
+ const bool DumpCumulative = false;
+ Ctx.dumpTimers(Ice::GlobalContext::TSK_Funcs, DumpCumulative);
+ }
if (SubzeroTimingEnabled)
Ctx.dumpTimers();
const bool FinalStats = true;
« src/IceTimerTree.h ('K') | « src/PNaClTranslator.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698