Commit 678ca30
committed
[X86] shouldReduceLoadWidth - don't split loads if ANY uses are a extract+store or a full width legal binop
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 not split if ANY use of the full width load can be used directly - either in an extract+store (previously ALL uses had to be extract+store to prevent splits) or is used by a legal binop (so unlikely to be split itself).
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 25479a3 commit 678ca30
File tree
16 files changed
+1878
-1848
lines changed- llvm
- lib/Target/X86
- test/CodeGen/X86
16 files changed
+1878
-1848
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3260 | 3260 | | |
3261 | 3261 | | |
3262 | 3262 | | |
| 3263 | + | |
| 3264 | + | |
| 3265 | + | |
| 3266 | + | |
| 3267 | + | |
| 3268 | + | |
3263 | 3269 | | |
3264 | 3270 | | |
3265 | 3271 | | |
3266 | 3272 | | |
3267 | 3273 | | |
3268 | 3274 | | |
3269 | 3275 | | |
3270 | | - | |
| 3276 | + | |
3271 | 3277 | | |
3272 | | - | |
| 3278 | + | |
| 3279 | + | |
3273 | 3280 | | |
3274 | 3281 | | |
3275 | 3282 | | |
| |||
3278 | 3285 | | |
3279 | 3286 | | |
3280 | 3287 | | |
3281 | | - | |
| 3288 | + | |
3282 | 3289 | | |
3283 | | - | |
3284 | | - | |
3285 | | - | |
3286 | | - | |
| 3290 | + | |
| 3291 | + | |
| 3292 | + | |
| 3293 | + | |
| 3294 | + | |
| 3295 | + | |
| 3296 | + | |
| 3297 | + | |
| 3298 | + | |
| 3299 | + | |
| 3300 | + | |
| 3301 | + | |
| 3302 | + | |
| 3303 | + | |
3287 | 3304 | | |
3288 | | - | |
3289 | | - | |
3290 | 3305 | | |
3291 | 3306 | | |
3292 | 3307 | | |
| |||
4001 | 4016 | | |
4002 | 4017 | | |
4003 | 4018 | | |
4004 | | - | |
4005 | | - | |
| 4019 | + | |
| 4020 | + | |
| 4021 | + | |
| 4022 | + | |
| 4023 | + | |
| 4024 | + | |
| 4025 | + | |
| 4026 | + | |
4006 | 4027 | | |
4007 | 4028 | | |
4008 | 4029 | | |
| |||
| 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 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4228 | 4228 | | |
4229 | 4229 | | |
4230 | 4230 | | |
4231 | | - | |
| 4231 | + | |
4232 | 4232 | | |
4233 | 4233 | | |
4234 | 4234 | | |
| |||
4273 | 4273 | | |
4274 | 4274 | | |
4275 | 4275 | | |
4276 | | - | |
| 4276 | + | |
| 4277 | + | |
4277 | 4278 | | |
4278 | 4279 | | |
4279 | 4280 | | |
| |||
4658 | 4659 | | |
4659 | 4660 | | |
4660 | 4661 | | |
4661 | | - | |
| 4662 | + | |
4662 | 4663 | | |
4663 | 4664 | | |
4664 | 4665 | | |
| |||
4680 | 4681 | | |
4681 | 4682 | | |
4682 | 4683 | | |
4683 | | - | |
| 4684 | + | |
4684 | 4685 | | |
4685 | 4686 | | |
4686 | 4687 | | |
| |||
4725 | 4726 | | |
4726 | 4727 | | |
4727 | 4728 | | |
4728 | | - | |
| 4729 | + | |
| 4730 | + | |
4729 | 4731 | | |
4730 | 4732 | | |
4731 | 4733 | | |
| |||
4744 | 4746 | | |
4745 | 4747 | | |
4746 | 4748 | | |
4747 | | - | |
| 4749 | + | |
| 4750 | + | |
4748 | 4751 | | |
4749 | 4752 | | |
4750 | 4753 | | |
| |||
4849 | 4852 | | |
4850 | 4853 | | |
4851 | 4854 | | |
4852 | | - | |
| 4855 | + | |
4853 | 4856 | | |
4854 | 4857 | | |
4855 | 4858 | | |
| |||
0 commit comments