Commit acab142
committed
[LegalizeDAG] Freeze index when converting insert_elt/insert_subvector to load/store on stack.
We try clamp the index to be within the bounds of the stack object
we create, but if we don't freeze it, poison can propagate into the
clamp code. This can cause the access to leave the bounds of the
stack object.
We have other instances of this issue in type legalization and extract_elt/subvector,
but posting this patch first for direction check.
Fixes #867171 parent 0d7ea50 commit acab142
File tree
6 files changed
+82
-63
lines changed- llvm
- lib/CodeGen/SelectionDAG
- test/CodeGen
- AArch64
- LoongArch
- lasx/ir-instruction
- lsx/ir-instruction
- X86
6 files changed
+82
-63
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1455 | 1455 | | |
1456 | 1456 | | |
1457 | 1457 | | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
1458 | 1461 | | |
1459 | 1462 | | |
1460 | 1463 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
| 13 | + | |
| 14 | + | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
Lines changed: 24 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
127 | | - | |
128 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
129 | 130 | | |
130 | 131 | | |
131 | 132 | | |
| |||
149 | 150 | | |
150 | 151 | | |
151 | 152 | | |
152 | | - | |
153 | | - | |
154 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
155 | 157 | | |
156 | 158 | | |
157 | 159 | | |
| |||
175 | 177 | | |
176 | 178 | | |
177 | 179 | | |
178 | | - | |
179 | | - | |
180 | | - | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
181 | 184 | | |
182 | 185 | | |
183 | 186 | | |
| |||
201 | 204 | | |
202 | 205 | | |
203 | 206 | | |
204 | | - | |
205 | | - | |
206 | | - | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
207 | 211 | | |
208 | 212 | | |
209 | 213 | | |
| |||
227 | 231 | | |
228 | 232 | | |
229 | 233 | | |
230 | | - | |
231 | | - | |
232 | | - | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
233 | 238 | | |
234 | 239 | | |
235 | 240 | | |
| |||
253 | 258 | | |
254 | 259 | | |
255 | 260 | | |
256 | | - | |
257 | | - | |
258 | | - | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
259 | 265 | | |
260 | 266 | | |
261 | 267 | | |
| |||
Lines changed: 24 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
91 | | - | |
92 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
| |||
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
109 | | - | |
110 | | - | |
111 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
112 | 114 | | |
113 | 115 | | |
114 | 116 | | |
| |||
125 | 127 | | |
126 | 128 | | |
127 | 129 | | |
128 | | - | |
129 | | - | |
130 | | - | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
131 | 134 | | |
132 | 135 | | |
133 | 136 | | |
| |||
144 | 147 | | |
145 | 148 | | |
146 | 149 | | |
147 | | - | |
148 | | - | |
149 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
150 | 154 | | |
151 | 155 | | |
152 | 156 | | |
| |||
163 | 167 | | |
164 | 168 | | |
165 | 169 | | |
166 | | - | |
167 | | - | |
168 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
169 | 174 | | |
170 | 175 | | |
171 | 176 | | |
| |||
182 | 187 | | |
183 | 188 | | |
184 | 189 | | |
185 | | - | |
186 | | - | |
187 | | - | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
188 | 194 | | |
189 | 195 | | |
190 | 196 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1009 | 1009 | | |
1010 | 1010 | | |
1011 | 1011 | | |
1012 | | - | |
1013 | | - | |
1014 | | - | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
1015 | 1015 | | |
1016 | | - | |
| 1016 | + | |
| 1017 | + | |
1017 | 1018 | | |
1018 | | - | |
| 1019 | + | |
1019 | 1020 | | |
1020 | 1021 | | |
1021 | | - | |
1022 | | - | |
1023 | | - | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
1024 | 1025 | | |
1025 | 1026 | | |
1026 | 1027 | | |
| |||
1362 | 1363 | | |
1363 | 1364 | | |
1364 | 1365 | | |
1365 | | - | |
| 1366 | + | |
| 1367 | + | |
1366 | 1368 | | |
1367 | 1369 | | |
1368 | 1370 | | |
1369 | 1371 | | |
1370 | | - | |
| 1372 | + | |
1371 | 1373 | | |
1372 | 1374 | | |
1373 | 1375 | | |
| |||
1742 | 1744 | | |
1743 | 1745 | | |
1744 | 1746 | | |
1745 | | - | |
1746 | | - | |
1747 | | - | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
1748 | 1750 | | |
1749 | | - | |
| 1751 | + | |
| 1752 | + | |
1750 | 1753 | | |
1751 | | - | |
| 1754 | + | |
1752 | 1755 | | |
1753 | 1756 | | |
1754 | | - | |
1755 | | - | |
1756 | | - | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
1757 | 1760 | | |
1758 | 1761 | | |
1759 | 1762 | | |
| |||
2128 | 2131 | | |
2129 | 2132 | | |
2130 | 2133 | | |
2131 | | - | |
| 2134 | + | |
| 2135 | + | |
2132 | 2136 | | |
2133 | 2137 | | |
2134 | 2138 | | |
2135 | 2139 | | |
2136 | | - | |
| 2140 | + | |
2137 | 2141 | | |
2138 | 2142 | | |
2139 | 2143 | | |
| |||
0 commit comments