Commit 541e511
authored
[LV] Use getFixedValue instead of getKnownMinValue when appropriate (llvm#143526)
There are many places in VPlan and LoopVectorize where we use
getKnownMinValue to discover the number of elements in a vector. Where
we expect the vector to have a fixed length, I have used the stronger
getFixedValue call. I believe this is clearer and adds extra protection
in the form of an assert in getFixedValue that the vector is not
scalable.
While looking at VPFirstOrderRecurrencePHIRecipe::computeCost I also
took the liberty of simplifying the code.
In theory I believe this patch should be NFC, but I'm reluctant to add
that to the title in case we're just missing tests for some of the VPlan
changes. I built and ran the LLVM test suite when targeting neoverse-v1
and it seemed ok.1 parent 2019553 commit 541e511
File tree
3 files changed
+31
-28
lines changed- llvm/lib/Transforms/Vectorize
3 files changed
+31
-28
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3116 | 3116 | | |
3117 | 3117 | | |
3118 | 3118 | | |
3119 | | - | |
3120 | | - | |
| 3119 | + | |
| 3120 | + | |
3121 | 3121 | | |
3122 | 3122 | | |
3123 | | - | |
3124 | | - | |
| 3123 | + | |
| 3124 | + | |
| 3125 | + | |
3125 | 3126 | | |
3126 | 3127 | | |
3127 | 3128 | | |
| |||
4289 | 4290 | | |
4290 | 4291 | | |
4291 | 4292 | | |
4292 | | - | |
| 4293 | + | |
4293 | 4294 | | |
4294 | 4295 | | |
4295 | 4296 | | |
| |||
4574 | 4575 | | |
4575 | 4576 | | |
4576 | 4577 | | |
4577 | | - | |
4578 | | - | |
| 4578 | + | |
| 4579 | + | |
4579 | 4580 | | |
4580 | 4581 | | |
4581 | 4582 | | |
| |||
4586 | 4587 | | |
4587 | 4588 | | |
4588 | 4589 | | |
4589 | | - | |
| 4590 | + | |
4590 | 4591 | | |
4591 | 4592 | | |
4592 | 4593 | | |
| |||
5257 | 5258 | | |
5258 | 5259 | | |
5259 | 5260 | | |
5260 | | - | |
| 5261 | + | |
5261 | 5262 | | |
5262 | 5263 | | |
5263 | 5264 | | |
5264 | 5265 | | |
5265 | | - | |
5266 | | - | |
5267 | | - | |
| 5266 | + | |
| 5267 | + | |
| 5268 | + | |
5268 | 5269 | | |
5269 | 5270 | | |
5270 | 5271 | | |
| |||
5280 | 5281 | | |
5281 | 5282 | | |
5282 | 5283 | | |
5283 | | - | |
| 5284 | + | |
5284 | 5285 | | |
5285 | 5286 | | |
5286 | 5287 | | |
| |||
5341 | 5342 | | |
5342 | 5343 | | |
5343 | 5344 | | |
| 5345 | + | |
| 5346 | + | |
| 5347 | + | |
| 5348 | + | |
5344 | 5349 | | |
5345 | 5350 | | |
5346 | 5351 | | |
| |||
5623 | 5628 | | |
5624 | 5629 | | |
5625 | 5630 | | |
5626 | | - | |
| 5631 | + | |
5627 | 5632 | | |
5628 | 5633 | | |
5629 | 5634 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
334 | | - | |
| 334 | + | |
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
| |||
368 | 368 | | |
369 | 369 | | |
370 | 370 | | |
371 | | - | |
| 371 | + | |
372 | 372 | | |
373 | 373 | | |
374 | 374 | | |
| |||
789 | 789 | | |
790 | 790 | | |
791 | 791 | | |
792 | | - | |
793 | | - | |
| 792 | + | |
794 | 793 | | |
795 | 794 | | |
796 | 795 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
871 | 871 | | |
872 | 872 | | |
873 | 873 | | |
874 | | - | |
| 874 | + | |
875 | 875 | | |
876 | 876 | | |
877 | 877 | | |
| |||
2787 | 2787 | | |
2788 | 2788 | | |
2789 | 2789 | | |
2790 | | - | |
2791 | | - | |
| 2790 | + | |
2792 | 2791 | | |
2793 | 2792 | | |
2794 | 2793 | | |
| |||
2841 | 2840 | | |
2842 | 2841 | | |
2843 | 2842 | | |
2844 | | - | |
| 2843 | + | |
2845 | 2844 | | |
2846 | 2845 | | |
2847 | 2846 | | |
| |||
3390 | 3389 | | |
3391 | 3390 | | |
3392 | 3391 | | |
3393 | | - | |
| 3392 | + | |
3394 | 3393 | | |
3395 | 3394 | | |
3396 | 3395 | | |
| |||
3402 | 3401 | | |
3403 | 3402 | | |
3404 | 3403 | | |
3405 | | - | |
3406 | | - | |
| 3404 | + | |
| 3405 | + | |
3407 | 3406 | | |
3408 | 3407 | | |
3409 | 3408 | | |
| |||
3454 | 3453 | | |
3455 | 3454 | | |
3456 | 3455 | | |
| 3456 | + | |
3457 | 3457 | | |
3458 | 3458 | | |
3459 | 3459 | | |
| |||
3466 | 3466 | | |
3467 | 3467 | | |
3468 | 3468 | | |
3469 | | - | |
| 3469 | + | |
3470 | 3470 | | |
3471 | 3471 | | |
3472 | 3472 | | |
3473 | 3473 | | |
3474 | 3474 | | |
3475 | | - | |
3476 | 3475 | | |
3477 | 3476 | | |
3478 | 3477 | | |
| |||
3808 | 3807 | | |
3809 | 3808 | | |
3810 | 3809 | | |
3811 | | - | |
| 3810 | + | |
3812 | 3811 | | |
3813 | 3812 | | |
3814 | 3813 | | |
| |||
0 commit comments