@@ -30,6 +30,8 @@ benefit of all Swift developers.
3030 - [ Debugging the Compiler using advanced LLDB Breakpoints] ( #debugging-the-compiler-using-advanced-lldb-breakpoints )
3131 - [ Debugging the Compiler using LLDB Scripts] ( #debugging-the-compiler-using-lldb-scripts )
3232 - [ Custom LLDB Commands] ( #custom-lldb-commands )
33+ - [ Debugging at LLVM Level] ( #debugging-at-llvm-level )
34+ - [ Options for Dumping LLVM IR] ( #options-for-dumping-llvm-ir )
3335 - [ Bisecting Compiler Errors] ( #bisecting-compiler-errors )
3436 - [ Bisecting on SIL optimizer pass counts to identify optimizer bugs] ( #bisecting-on-sil-optimizer-pass-counts-to-identify-optimizer-bugs )
3537 - [ Using git-bisect in the presence of branch forwarding/feature branches] ( #using-git-bisect-in-the-presence-of-branch-forwardingfeature-branches )
@@ -537,6 +539,20 @@ to define custom commands using just other lldb commands. For example,
537539
538540 (lldb) command alias cs sequence p/x $rax; stepi
539541
542+ ## Debugging at LLVM Level
543+
544+ ### Options for Dumping LLVM IR
545+
546+ Similar to SIL, one can configure LLVM to dump the llvm-ir at various points in
547+ the pipeline. Here is a quick summary of the various options:
548+
549+ * `` -Xllvm -print-before=$PASS_ID `` : Print the LLVM IR before a specified LLVM pass runs.
550+ * `` -Xllvm -print-before-all `` : Print the LLVM IR before each pass runs.
551+ * `` -Xllvm -print-after-all `` : Print the LLVM IR after each pass runs.
552+ * `` -Xllvm -filter-print-funcs=$FUNC_NAME_1,$FUNC_NAME_2,...,$FUNC_NAME_N `` :
553+ When printing IR for functions for print-[ before|after] -all options, Only
554+ print the IR for functions whose name is in this comma separated list.
555+
540556## Bisecting Compiler Errors
541557
542558### Bisecting on SIL optimizer pass counts to identify optimizer bugs
0 commit comments