Commit 30641f5
[X86] shouldReduceLoadWidth - don't split loads if we can freely reuse full width legal binop (llvm#129695)
Currently shouldReduceLoadWidth is very relaxed about when loads can be
split to avoid extractions from the original full width load - resulting
in many cases where the number of memory operations notably increases,
replacing the cost of a extract_subvector for additional loads.
This patch adjusts the 256/512-bit vector load splitting metric to
detect cases where ANY use of the full width load is be used directly -
in which case we will now reuse that load for smaller types, unless we'd
need to extract an upper subvector / integer element - i.e. we now
correctly treat (extract_subvector cst, 0) as free.
We retain the existing logic of never splitting loads if all uses are
extract+stores but we improve this by peeking through bitcasts while
looking for extract_subvector/store chains.
This required a number of fixes - shouldReduceLoadWidth now needs to
peek through bitcasts UP the use-chain to find final users (limited to
hasOneUse cases to reduce complexity). It also exposed an issue in
isTargetCanonicalConstantNode which assumed that a load of vector
constant data would always extract, which is no longer the case.1 parent 553e64f commit 30641f5
File tree
12 files changed
+2480
-2453
lines changed- llvm
- lib/Target/X86
- test/CodeGen/X86
12 files changed
+2480
-2453
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3264 | 3264 | | |
3265 | 3265 | | |
3266 | 3266 | | |
| 3267 | + | |
| 3268 | + | |
| 3269 | + | |
| 3270 | + | |
| 3271 | + | |
| 3272 | + | |
3267 | 3273 | | |
3268 | 3274 | | |
3269 | 3275 | | |
| |||
3273 | 3279 | | |
3274 | 3280 | | |
3275 | 3281 | | |
3276 | | - | |
| 3282 | + | |
| 3283 | + | |
3277 | 3284 | | |
3278 | 3285 | | |
3279 | 3286 | | |
| 3287 | + | |
| 3288 | + | |
3280 | 3289 | | |
3281 | 3290 | | |
3282 | 3291 | | |
3283 | 3292 | | |
3284 | 3293 | | |
3285 | | - | |
| 3294 | + | |
3286 | 3295 | | |
3287 | | - | |
3288 | | - | |
3289 | | - | |
3290 | | - | |
| 3296 | + | |
| 3297 | + | |
| 3298 | + | |
| 3299 | + | |
| 3300 | + | |
| 3301 | + | |
| 3302 | + | |
| 3303 | + | |
| 3304 | + | |
| 3305 | + | |
| 3306 | + | |
| 3307 | + | |
| 3308 | + | |
| 3309 | + | |
| 3310 | + | |
| 3311 | + | |
3291 | 3312 | | |
3292 | | - | |
3293 | | - | |
| 3313 | + | |
| 3314 | + | |
| 3315 | + | |
| 3316 | + | |
| 3317 | + | |
| 3318 | + | |
| 3319 | + | |
| 3320 | + | |
| 3321 | + | |
3294 | 3322 | | |
3295 | 3323 | | |
3296 | 3324 | | |
| |||
59154 | 59182 | | |
59155 | 59183 | | |
59156 | 59184 | | |
| 59185 | + | |
| 59186 | + | |
| 59187 | + | |
| 59188 | + | |
| 59189 | + | |
| 59190 | + | |
| 59191 | + | |
| 59192 | + | |
59157 | 59193 | | |
59158 | 59194 | | |
59159 | 59195 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1337 | 1337 | | |
1338 | 1338 | | |
1339 | 1339 | | |
1340 | | - | |
1341 | | - | |
| 1340 | + | |
| 1341 | + | |
1342 | 1342 | | |
1343 | 1343 | | |
1344 | 1344 | | |
1345 | 1345 | | |
1346 | 1346 | | |
1347 | 1347 | | |
1348 | 1348 | | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
1349 | 1352 | | |
1350 | 1353 | | |
1351 | 1354 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
264 | | - | |
265 | 264 | | |
266 | | - | |
| 265 | + | |
| 266 | + | |
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
| |||
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
287 | | - | |
288 | 287 | | |
289 | 288 | | |
290 | | - | |
| 289 | + | |
| 290 | + | |
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
0 commit comments