Commit 6c1d0ba
[AArch64] Add tablegen patterns for fmla index with extract 0. (llvm#114976)
We have tablegen patterns to produce an indexed `fmla s0, s1, v2.s[2]`
from
`fma extract(Rn, lane), Rm, Ra -> fmla`
But for the case of lane==0, we want to prefer the simple `fmadd s0, s1,
s2`. So we have patterns for
`fma extract(Rn, 0), Rm, Ra -> fmadd`
The problem arises when we have two extracts, as tablegen starts to
prefer the second pattern, as it looks more specialized. This patch adds
additional patterns to catch this case:
`fma extract(Rn, index), extract(Rm, 0), Ra -> fmla`
To make sure the simpler fmadd keeps being selected when both lanes are
extracted from lane 0 we need to add patterns for that case too:
`fma extract(Rn, 0), extract(Rm, 0), Ra -> fmadd`1 parent 6cd2533 commit 6c1d0ba
File tree
4 files changed
+50
-24
lines changed- llvm
- lib/Target/AArch64
- test/CodeGen/AArch64
4 files changed
+50
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5821 | 5821 | | |
5822 | 5822 | | |
5823 | 5823 | | |
| 5824 | + | |
| 5825 | + | |
| 5826 | + | |
| 5827 | + | |
| 5828 | + | |
| 5829 | + | |
| 5830 | + | |
5824 | 5831 | | |
5825 | 5832 | | |
5826 | 5833 | | |
| |||
5835 | 5842 | | |
5836 | 5843 | | |
5837 | 5844 | | |
| 5845 | + | |
| 5846 | + | |
| 5847 | + | |
| 5848 | + | |
| 5849 | + | |
| 5850 | + | |
| 5851 | + | |
5838 | 5852 | | |
5839 | 5853 | | |
5840 | 5854 | | |
| |||
5846 | 5860 | | |
5847 | 5861 | | |
5848 | 5862 | | |
| 5863 | + | |
| 5864 | + | |
| 5865 | + | |
| 5866 | + | |
| 5867 | + | |
| 5868 | + | |
| 5869 | + | |
5849 | 5870 | | |
5850 | 5871 | | |
5851 | 5872 | | |
| |||
9282 | 9303 | | |
9283 | 9304 | | |
9284 | 9305 | | |
| 9306 | + | |
| 9307 | + | |
| 9308 | + | |
| 9309 | + | |
| 9310 | + | |
9285 | 9311 | | |
9286 | 9312 | | |
9287 | 9313 | | |
| |||
9323 | 9349 | | |
9324 | 9350 | | |
9325 | 9351 | | |
| 9352 | + | |
| 9353 | + | |
| 9354 | + | |
| 9355 | + | |
| 9356 | + | |
9326 | 9357 | | |
9327 | 9358 | | |
9328 | 9359 | | |
9329 | 9360 | | |
9330 | 9361 | | |
9331 | 9362 | | |
| 9363 | + | |
| 9364 | + | |
| 9365 | + | |
| 9366 | + | |
| 9367 | + | |
9332 | 9368 | | |
9333 | 9369 | | |
9334 | 9370 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
124 | | - | |
| 123 | + | |
125 | 124 | | |
126 | 125 | | |
127 | 126 | | |
| |||
310 | 309 | | |
311 | 310 | | |
312 | 311 | | |
313 | | - | |
314 | | - | |
| 312 | + | |
315 | 313 | | |
316 | 314 | | |
317 | 315 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
88 | | - | |
| 87 | + | |
89 | 88 | | |
90 | 89 | | |
91 | 90 | | |
| |||
96 | 95 | | |
97 | 96 | | |
98 | 97 | | |
99 | | - | |
100 | | - | |
| 98 | + | |
101 | 99 | | |
102 | 100 | | |
103 | 101 | | |
| |||
120 | 118 | | |
121 | 119 | | |
122 | 120 | | |
123 | | - | |
124 | | - | |
| 121 | + | |
125 | 122 | | |
126 | 123 | | |
127 | 124 | | |
| |||
133 | 130 | | |
134 | 131 | | |
135 | 132 | | |
136 | | - | |
137 | | - | |
| 133 | + | |
138 | 134 | | |
139 | 135 | | |
140 | 136 | | |
| |||
218 | 214 | | |
219 | 215 | | |
220 | 216 | | |
221 | | - | |
222 | | - | |
| 217 | + | |
223 | 218 | | |
224 | 219 | | |
225 | 220 | | |
| |||
230 | 225 | | |
231 | 226 | | |
232 | 227 | | |
233 | | - | |
234 | | - | |
| 228 | + | |
235 | 229 | | |
236 | 230 | | |
237 | 231 | | |
| |||
340 | 334 | | |
341 | 335 | | |
342 | 336 | | |
343 | | - | |
344 | | - | |
| 337 | + | |
345 | 338 | | |
346 | 339 | | |
347 | 340 | | |
| |||
437 | 430 | | |
438 | 431 | | |
439 | 432 | | |
440 | | - | |
441 | | - | |
| 433 | + | |
442 | 434 | | |
443 | 435 | | |
444 | 436 | | |
| |||
0 commit comments