Commit 533609e
committed
[mlir][spirv] Fix LowerABIAttributesPass to generate EntryPoints for SPV1.4
- Extend the SPIRV::LowerABIAttributesPass to detect when the target env is
using SPIR-V ver >= 1.4, and in this case add all the functions' interface storage
variables to the spirv.EntryPoint calls, as required by the spec of OpEntryPoint:
"Before version 1.4, the interface’s storage classes are limited to the Input and
Output storage classes. Starting with version 1.4, the interface’s storage classes
are all storage classes used in declaring all global variables referenced by
the entry point’s call tree."
- Fix: generate the replacement ops (spirv.AddressOf and .AccessChain) in the
order in which the associated variable appears in the function signature
Signed-off-by: Fabrizio Indirli <[email protected]>1 parent 33f4f39 commit 533609e
File tree
3 files changed
+65
-32
lines changed- mlir
- lib/Dialect/SPIRV/Transforms
- test/Dialect/SPIRV/Transforms
3 files changed
+65
-32
lines changedLines changed: 19 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
88 | 91 | | |
89 | 92 | | |
90 | 93 | | |
| |||
93 | 96 | | |
94 | 97 | | |
95 | 98 | | |
96 | | - | |
| 99 | + | |
97 | 100 | | |
98 | | - | |
| 101 | + | |
99 | 102 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
104 | 110 | | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | 111 | | |
109 | 112 | | |
110 | 113 | | |
| |||
124 | 127 | | |
125 | 128 | | |
126 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
127 | 133 | | |
128 | 134 | | |
129 | 135 | | |
| |||
135 | 141 | | |
136 | 142 | | |
137 | 143 | | |
138 | | - | |
139 | | - | |
140 | 144 | | |
141 | 145 | | |
142 | 146 | | |
| |||
234 | 238 | | |
235 | 239 | | |
236 | 240 | | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
237 | 245 | | |
238 | 246 | | |
239 | 247 | | |
| |||
250 | 258 | | |
251 | 259 | | |
252 | 260 | | |
253 | | - | |
254 | | - | |
255 | 261 | | |
256 | 262 | | |
257 | 263 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
54 | 48 | | |
55 | 49 | | |
56 | 50 | | |
57 | 51 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
0 commit comments