Commit 53d6db2
committed
[LegalizeTypes][RISCV] Control sign-extend for atomicrmw input argument
Similar to the argument sign-extend control provided by
getExtendForAtomicCmpSwapArg for `cmpxchg`, this change adds
getExtendForAtomicRMWArg for `atomicrmw <op>`.
This mechanism is used to correct the RISCV code generation when using atomic
pseudo expansions that perform sub-word comparions inside a LR/SC block, and
expect a correctly sign-extended input argument. A shorter instruction
sequence is possible for umin/max by leveraging the fact that two sign-extended
arguments still order correctly during an unsigned comparison.1 parent 5c976f7 commit 53d6db2
File tree
8 files changed
+190
-160
lines changed- llvm
- include/llvm/CodeGen
- lib
- CodeGen/SelectionDAG
- Target/RISCV
- test/CodeGen/RISCV
8 files changed
+190
-160
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2459 | 2459 | | |
2460 | 2460 | | |
2461 | 2461 | | |
| 2462 | + | |
| 2463 | + | |
| 2464 | + | |
| 2465 | + | |
| 2466 | + | |
| 2467 | + | |
2462 | 2468 | | |
2463 | 2469 | | |
2464 | 2470 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
429 | 429 | | |
430 | 430 | | |
431 | 431 | | |
432 | | - | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
433 | 446 | | |
434 | 447 | | |
435 | 448 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
523 | 523 | | |
524 | 524 | | |
525 | 525 | | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | 526 | | |
538 | 527 | | |
539 | 528 | | |
| |||
546 | 535 | | |
547 | 536 | | |
548 | 537 | | |
549 | | - | |
550 | | - | |
551 | | - | |
552 | 538 | | |
553 | 539 | | |
554 | 540 | | |
| |||
558 | 544 | | |
559 | 545 | | |
560 | 546 | | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
567 | 550 | | |
568 | 551 | | |
569 | 552 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24483 | 24483 | | |
24484 | 24484 | | |
24485 | 24485 | | |
| 24486 | + | |
| 24487 | + | |
| 24488 | + | |
| 24489 | + | |
| 24490 | + | |
| 24491 | + | |
| 24492 | + | |
| 24493 | + | |
| 24494 | + | |
| 24495 | + | |
| 24496 | + | |
| 24497 | + | |
| 24498 | + | |
| 24499 | + | |
| 24500 | + | |
| 24501 | + | |
| 24502 | + | |
| 24503 | + | |
| 24504 | + | |
24486 | 24505 | | |
24487 | 24506 | | |
24488 | 24507 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
| 248 | + | |
248 | 249 | | |
249 | 250 | | |
250 | 251 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
324 | | - | |
325 | | - | |
326 | 324 | | |
327 | 325 | | |
328 | | - | |
| 326 | + | |
329 | 327 | | |
330 | 328 | | |
331 | 329 | | |
| |||
0 commit comments