Commit d8f8961
authored
[AArch64] Improve lowering of scalar abs(sub(a, b)). (#151180)
This patch avoids a comparison against zero when lowering abs(sub(a, b))
patterns, instead reusing the condition codes generated by a subs of the
operands directly.
For example, currently:
```
sxtb w8, w0
sub w8, w8, w1, sxtb
cmp w8, #0
cneg w0, w8, mi
```
becomes:
```
sxtb w8, w0
subs w8, w8, w1, sxtb
cneg w0, w8, mi
```
Together with #151177, this should handle the remaining patterns in
#118413.1 parent b242150 commit d8f8961
File tree
7 files changed
+182
-85
lines changed- llvm
- lib/Target/AArch64
- test/CodeGen/AArch64
7 files changed
+182
-85
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25455 | 25455 | | |
25456 | 25456 | | |
25457 | 25457 | | |
| 25458 | + | |
| 25459 | + | |
| 25460 | + | |
| 25461 | + | |
| 25462 | + | |
| 25463 | + | |
| 25464 | + | |
| 25465 | + | |
| 25466 | + | |
| 25467 | + | |
| 25468 | + | |
| 25469 | + | |
| 25470 | + | |
| 25471 | + | |
| 25472 | + | |
| 25473 | + | |
| 25474 | + | |
| 25475 | + | |
| 25476 | + | |
| 25477 | + | |
| 25478 | + | |
| 25479 | + | |
| 25480 | + | |
25458 | 25481 | | |
25459 | 25482 | | |
25460 | 25483 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| |||
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
29 | | - | |
30 | | - | |
| 28 | + | |
31 | 29 | | |
32 | 30 | | |
33 | 31 | | |
| |||
43 | 41 | | |
44 | 42 | | |
45 | 43 | | |
46 | | - | |
47 | | - | |
| 44 | + | |
48 | 45 | | |
49 | 46 | | |
50 | 47 | | |
| |||
60 | 57 | | |
61 | 58 | | |
62 | 59 | | |
63 | | - | |
64 | | - | |
| 60 | + | |
65 | 61 | | |
66 | 62 | | |
67 | 63 | | |
| |||
93 | 89 | | |
94 | 90 | | |
95 | 91 | | |
96 | | - | |
97 | | - | |
| 92 | + | |
98 | 93 | | |
99 | 94 | | |
100 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| |||
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
28 | | - | |
29 | | - | |
| 27 | + | |
30 | 28 | | |
31 | 29 | | |
32 | 30 | | |
| |||
41 | 39 | | |
42 | 40 | | |
43 | 41 | | |
44 | | - | |
45 | | - | |
| 42 | + | |
46 | 43 | | |
47 | 44 | | |
48 | 45 | | |
| |||
57 | 54 | | |
58 | 55 | | |
59 | 56 | | |
60 | | - | |
61 | | - | |
| 57 | + | |
62 | 58 | | |
63 | 59 | | |
64 | 60 | | |
| |||
88 | 84 | | |
89 | 85 | | |
90 | 86 | | |
91 | | - | |
92 | | - | |
| 87 | + | |
93 | 88 | | |
94 | 89 | | |
95 | 90 | | |
| |||
215 | 210 | | |
216 | 211 | | |
217 | 212 | | |
218 | | - | |
219 | | - | |
| 213 | + | |
220 | 214 | | |
221 | 215 | | |
222 | 216 | | |
| |||
229 | 223 | | |
230 | 224 | | |
231 | 225 | | |
232 | | - | |
233 | | - | |
| 226 | + | |
234 | 227 | | |
235 | 228 | | |
236 | 229 | | |
| |||
287 | 280 | | |
288 | 281 | | |
289 | 282 | | |
290 | | - | |
291 | | - | |
| 283 | + | |
292 | 284 | | |
293 | 285 | | |
294 | 286 | | |
| |||
302 | 294 | | |
303 | 295 | | |
304 | 296 | | |
305 | | - | |
306 | | - | |
| 297 | + | |
307 | 298 | | |
308 | 299 | | |
309 | 300 | | |
| |||
508 | 499 | | |
509 | 500 | | |
510 | 501 | | |
511 | | - | |
| 502 | + | |
512 | 503 | | |
513 | | - | |
514 | 504 | | |
515 | 505 | | |
516 | 506 | | |
| |||
533 | 523 | | |
534 | 524 | | |
535 | 525 | | |
536 | | - | |
537 | | - | |
| 526 | + | |
538 | 527 | | |
539 | 528 | | |
540 | 529 | | |
| |||
548 | 537 | | |
549 | 538 | | |
550 | 539 | | |
551 | | - | |
552 | | - | |
| 540 | + | |
553 | 541 | | |
554 | 542 | | |
555 | 543 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| |||
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
29 | | - | |
30 | | - | |
| 28 | + | |
31 | 29 | | |
32 | 30 | | |
33 | 31 | | |
| |||
43 | 41 | | |
44 | 42 | | |
45 | 43 | | |
46 | | - | |
47 | | - | |
| 44 | + | |
48 | 45 | | |
49 | 46 | | |
50 | 47 | | |
| |||
60 | 57 | | |
61 | 58 | | |
62 | 59 | | |
63 | | - | |
64 | | - | |
| 60 | + | |
65 | 61 | | |
66 | 62 | | |
67 | 63 | | |
| |||
93 | 89 | | |
94 | 90 | | |
95 | 91 | | |
96 | | - | |
97 | | - | |
| 92 | + | |
98 | 93 | | |
99 | 94 | | |
100 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| |||
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
28 | | - | |
29 | | - | |
| 27 | + | |
30 | 28 | | |
31 | 29 | | |
32 | 30 | | |
| |||
41 | 39 | | |
42 | 40 | | |
43 | 41 | | |
44 | | - | |
45 | | - | |
| 42 | + | |
46 | 43 | | |
47 | 44 | | |
48 | 45 | | |
| |||
57 | 54 | | |
58 | 55 | | |
59 | 56 | | |
60 | | - | |
61 | | - | |
| 57 | + | |
62 | 58 | | |
63 | 59 | | |
64 | 60 | | |
| |||
88 | 84 | | |
89 | 85 | | |
90 | 86 | | |
91 | | - | |
92 | | - | |
| 87 | + | |
93 | 88 | | |
94 | 89 | | |
95 | 90 | | |
| |||
219 | 214 | | |
220 | 215 | | |
221 | 216 | | |
222 | | - | |
223 | | - | |
| 217 | + | |
224 | 218 | | |
225 | 219 | | |
226 | 220 | | |
| |||
233 | 227 | | |
234 | 228 | | |
235 | 229 | | |
236 | | - | |
237 | | - | |
| 230 | + | |
238 | 231 | | |
239 | 232 | | |
240 | 233 | | |
| |||
293 | 286 | | |
294 | 287 | | |
295 | 288 | | |
296 | | - | |
297 | | - | |
| 289 | + | |
298 | 290 | | |
299 | 291 | | |
300 | 292 | | |
| |||
308 | 300 | | |
309 | 301 | | |
310 | 302 | | |
311 | | - | |
312 | | - | |
| 303 | + | |
313 | 304 | | |
314 | 305 | | |
315 | 306 | | |
| |||
373 | 364 | | |
374 | 365 | | |
375 | 366 | | |
376 | | - | |
377 | | - | |
378 | | - | |
| 367 | + | |
379 | 368 | | |
| 369 | + | |
380 | 370 | | |
381 | 371 | | |
382 | 372 | | |
| |||
398 | 388 | | |
399 | 389 | | |
400 | 390 | | |
401 | | - | |
402 | | - | |
| 391 | + | |
403 | 392 | | |
404 | 393 | | |
405 | 394 | | |
| |||
413 | 402 | | |
414 | 403 | | |
415 | 404 | | |
416 | | - | |
417 | | - | |
| 405 | + | |
418 | 406 | | |
419 | 407 | | |
420 | 408 | | |
| |||
0 commit comments