Commit 9efcce9
[RISCV] Fix lowering of BUILD_VECTORs as VID sequences
This patch fixes a bug when lowering BUILD_VECTOR via VID sequences.
After adding support for fractional steps in D106533, elements with zero
steps may be skipped if no step has yet been computed. This allowed
certain sequences to slip through the cracks, being identified as VID
sequences when in fact they are not.
The fix for this is to perform a second loop over the BUILD_VECTOR to
validate the entire sequence once the step has been computed. This isn't
the most efficient, but on balance the code is more readable and
maintainable than doing back-validation during the first loop.
Fixes the tests introduced in D123785.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D123786
(cherry picked from commit c5cac48)1 parent 21ce6cf commit 9efcce9
File tree
2 files changed
+44
-35
lines changed- llvm
- lib/Target/RISCV
- test/CodeGen/RISCV/rvv
2 files changed
+44
-35
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1908 | 1908 | | |
1909 | 1909 | | |
1910 | 1910 | | |
1911 | | - | |
1912 | | - | |
1913 | | - | |
1914 | | - | |
1915 | | - | |
1916 | | - | |
1917 | | - | |
1918 | | - | |
1919 | | - | |
1920 | | - | |
1921 | | - | |
1922 | | - | |
1923 | | - | |
1924 | | - | |
1925 | | - | |
| 1911 | + | |
| 1912 | + | |
1926 | 1913 | | |
1927 | | - | |
1928 | | - | |
1929 | | - | |
| 1914 | + | |
| 1915 | + | |
| 1916 | + | |
| 1917 | + | |
| 1918 | + | |
1930 | 1919 | | |
| 1920 | + | |
| 1921 | + | |
1931 | 1922 | | |
1932 | | - | |
1933 | 1923 | | |
1934 | | - | |
1935 | | - | |
1936 | | - | |
1937 | | - | |
1938 | | - | |
1939 | | - | |
1940 | | - | |
1941 | | - | |
| 1924 | + | |
| 1925 | + | |
| 1926 | + | |
| 1927 | + | |
| 1928 | + | |
| 1929 | + | |
| 1930 | + | |
| 1931 | + | |
1942 | 1932 | | |
1943 | 1933 | | |
1944 | 1934 | | |
1945 | 1935 | | |
1946 | 1936 | | |
1947 | 1937 | | |
1948 | 1938 | | |
1949 | | - | |
1950 | | - | |
1951 | | - | |
| 1939 | + | |
| 1940 | + | |
| 1941 | + | |
1952 | 1942 | | |
1953 | 1943 | | |
| 1944 | + | |
| 1945 | + | |
| 1946 | + | |
| 1947 | + | |
| 1948 | + | |
| 1949 | + | |
| 1950 | + | |
| 1951 | + | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
1954 | 1962 | | |
1955 | 1963 | | |
1956 | 1964 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
705 | 705 | | |
706 | 706 | | |
707 | 707 | | |
708 | | - | |
709 | 708 | | |
710 | 709 | | |
711 | 710 | | |
| 711 | + | |
| 712 | + | |
712 | 713 | | |
713 | | - | |
| 714 | + | |
714 | 715 | | |
715 | 716 | | |
716 | 717 | | |
717 | 718 | | |
718 | | - | |
719 | 719 | | |
720 | 720 | | |
721 | 721 | | |
| 722 | + | |
| 723 | + | |
722 | 724 | | |
723 | | - | |
724 | | - | |
| 725 | + | |
725 | 726 | | |
726 | 727 | | |
727 | 728 | | |
0 commit comments