diff options
| author | MoonEyes <ducoinbenjamin@yahoo.fr> | 2026-11-30 17:02:39 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-11-30 17:02:39 +0100 |
| commit | e324ad55edb4ad2effbab85e034c59abbc54e712 (patch) | |
| tree | ab138a180c41f28e8645fe3d52b9bf54cd242454 /docs | |
| parent | c663c2a85e41a6e720bf50747d0e28720ef482f7 (diff) | |
| parent | 57f3a3c1c5b15d50872f1afd3a769f7a10960855 (diff) | |
Merge pull request #2720 from OreoFR/carry/pr-2093
reprend #2093: spirv_opt: scalar-replace surviving static Function arrays (SHADER-SPIRV-OPT-SROA)
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/design.md | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/docs/design.md b/docs/design.md index ad009712e..bef2bf4f3 100644 --- a/docs/design.md +++ b/docs/design.md | |||
| @@ -242,10 +242,12 @@ could overflow to inf), and pixel interpolation (`v_interp_p1/p2/mov` become fra | |||
| 242 | location). MODE writes (`s_setreg`) model the f16/f64 rounding field, FP_ROUND[3:2], the only MODE field the | 242 | location). MODE writes (`s_setreg`) model the f16/f64 rounding field, FP_ROUND[3:2], the only MODE field the |
| 243 | corpus writes; other MODE writes are refused (see Known approximations). | 243 | corpus writes; other MODE writes are refused (see Known approximations). |
| 244 | 244 | ||
| 245 | `--opt` is off by default and runs a basic-block peephole pass, `tools/spirv_opt.py`, over the emitted | 245 | `--opt` is off by default and runs a dominator-tree SPIR-V optimizer, `tools/spirv_opt.py`, over the emitted |
| 246 | module before it is assembled: register store-to-load forwarding, `OpAccessChain` CSE, dead-store | 246 | module before it is assembled: register store-to-load forwarding, `OpAccessChain` CSE, dead-store |
| 247 | elimination, `OpSelect`/`OpCopyObject` folding and DCE. Only Function-scope variables that do not escape | 247 | elimination, `OpSelect`/`OpCopyObject` folding, DCE, and Scalar Replacement of Aggregates (SROA) splitting |
| 248 | are tracked, and a variable with any dynamic index is excluded from whole-function dead-slot elimination. | 248 | surviving non-escaped, statically indexed Function-scope arrays (`%vgpr[256]`, `%sgpr[128]`) into per-slot |
| 249 | scalar `OpVariable`s. Only Function-scope variables that do not escape are tracked, and a variable with any | ||
| 250 | dynamic index (`v_movrel*`/`s_movrel*`) is excluded from whole-function dead-slot elimination and SROA. | ||
| 249 | 251 | ||
| 250 | Measured on five hand-written pixel fixtures from `tests/semantic/fixtures/disasm`, with every result still | 252 | Measured on five hand-written pixel fixtures from `tests/semantic/fixtures/disasm`, with every result still |
| 251 | passing `spirv-val --target-env vulkan1.2`: `ps_ops` 76→33 instructions and 7,876→4,516 bytes, `ps_flat` | 253 | passing `spirv-val --target-env vulkan1.2`: `ps_ops` 76→33 instructions and 7,876→4,516 bytes, `ps_flat` |