Skip to content

Commit 2198d71

Browse files
committed
Remove -debug-time-compilation
This flag no longer does anything now that the unified statistics reporting infrastructure exists. It is better to use -driver-time-compilation to see a bird's eye view of timing statistics for frontend jobs, and -stats-output-dir to see a down-and-dirty view of everything including performance counters.
1 parent 5141219 commit 2198d71

File tree

5 files changed

+2
-41
lines changed

5 files changed

+2
-41
lines changed

docs/CompilerPerformance.md

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -559,30 +559,6 @@ compilers on hand while you're working.
559559
0.0001 (100.0%) 0.0001 (100.0%) 0.0001 (100.0%) 0.0490 (100.0%) Total
560560
```
561561
562-
- `-Xfrontend -debug-time-compilation`: asks each frontend to print out timers
563-
for each phase of its execution. Its output (per-frontend) looks like this:
564-
565-
```
566-
===-------------------------------------------------------------------------===
567-
Swift compilation
568-
===-------------------------------------------------------------------------===
569-
Total Execution Time: 0.0876 seconds (0.0877 wall clock)
570-
571-
---User Time--- --System Time-- --User+System-- ---Wall Time--- --- Name ---
572-
0.0241 ( 53.9%) 0.0394 ( 92.0%) 0.0635 ( 72.5%) 0.0635 ( 72.5%) Import resolution
573-
0.0170 ( 38.0%) 0.0025 ( 5.8%) 0.0195 ( 22.3%) 0.0195 ( 22.2%) Type checking / Semantic analysis
574-
0.0013 ( 3.0%) 0.0004 ( 0.8%) 0.0017 ( 1.9%) 0.0017 ( 1.9%) LLVM output
575-
0.0010 ( 2.3%) 0.0003 ( 0.7%) 0.0013 ( 1.5%) 0.0013 ( 1.5%) SILGen
576-
0.0006 ( 1.4%) 0.0002 ( 0.4%) 0.0008 ( 0.9%) 0.0008 ( 0.9%) IRGen
577-
0.0004 ( 0.8%) 0.0000 ( 0.1%) 0.0004 ( 0.5%) 0.0004 ( 0.5%) SIL optimization
578-
0.0002 ( 0.5%) 0.0001 ( 0.1%) 0.0003 ( 0.3%) 0.0003 ( 0.3%) LLVM optimization
579-
0.0001 ( 0.1%) 0.0000 ( 0.1%) 0.0001 ( 0.1%) 0.0001 ( 0.1%) Parsing
580-
0.0000 ( 0.0%) 0.0000 ( 0.0%) 0.0000 ( 0.0%) 0.0000 ( 0.0%) SIL verification (pre-optimization)
581-
0.0000 ( 0.0%) 0.0000 ( 0.0%) 0.0000 ( 0.0%) 0.0000 ( 0.0%) SIL verification (post-optimization)
582-
0.0000 ( 0.0%) 0.0000 ( 0.0%) 0.0000 ( 0.0%) 0.0000 ( 0.0%) AST verification
583-
0.0448 (100.0%) 0.0428 (100.0%) 0.0876 (100.0%) 0.0877 (100.0%) Total
584-
```
585-
586562
- `-Xfrontend -debug-time-function-bodies`: asks each frontend to print out
587563
the time spent typechecking _every function_ in the program, sorted by time
588564
taken. The output is therefore voluminous, but can help when reducing a
@@ -1053,10 +1029,8 @@ getting slower between versions:
10531029
parameter of the script). Reconfirm that _just those two isolated frontend
10541030
processes_ still show the regression you're interested in isolating.
10551031
1056-
6. Check high-level diagnostic output between the two compilers, either the
1057-
newer unified stats reporter (`-stats-output-dir`) or the older flags
1058-
(`-Xfrontend -debug-time-compilation` and friends). Comparing the two will
1059-
often guide the search.
1032+
6. Check the value of performance counters between the two compilers via the
1033+
unified stats reporter (`-stats-output-dir`).
10601034
10611035
7. Run both frontend processes under a profiler and compare the profiles in
10621036
detail. At this point there ought to be _some_ sign of a difference, either

include/swift/Frontend/FrontendOptions.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,6 @@ class FrontendOptions {
161161
/// If set, dumps wall time taken to check each expression.
162162
bool DebugTimeExpressionTypeChecking = false;
163163

164-
/// If set, prints the time taken in each major compilation phase to
165-
/// llvm::errs().
166-
///
167-
/// \sa swift::SharedTimer
168-
bool DebugTimeCompilation = false;
169-
170164
/// The path to which we should output statistics files.
171165
std::string StatsOutputDir;
172166

include/swift/Option/FrontendOptions.td

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,6 @@ def build_request_dependency_graph : Flag<["-"], "build-request-dependency-graph
259259
def output_request_graphviz : Separate<["-"], "output-request-graphviz">,
260260
HelpText<"Emit GraphViz output visualizing the request dependency graph">;
261261

262-
def debug_time_compilation : Flag<["-"], "debug-time-compilation">,
263-
HelpText<"Prints the time taken by each compilation phase">;
264262
def debug_time_function_bodies : Flag<["-"], "debug-time-function-bodies">,
265263
HelpText<"Dumps the time it takes to type-check each function body">;
266264
def debug_time_expression_type_checking : Flag<["-"], "debug-time-expression-type-checking">,

lib/Frontend/ArgsToFrontendOptionsConverter.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,6 @@ void ArgsToFrontendOptionsConverter::computePrintStatsOptions() {
234234

235235
void ArgsToFrontendOptionsConverter::computeDebugTimeOptions() {
236236
using namespace options;
237-
Opts.DebugTimeCompilation |= Args.hasArg(OPT_debug_time_compilation);
238-
239237
if (const Arg *A = Args.getLastArg(OPT_stats_output_dir)) {
240238
Opts.StatsOutputDir = A->getValue();
241239
if (Args.getLastArg(OPT_trace_stats_events)) {

lib/FrontendTool/FrontendTool.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2232,9 +2232,6 @@ int swift::performFrontend(ArrayRef<const char *> Args,
22322232
PDC.setFormattingStyle(
22332233
Invocation.getDiagnosticOptions().PrintedFormattingStyle);
22342234

2235-
if (Invocation.getFrontendOptions().DebugTimeCompilation)
2236-
SharedTimer::enableCompilationTimers();
2237-
22382235
if (Invocation.getFrontendOptions().PrintStats) {
22392236
llvm::EnableStatistics();
22402237
}

0 commit comments

Comments
 (0)