Skip to content

Commit 655607c

Browse files
varev-devigcbot
authored andcommitted
Document shader dump products overridability
Added 'Overridable' column to the dump products reference table. Documented which dump product can be overriden via ShaderOverride. Listed overridable products from recompilation outputs.
1 parent ac083ed commit 655607c

File tree

1 file changed

+26
-13
lines changed

1 file changed

+26
-13
lines changed

documentation/shader_dumps_instruction.md

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@ To compile a standalone `*.cl` shader file use `ocloc` compiler frontend executa
2424

2525
Shader dumps include (in order of creation):
2626

27-
| Product | Description |
28-
|-|-|
29-
| `*.cl` file | Original shader file. Passed to `clang` wrapped with `opencl-clang`. |
30-
| `*.spv` file | SPIR-V binary produced by `opencl-clang`. Passed to IGC's baked-in [SPIRVReader](https://github.com/intel/intel-graphics-compiler/blob/master/IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp). |
31-
| `*.spvasm` file | Disassembled SPIR-V binary only for debugging purposes. |
32-
| `*_beforeUnification.ll` file | Result of `*.spv` translation. Start of IGC compilation. |
33-
| `*_afterUnification.ll` file | Result of all unification passes. |
34-
| `*_optimized.ll` file | Result of all optimization passes. |
35-
| `*_codegen.ll` file | Result of all codegen passes. |
36-
| `*.visa.ll` files | Mappings between LLVM IR ↔ vISA. May not be legal LLVM IR representation. |
37-
| `*.visaasm` files | vISA assembly file. |
38-
| `*.asm` files | Kernels in assembly form. |
39-
| `*.isa` files | Kernels' binaries. |
27+
| Product | Description | Overridable |
28+
|-|-|-|
29+
| `*.cl` file | Original shader file. Passed to `clang` wrapped with `opencl-clang`. | Skip |
30+
| `*.spv` file | SPIR-V binary produced by `opencl-clang`. Passed to IGC's baked-in [SPIRVReader](https://github.com/intel/intel-graphics-compiler/blob/master/IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp). | Skip |
31+
| `*.spvasm` file | Disassembled SPIR-V binary only for debugging purposes. | Skip |
32+
| `*_beforeUnification.ll` file | Result of `*.spv` translation. Start of IGC compilation. | Yes |
33+
| `*_afterUnification.ll` file | Result of all unification passes. | Yes |
34+
| `*_optimized.ll` file | Result of all optimization passes. | Yes |
35+
| `*_codegen.ll` file | Result of all codegen passes. | Crash |
36+
| `*.visa.ll` files | Mappings between LLVM IR ↔ vISA. May not be legal LLVM IR representation. | Skip |
37+
| `*.visaasm` files | vISA assembly file. | Yes |
38+
| `*.asm` files | Kernels in assembly form. | Yes |
39+
| `*.isa` files | Kernels' binaries. | Skip |
4040

4141
There are also additional products that are not a part of compilation pipeline:
4242

@@ -48,6 +48,13 @@ There are also additional products that are not a part of compilation pipeline:
4848
#### Notes
4949
1. There is a separate SPIR-V translator for `*.cl` → `*.spv` translation (`opencl-clang`'s) and another for `*.spv` → `*.ll` translation (baked into into IGC).
5050
2. vISA is an intermediate language for IGC backend.
51+
3. Values in the *Overridable* column indicate how the ShaderOverride mechanism treats each dump product:
52+
| Value | Meaning |
53+
| - | - |
54+
| Yes | The dump can be successfully overridden. |
55+
| Crash | IGC detects the override attempt and tries to apply it, but **the process results in a crash**. |
56+
| Skip | IGC **does not attempt to override** the product. Dumps with this status are ignored by the ShaderOverride mechanism. |
57+
4. Main dump products generated during recompilation are distinguished by an additional numeric identifier in the filename (for example: `*_1_beforeUnification.ll`). Hovever, individual compilation passes continue their numbering sequence (for example the first unification pass may start from `*_0321_Unify_after_PreprocessSPVIR.ll`).
5158

5259
### Additional options
5360

@@ -158,6 +165,12 @@ To enable overrides you need to set an environmental variable:
158165
export IGC_ShaderOverride=1
159166
```
160167

168+
### Overridable and Non-Overridable dumps
169+
170+
1. **Main dump products** that can be overridden are explicitly marked in the reference table (see the *Overridable* column in [List of dump products](#list-of-dump-products)).
171+
2. Passes that occur between main dump products **cannot be overridden** (for example: `*_after_DeadCodeElimination.ll`).
172+
3. Among **recompilation outputs**, only `.visaasm` and `.asm` dumps **can be successfully overridden** without causing a crash. Rest of the products are going to cause a crash during overriding attempt.
173+
161174
### Overriding dumps
162175

163176
To inject a dump into a compilation pipeline:

0 commit comments

Comments
 (0)