Commit 008c05f
Pass to convert 2D block intrinsics into constituents.
The 2D block IO intrinsics are opaque to the compiler and identical
payloads cannot be optimized by the compiler. Intrinsics have been
introduced to overcome this problem by allowing the 2D intrinsics to be
broken up into constituent stages (payload, set X and Y relative to
payload, IO operation).
This PR adds a new pass, `Decompose2DBlockFuncs`, which converts the 2D
IO intrinsics into the constituents, allowing subequent passes to
optimize the code. At the current stage, the payload intrinsics can be
hoisted above loops by LICM, and can be merged by EarlyCSA and others.
The `LSC2DBlockSetAddrPayloadField` intrinsics have a mode in which the
IO location in memory is specified exactly (relative to the payload),
and another mode in which the intrinsic increments the value. When a
payload is used by the `LSC2DBlockSetAddrPayloadField` intrinsic in the
accumulator mode, the payload cannot be hoisted. Because of this, I have
given the `LSC2DBlockCreateAddrPayload` default attributes of
`writeonly`, which is conservative for when the SetAddr intrinsic is in
accumulator mode.
The `LSC2DBlockSetAddrPayloadField` intrinsic added by the
`Decompose2DBlockFuncs` is always in the mode in which it explicitly
specifies the memory location. Since we have this guarantee, the related
payload is described as not accessing memory, since the dependencies are
all properly accounted for by the data dependency; this allows the
desired optimizations to function.
The 2D block intrinsics are not decomposed when they do not fall within
a loop, or if the payload would have loop-dependent parameters.
(cherry picked from commit 82a6156)1 parent ee05ac8 commit 008c05f
File tree
15 files changed
+726
-4
lines changed- IGC
- AdaptorOCL
- Compiler
- CISACodeGen
- Optimizer/OpenCLPasses
- Decompose2DBlockFuncs
- tests/Decompose2DBlockFuncs
- GenISAIntrinsics
- generator
- input
15 files changed
+726
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
108 | 109 | | |
109 | 110 | | |
110 | 111 | | |
| |||
583 | 584 | | |
584 | 585 | | |
585 | 586 | | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
586 | 593 | | |
587 | 594 | | |
588 | 595 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| 159 | + | |
159 | 160 | | |
160 | 161 | | |
161 | 162 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| 70 | + | |
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
| |||
137 | 139 | | |
138 | 140 | | |
139 | 141 | | |
| 142 | + | |
140 | 143 | | |
141 | 144 | | |
142 | 145 | | |
| |||
192 | 195 | | |
193 | 196 | | |
194 | 197 | | |
| 198 | + | |
195 | 199 | | |
196 | 200 | | |
197 | 201 | | |
| |||
Lines changed: 29 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 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
0 commit comments