Skip to content

Commit 04a6bbb

Browse files
committed
docs: add documentation for the -sil-pass-count-config-file option in DebuggingTheCompiler
Also, add this option in swift-autocomplete.bash. Unrelated: support aliased commands in swift-autocomplete.bash
1 parent 3669b90 commit 04a6bbb

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

docs/DebuggingTheCompiler.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,11 @@ it's quite easy to do this manually:
738738
the sub-pass number. The option `-Xllvm -sil-opt-pass-count=<n>.<m>`
739739
can be used for that, where `m` is the sub-pass number.
740740

741+
For bisecting pass counts in large projects, the pass counts can be read from
742+
a configuration file using the `-Xllvm -sil-pass-count-config-file=<file>`
743+
option. For details see the comment for `SILPassCountConfigFile` in the pass
744+
manager sources.
745+
741746
### Using git-bisect in the presence of branch forwarding/feature branches
742747

743748
`git-bisect` is a useful tool for finding where a regression was

lib/SILOptimizer/PassManager/PassManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ llvm::cl::opt<std::string> SILNumOptPassesToRun(
7171

7272
// Read pass counts for each module from a config file.
7373
// Config file format:
74-
// <module-name>:<pass-count>(.<sub-pass-count>)
74+
// <module-name>:<pass-count>(.<sub-pass-count>)?
7575
//
7676
// This is useful for bisecting passes in large projects:
7777
// 1. create a config file from a full build log. E.g. with

utils/swift-autocomplete.bash

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ _swift_complete()
88
local tool currentWord prevWord
99

1010
tool="${COMP_WORDS[0]}"
11+
if alias "$tool" >/dev/null; then
12+
tool=`alias "$tool" | sed "s/.*'\\(.*\\)'.*/\\1/"`
13+
fi
14+
1115
currentWord="${COMP_WORDS[COMP_CWORD]}"
1216
prevWord="${COMP_WORDS[COMP_CWORD-1]}"
1317

@@ -92,6 +96,7 @@ _swift_complete()
9296
-sil-lower-agg-instrs-expand-all \
9397
-sil-merge-stack-slots \
9498
-sil-opt-pass-count \
99+
-sil-pass-count-config-file \
95100
-sil-opt-remark-ignore-always-infer \
96101
-sil-optimized-access-markers \
97102
-sil-ownership-verifier-enable-testing \

0 commit comments

Comments
 (0)