Commit 9f0273a
committed
[SelectionDAG] Fix bug related to demanded bits/elts for BITCAST
When we have a BITCAST and the source type is a vector with smaller
elements compared to the destination type, then we need to demand
all the source elements that make up the demanded elts for the
result when doing recursive calls to SimplifyDemandedBits,
SimplifyDemandedVectorElts and SimplifyMultipleUseDemandedBits.
Problem is that those simplifications are allowed to turn non-demanded
elements of a vector into POISON, so unless we demand all source
elements that make up the result there is a risk that the result
would be more poisonous (even for demanded elts) after the
simplification.
The patch fixes some bugs in SimplifyMultipleUseDemandedBits and
SimplifyDemandedBits for situations when we did not consider the
problem described above. Now we make sure that we also demand vector
elements that "must not be turned into poison" even if those elements
correspond to bits that does not need to be defined according to
the DemandedBits mask.
Fixes #1385131 parent cf9cb54 commit 9f0273a
File tree
125 files changed
+12012
-10823
lines changed- llvm
- lib/CodeGen/SelectionDAG
- test/CodeGen
- AArch64
- AMDGPU
- ARM
- Thumb2
- X86
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
125 files changed
+12012
-10823
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
749 | 749 | | |
750 | 750 | | |
751 | 751 | | |
752 | | - | |
753 | 752 | | |
754 | 753 | | |
755 | 754 | | |
756 | | - | |
757 | | - | |
758 | | - | |
759 | | - | |
760 | | - | |
761 | | - | |
762 | | - | |
| 755 | + | |
763 | 756 | | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
764 | 761 | | |
765 | 762 | | |
766 | 763 | | |
| |||
2776 | 2773 | | |
2777 | 2774 | | |
2778 | 2775 | | |
2779 | | - | |
2780 | 2776 | | |
2781 | 2777 | | |
2782 | 2778 | | |
2783 | | - | |
2784 | | - | |
2785 | | - | |
2786 | | - | |
2787 | | - | |
2788 | | - | |
2789 | | - | |
| 2779 | + | |
2790 | 2780 | | |
| 2781 | + | |
| 2782 | + | |
| 2783 | + | |
| 2784 | + | |
2791 | 2785 | | |
2792 | 2786 | | |
2793 | 2787 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
221 | | - | |
222 | 221 | | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
228 | 227 | | |
229 | 228 | | |
230 | 229 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
210 | | - | |
211 | 210 | | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
217 | 216 | | |
218 | 217 | | |
219 | 218 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
105 | | - | |
| 104 | + | |
106 | 105 | | |
107 | 106 | | |
108 | 107 | | |
109 | | - | |
110 | | - | |
| 108 | + | |
| 109 | + | |
111 | 110 | | |
112 | 111 | | |
113 | 112 | | |
| |||
119 | 118 | | |
120 | 119 | | |
121 | 120 | | |
122 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
123 | 126 | | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
| 127 | + | |
| 128 | + | |
128 | 129 | | |
129 | 130 | | |
130 | 131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1900 | 1900 | | |
1901 | 1901 | | |
1902 | 1902 | | |
1903 | | - | |
| 1903 | + | |
1904 | 1904 | | |
1905 | 1905 | | |
1906 | 1906 | | |
1907 | 1907 | | |
1908 | 1908 | | |
1909 | 1909 | | |
1910 | 1910 | | |
1911 | | - | |
1912 | | - | |
1913 | | - | |
| 1911 | + | |
| 1912 | + | |
| 1913 | + | |
1914 | 1914 | | |
1915 | | - | |
1916 | | - | |
1917 | | - | |
1918 | | - | |
1919 | | - | |
| 1915 | + | |
| 1916 | + | |
| 1917 | + | |
| 1918 | + | |
| 1919 | + | |
| 1920 | + | |
1920 | 1921 | | |
1921 | 1922 | | |
| 1923 | + | |
| 1924 | + | |
1922 | 1925 | | |
1923 | | - | |
| 1926 | + | |
1924 | 1927 | | |
1925 | | - | |
| 1928 | + | |
| 1929 | + | |
| 1930 | + | |
1926 | 1931 | | |
1927 | | - | |
1928 | | - | |
1929 | | - | |
1930 | | - | |
1931 | | - | |
| 1932 | + | |
| 1933 | + | |
1932 | 1934 | | |
1933 | | - | |
1934 | | - | |
| 1935 | + | |
| 1936 | + | |
| 1937 | + | |
| 1938 | + | |
1935 | 1939 | | |
| 1940 | + | |
1936 | 1941 | | |
1937 | 1942 | | |
1938 | 1943 | | |
1939 | 1944 | | |
1940 | 1945 | | |
1941 | 1946 | | |
1942 | | - | |
| 1947 | + | |
| 1948 | + | |
1943 | 1949 | | |
1944 | 1950 | | |
1945 | | - | |
| 1951 | + | |
1946 | 1952 | | |
1947 | 1953 | | |
1948 | | - | |
1949 | | - | |
| 1954 | + | |
| 1955 | + | |
1950 | 1956 | | |
1951 | | - | |
1952 | | - | |
1953 | 1957 | | |
1954 | 1958 | | |
1955 | 1959 | | |
1956 | 1960 | | |
1957 | 1961 | | |
1958 | | - | |
| 1962 | + | |
| 1963 | + | |
1959 | 1964 | | |
1960 | | - | |
1961 | | - | |
| 1965 | + | |
| 1966 | + | |
1962 | 1967 | | |
1963 | 1968 | | |
1964 | | - | |
1965 | | - | |
| 1969 | + | |
| 1970 | + | |
1966 | 1971 | | |
1967 | 1972 | | |
1968 | 1973 | | |
| |||
1980 | 1985 | | |
1981 | 1986 | | |
1982 | 1987 | | |
1983 | | - | |
1984 | | - | |
| 1988 | + | |
| 1989 | + | |
1985 | 1990 | | |
1986 | 1991 | | |
1987 | 1992 | | |
| |||
1997 | 2002 | | |
1998 | 2003 | | |
1999 | 2004 | | |
2000 | | - | |
2001 | | - | |
| 2005 | + | |
| 2006 | + | |
2002 | 2007 | | |
2003 | 2008 | | |
2004 | 2009 | | |
2005 | 2010 | | |
2006 | | - | |
| 2011 | + | |
2007 | 2012 | | |
2008 | 2013 | | |
2009 | | - | |
2010 | | - | |
| 2014 | + | |
| 2015 | + | |
2011 | 2016 | | |
2012 | | - | |
2013 | | - | |
2014 | 2017 | | |
2015 | 2018 | | |
2016 | 2019 | | |
2017 | 2020 | | |
2018 | 2021 | | |
2019 | | - | |
| 2022 | + | |
| 2023 | + | |
2020 | 2024 | | |
2021 | | - | |
2022 | | - | |
| 2025 | + | |
| 2026 | + | |
2023 | 2027 | | |
2024 | 2028 | | |
2025 | 2029 | | |
2026 | | - | |
2027 | | - | |
| 2030 | + | |
| 2031 | + | |
2028 | 2032 | | |
2029 | 2033 | | |
2030 | 2034 | | |
| |||
Lines changed: 16 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
| 191 | + | |
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
196 | | - | |
197 | | - | |
198 | | - | |
| 196 | + | |
199 | 197 | | |
200 | 198 | | |
201 | 199 | | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
218 | 214 | | |
219 | 215 | | |
220 | 216 | | |
| |||
0 commit comments