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