@@ -548,10 +548,17 @@ it's quite easy to do this manually:
548
548
549
549
a. Add the compiler option ``-Xllvm -sil-opt-pass-count=<n> ``, where ``<n> ``
550
550
is the number of optimizations to run.
551
- b. Bisect: find n where the executable crashes, but does not crash with n-1.
552
- Note that n can be quite large, e.g. > 100000 (just try
553
- n = 10, 100, 1000, 10000, etc. to find an upper bound).
554
- c. Add another option ``-Xllvm -sil-print-pass-name ``. The output can be
551
+
552
+ b. Bisect: find n where the executable crashes, but does not crash
553
+ with n-1. First just try n = 10, 100, 1000, 10000, etc. to find
554
+ an upper bound). Then can either bisect the invocation by hand or
555
+ place the invocation into a script and use
556
+ ``./llvm-project/llvm/utils/bisect `` to automatically bisect
557
+ based on the scripts error code. Example invocation::
558
+
559
+ bisect --start=0 --end=10000 ./invoke_swift_passing_N.sh "%(count)s"
560
+
561
+ c. Once one finds ``n ``, Add another option ``-Xllvm -sil-print-pass-name ``. The output can be
555
562
large, so it's best to redirect stderr to a file (``2> output ``).
556
563
In the output search for the last pass before ``stage Address Lowering ``.
557
564
It should be the ``Run #<n-1> ``. This line tells you the name of the bad
0 commit comments