Commit 3e4fd37
committed
[RISCV] Fix RISCVInsertVSETVLI coalescing clobbering VL def segment
This fixes an assert when compiling llvm-test-suite with -march=rva23u64 -O3 that started appearing sometime this week.
We get "Cannot overlap two segments with differing ValID's" because we try to coalescse these two vsetvlis:
%x:gprnox0 = COPY $x8
dead $x0 = PseudoVSETIVLI 1, 208, implicit-def $vl, implicit-def $vtype
%y:gprnox0 = COPY %x
%v:vr = COPY $v8, implicit $vtype
%x = PseudoVSETVLI %x, 208, implicit-def $vl, implicit-def $vtype
-->
%x:gprnox0 = COPY $x8
%x = PseudoVSETVLI %x, 208, implicit-def $vl, implicit-def $vtype
%y:gprnox0 = COPY %x
%v:vr = COPY $v8, implicit $vtype
However to do so would cause us to extend the segment of the new value of %x up past the first segment, which overlaps.
This fixes it by checking that its safe to extend the segment, by simply making sure the interval isn't live at the first vsetvli.
This unfortunately causes a regression in the existing coalesce_vl_avl_same_reg test because even though we could coalesce the vsetvlis there, we now bail. I couldn't think of an easy way to handle this safely, but I don't think this is an important case to handle: After testing this patch on SPEC CPU 2017 there are no codegen changes.1 parent 5e4f177 commit 3e4fd37
File tree
3 files changed
+78
-0
lines changed- llvm
- lib/Target/RISCV
- test/CodeGen/RISCV/rvv
3 files changed
+78
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1755 | 1755 | | |
1756 | 1756 | | |
1757 | 1757 | | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
1758 | 1766 | | |
1759 | 1767 | | |
1760 | 1768 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
879 | 879 | | |
880 | 880 | | |
881 | 881 | | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
103 | 107 | | |
104 | 108 | | |
105 | 109 | | |
| |||
624 | 628 | | |
625 | 629 | | |
626 | 630 | | |
| 631 | + | |
| 632 | + | |
627 | 633 | | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
628 | 653 | | |
| 654 | + | |
629 | 655 | | |
630 | 656 | | |
| 657 | + | |
631 | 658 | | |
632 | 659 | | |
633 | 660 | | |
| |||
0 commit comments