Skip to content

Commit 49f1224

Browse files
committed
[SYCL][Doc] Tweak debugging docs
1 parent 7557ef4 commit 49f1224

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

sycl/doc/developer/Debugging.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ options may help:
1919
libraries (`libclc` and `libdevice`), it normally uses the compiler from the
2020
same build, but debug clang is quite slow so using a separate release clang
2121
can be worth it.
22+
- `-DLLVM_OPTIMIZED_TABLEGEN=ON`: Build the tablegen tools separately in release
23+
mode. Debug tablegen tools are quite slow so using release mode versions can
24+
significantly speed up the build.
25+
26+
For more information on any of the `LLVM_` variables, or possibly other helpful
27+
options, refer to the [LLVM CMake
28+
documentation](https://llvm.org/docs/CMake.html#llvm-related-variables).
2229

2330
## Tracing the SYCL runtime
2431

@@ -33,7 +40,8 @@ the SYCL runtime, which can help understand runtime behavior:
3340

3441
### Clang Driver
3542

36-
- `-###`: Prints each command emitted by the clang driver during compilation.
43+
- `-###`: Prints each command emitted by the clang driver during compilation
44+
without running them.
3745
- Can be used to manually replay a compilation command step-by-step to narrow
3846
down where a crash happened.
3947

@@ -42,7 +50,8 @@ the SYCL runtime, which can help understand runtime behavior:
4250
LLVM has a number of ways to debug LLVM IR passes and lower, the following
4351
options illustrate a few of them:
4452

45-
- `-save-temps`: Dump all compilation intermediary files.
53+
- `-save-temps`: Dump all compilation intermediary files. Adding `-v` will also
54+
print the sub-commands generating the intermediary files.
4655
- `-mllvm -print-after-all`: Dump modules before and after each pass of the compilation pipeline
4756
- Often produces a huge amount of data but can be helpful to track down where
4857
something is introduced in the IR or assembly.
@@ -60,8 +69,10 @@ options illustrate a few of them:
6069
- In LLVM it can be defined as follows `#define DEBUG_TYPE "regalloc"`, this
6170
hooks into `-debug-only` allowing you to enable debug output for the pass
6271
defined in that file and any other that uses the same string as
63-
`DEBUG_TYPE`. For example `-mllvm -debug-only=regalloc` will enable
64-
debug output for all the register allocation passes.
72+
`DEBUG_TYPE`. For example `-mllvm -debug-only=regalloc` will enable debug
73+
output for all the register allocation passes. For more details on this
74+
refer to the [LLVM
75+
documentation](https://www.llvm.org/docs/ProgrammersManual.html#the-llvm-debug-macro-and-debug-option).
6576

6677
## Extracting device code
6778

0 commit comments

Comments
 (0)