Commit 2cf9ca4
committed
[DAG] shouldReduceLoadWidth - hasOneUse check for just be for the loaded value, not the chain etc.
The hasOneUse check was failing in any case where the load was part of a chain - we should only be checking if the loaded value has one use, and any updates to the chain should be handled by the fold calling shouldReduceLoadWidth.
I've updated the x86 implementation to match, although it has no effect here yet (I'm still looking at how to improve the x86 implementation) as the inner for loop was discarding chain uses anyway.
By using SDValue::hasOneUse instead this patch exposes a missing dependency on the LLVMSelectionDAG library in a lot of tools + unittests, which resulted in having to make SDNode::hasNUsesOfValue inline.
Noticed while fighting the x86 regressions in #1226711 parent 7a9f53c commit 2cf9ca4
File tree
11 files changed
+231
-406
lines changed- llvm
- include/llvm/CodeGen
- lib
- CodeGen/SelectionDAG
- Target/X86
- test/CodeGen
- AArch64
- AMDGPU
- ARM
- RISCV/rvv
11 files changed
+231
-406
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
877 | 877 | | |
878 | 878 | | |
879 | 879 | | |
880 | | - | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
881 | 895 | | |
882 | 896 | | |
883 | 897 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1817 | 1817 | | |
1818 | 1818 | | |
1819 | 1819 | | |
1820 | | - | |
| 1820 | + | |
1821 | 1821 | | |
1822 | 1822 | | |
1823 | 1823 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12444 | 12444 | | |
12445 | 12445 | | |
12446 | 12446 | | |
12447 | | - | |
12448 | | - | |
12449 | | - | |
12450 | | - | |
12451 | | - | |
12452 | | - | |
12453 | | - | |
12454 | | - | |
12455 | | - | |
12456 | | - | |
12457 | | - | |
12458 | | - | |
12459 | | - | |
12460 | | - | |
12461 | | - | |
12462 | | - | |
12463 | | - | |
12464 | | - | |
12465 | | - | |
12466 | 12447 | | |
12467 | 12448 | | |
12468 | 12449 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3268 | 3268 | | |
3269 | 3269 | | |
3270 | 3270 | | |
3271 | | - | |
| 3271 | + | |
| 3272 | + | |
3272 | 3273 | | |
3273 | 3274 | | |
3274 | 3275 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
531 | 531 | | |
532 | 532 | | |
533 | 533 | | |
| 534 | + | |
534 | 535 | | |
535 | 536 | | |
536 | 537 | | |
537 | 538 | | |
538 | 539 | | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | | - | |
543 | | - | |
544 | | - | |
545 | | - | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
546 | 546 | | |
547 | 547 | | |
548 | 548 | | |
| |||
562 | 562 | | |
563 | 563 | | |
564 | 564 | | |
565 | | - | |
| 565 | + | |
566 | 566 | | |
567 | 567 | | |
568 | 568 | | |
569 | 569 | | |
570 | 570 | | |
571 | 571 | | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
577 | | - | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
578 | 576 | | |
579 | | - | |
580 | | - | |
581 | | - | |
| 577 | + | |
582 | 578 | | |
583 | 579 | | |
584 | | - | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | | - | |
590 | | - | |
591 | | - | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
592 | 588 | | |
| 589 | + | |
| 590 | + | |
593 | 591 | | |
594 | | - | |
| 592 | + | |
595 | 593 | | |
596 | 594 | | |
597 | 595 | | |
| |||
604 | 602 | | |
605 | 603 | | |
606 | 604 | | |
| 605 | + | |
607 | 606 | | |
608 | 607 | | |
609 | 608 | | |
| |||
0 commit comments