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

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: Improve the use of containers 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
« no previous file with comments | « 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..f392b7ef9baacd1073df55d76257140295afbc5b 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,13 +183,15 @@ 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);
- static Ice::TimerIdT IDszmain = Ice::GlobalContext::getTimerID("szmain");
- Ice::TimerMarker T(IDszmain, &Ctx);
+ Ice::TimerMarker T(Ice::TimerStack::TT_szmain, &Ctx);
int ErrorStatus = 0;
if (BuildOnRead) {
@@ -185,8 +201,7 @@ int main(int argc, char **argv) {
} else {
// Parse the input LLVM IR file into a module.
SMDiagnostic Err;
- static Ice::TimerIdT IDparse = Ice::GlobalContext::getTimerID("parse");
- Ice::TimerMarker T1(IDparse, &Ctx);
+ Ice::TimerMarker T1(Ice::TimerStack::TT_parse, &Ctx);
Module *Mod =
NaClParseIRFile(IRFilename, InputFileFormat, Err, getGlobalContext());
@@ -199,6 +214,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;
« no previous file with comments | « src/PNaClTranslator.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698