Commit cbffcb7
committed
Ignore ordinary stores when trimming VariablePointers
VariablePointers is needed when the final module still uses pointer values as first-class SSA objects. A plain OpStore stores through a pointer. It does not by itself prove that the module still needs VariablePointers.
The SPIR-V OpStore definition distinguishes the pointer to store through from the object being stored. The variable pointer rules separately constrain cases where a pointer is the Object operand of OpStore or the result of OpLoad. An ordinary StorageBuffer store of a non-pointer object should therefore not keep VariablePointers alive on its own.
Stop treating every OpStore as a capability requirement and add a regression test for a normal StorageBuffer store that should trim the stale capability.
Spec references:
https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#OpStore
https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#VariablePointers1 parent f5339a9 commit cbffcb7
2 files changed
Lines changed: 39 additions & 1 deletion
File tree
- source/opt
- test/opt
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
252 | | - | |
253 | 252 | | |
254 | 253 | | |
255 | 254 | | |
| |||
Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
65 | 104 | | |
66 | 105 | | |
67 | 106 | | |
| |||
0 commit comments