Commit 71aec00
authored
[SPIR-V] Best effort const eval of vk::ext_literal (#6604)
If a parameter annotated with `[[vk::ext_literal]]` is not lowered to a
SpirvConstant, make a best-effort attempt to evaluate it to a constant
literal value. If unsuccessful, fail gracefully rather than crash.
Fixes #65861 parent ccdc4fd commit 71aec00
3 files changed
Lines changed: 49 additions & 2 deletions
File tree
- tools/clang
- lib/SPIRV
- test/CodeGenSPIRV
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14021 | 14021 | | |
14022 | 14022 | | |
14023 | 14023 | | |
14024 | | - | |
| 14024 | + | |
| 14025 | + | |
| 14026 | + | |
| 14027 | + | |
| 14028 | + | |
| 14029 | + | |
| 14030 | + | |
| 14031 | + | |
| 14032 | + | |
14025 | 14033 | | |
14026 | | - | |
| 14034 | + | |
14027 | 14035 | | |
14028 | 14036 | | |
14029 | 14037 | | |
| |||
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
0 commit comments