Commit 4273354
authored
[SPIR-V] Fix InterlockedMin/Max codegen (#6609)
RWByteAddressBuffer has overloads for InterlockedMin and InterlockedMax
for signed ints that were failing to compile due to mismatched types in
the generated SPIR-V instruction. This adds the missing cast if
necessary.
At the same time, some redundant code is removed from the
InterlockedMin/Max intrinsic non-member functions' codegen to modify the
opcode. If it was necessary in the past, the frontend has since been
fixed and it is no longer necessary. Tests to verify these combinations
and the necessary implicit casts have also been added.
Fixes #3196
Related to #4189, #6254, #57071 parent e61ea50 commit 4273354
3 files changed
Lines changed: 48 additions & 16 deletions
File tree
- tools/clang
- lib/SPIRV
- test/CodeGenSPIRV
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3873 | 3873 | | |
3874 | 3874 | | |
3875 | 3875 | | |
3876 | | - | |
| 3876 | + | |
| 3877 | + | |
| 3878 | + | |
| 3879 | + | |
| 3880 | + | |
| 3881 | + | |
| 3882 | + | |
| 3883 | + | |
| 3884 | + | |
| 3885 | + | |
| 3886 | + | |
| 3887 | + | |
| 3888 | + | |
| 3889 | + | |
3877 | 3890 | | |
3878 | 3891 | | |
3879 | 3892 | | |
3880 | | - | |
| 3893 | + | |
3881 | 3894 | | |
3882 | 3895 | | |
3883 | 3896 | | |
| |||
9203 | 9216 | | |
9204 | 9217 | | |
9205 | 9218 | | |
9206 | | - | |
9207 | | - | |
9208 | | - | |
9209 | | - | |
9210 | | - | |
9211 | | - | |
9212 | 9219 | | |
9213 | | - | |
9214 | | - | |
9215 | | - | |
9216 | | - | |
9217 | | - | |
9218 | | - | |
9219 | | - | |
9220 | | - | |
9221 | 9220 | | |
9222 | 9221 | | |
9223 | 9222 | | |
| |||
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
52 | 58 | | |
53 | 59 | | |
54 | 60 | | |
55 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
56 | 68 | | |
57 | 69 | | |
58 | 70 | | |
| |||
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
119 | 140 | | |
120 | 141 | | |
0 commit comments