Commit 4826143
committed
[LoopVectorize] Enable more early exit vectorisation tests
PR llvm#112138 introduced initial support for dispatching to
multiple exit blocks via split middle blocks. This patch
fixes a few issues so that we can enable more tests to use
the new enable-early-exit-vectorization flag. Fixes are:
1. The code to bail out for any loop live-out values happens
too late. This is because collectUsersInExitBlocks ignores
induction variables, which get dealt with in fixupIVUsers.
I've moved the check much earlier in processLoop by looking
for outside users of loop-defined values.
2. We shouldn't yet be interleaving when vectorising loops
with uncountable early exits, since we've not added support
for this yet.
3. Similarly, we also shouldn't be creating vector epilogues.
4. Similarly, we shouldn't enable tail-folding.
5. The existing implementation doesn't yet support loops
that require scalar epilogues, although I plan to add that
as part of PR llvm#88385.
6. The new split middle blocks weren't being added to the
parent loop.
7. VPIRInstruction::execute assumed that the VPIRBasicBlock
predecessors correspond like-for-like with the predecessors
of the scalar exit block prior to vectorisation. For example,
collectUsersInExitBlocks adds the operands to the
VPIRInstruction in the order returned by predecessors(ExitBB),
whereas VPIRInstruction::execute processes the operands in
order of the VPIRBasicBlock predecessors. There is absolutely
no guarantee that they match up, which in some cases (such as
the yacr2 test in the LLVM test suite) they don't. I've fixed
this by maintaining the old behaviour when there is a single
operand, and when there are 2 or more operands we use the
same ordering as the BasicBlock predecessors.1 parent b1a40e4 commit 4826143
File tree
14 files changed
+453
-48
lines changed- llvm
- lib/Transforms/Vectorize
- test/Transforms/LoopVectorize
- AArch64
14 files changed
+453
-48
lines changedLines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1375 | 1375 | | |
1376 | 1376 | | |
1377 | 1377 | | |
1378 | | - | |
1379 | | - | |
1380 | | - | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
1381 | 1384 | | |
1382 | 1385 | | |
1383 | 1386 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2945 | 2945 | | |
2946 | 2946 | | |
2947 | 2947 | | |
| 2948 | + | |
| 2949 | + | |
| 2950 | + | |
| 2951 | + | |
| 2952 | + | |
| 2953 | + | |
| 2954 | + | |
| 2955 | + | |
| 2956 | + | |
| 2957 | + | |
| 2958 | + | |
| 2959 | + | |
| 2960 | + | |
| 2961 | + | |
| 2962 | + | |
2948 | 2963 | | |
2949 | 2964 | | |
2950 | 2965 | | |
| |||
2975 | 2990 | | |
2976 | 2991 | | |
2977 | 2992 | | |
2978 | | - | |
2979 | 2993 | | |
2980 | 2994 | | |
2981 | 2995 | | |
| |||
4051 | 4065 | | |
4052 | 4066 | | |
4053 | 4067 | | |
4054 | | - | |
| 4068 | + | |
| 4069 | + | |
4055 | 4070 | | |
4056 | 4071 | | |
4057 | 4072 | | |
| |||
4670 | 4685 | | |
4671 | 4686 | | |
4672 | 4687 | | |
4673 | | - | |
| 4688 | + | |
| 4689 | + | |
| 4690 | + | |
4674 | 4691 | | |
4675 | 4692 | | |
4676 | 4693 | | |
| |||
4920 | 4937 | | |
4921 | 4938 | | |
4922 | 4939 | | |
| 4940 | + | |
| 4941 | + | |
| 4942 | + | |
| 4943 | + | |
4923 | 4944 | | |
4924 | 4945 | | |
4925 | 4946 | | |
| |||
7753 | 7774 | | |
7754 | 7775 | | |
7755 | 7776 | | |
7756 | | - | |
| 7777 | + | |
| 7778 | + | |
| 7779 | + | |
7757 | 7780 | | |
7758 | 7781 | | |
7759 | 7782 | | |
7760 | 7783 | | |
| 7784 | + | |
7761 | 7785 | | |
7762 | 7786 | | |
7763 | 7787 | | |
| |||
9227 | 9251 | | |
9228 | 9252 | | |
9229 | 9253 | | |
9230 | | - | |
9231 | | - | |
9232 | | - | |
9233 | | - | |
9234 | | - | |
9235 | | - | |
9236 | | - | |
9237 | | - | |
9238 | | - | |
9239 | | - | |
9240 | | - | |
9241 | | - | |
9242 | | - | |
9243 | | - | |
9244 | | - | |
9245 | 9254 | | |
9246 | 9255 | | |
9247 | 9256 | | |
| |||
10003 | 10012 | | |
10004 | 10013 | | |
10005 | 10014 | | |
10006 | | - | |
| 10015 | + | |
10007 | 10016 | | |
10008 | | - | |
10009 | | - | |
| 10017 | + | |
| 10018 | + | |
10010 | 10019 | | |
10011 | 10020 | | |
10012 | 10021 | | |
| 10022 | + | |
| 10023 | + | |
| 10024 | + | |
| 10025 | + | |
| 10026 | + | |
| 10027 | + | |
| 10028 | + | |
| 10029 | + | |
| 10030 | + | |
| 10031 | + | |
| 10032 | + | |
| 10033 | + | |
| 10034 | + | |
| 10035 | + | |
| 10036 | + | |
| 10037 | + | |
10013 | 10038 | | |
10014 | 10039 | | |
10015 | 10040 | | |
| |||
10026 | 10051 | | |
10027 | 10052 | | |
10028 | 10053 | | |
| 10054 | + | |
| 10055 | + | |
| 10056 | + | |
| 10057 | + | |
| 10058 | + | |
| 10059 | + | |
| 10060 | + | |
| 10061 | + | |
| 10062 | + | |
| 10063 | + | |
| 10064 | + | |
| 10065 | + | |
| 10066 | + | |
| 10067 | + | |
| 10068 | + | |
| 10069 | + | |
10029 | 10070 | | |
10030 | 10071 | | |
10031 | 10072 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3762 | 3762 | | |
3763 | 3763 | | |
3764 | 3764 | | |
| 3765 | + | |
| 3766 | + | |
| 3767 | + | |
| 3768 | + | |
3765 | 3769 | | |
3766 | 3770 | | |
3767 | 3771 | | |
| |||
3842 | 3846 | | |
3843 | 3847 | | |
3844 | 3848 | | |
| 3849 | + | |
| 3850 | + | |
| 3851 | + | |
| 3852 | + | |
| 3853 | + | |
| 3854 | + | |
| 3855 | + | |
| 3856 | + | |
| 3857 | + | |
| 3858 | + | |
| 3859 | + | |
| 3860 | + | |
| 3861 | + | |
| 3862 | + | |
| 3863 | + | |
| 3864 | + | |
3845 | 3865 | | |
3846 | 3866 | | |
3847 | 3867 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
833 | 833 | | |
834 | 834 | | |
835 | 835 | | |
| 836 | + | |
| 837 | + | |
836 | 838 | | |
837 | 839 | | |
838 | 840 | | |
839 | 841 | | |
840 | 842 | | |
841 | | - | |
842 | | - | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
843 | 855 | | |
844 | 856 | | |
845 | 857 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1839 | 1839 | | |
1840 | 1840 | | |
1841 | 1841 | | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
1842 | 1847 | | |
1843 | 1848 | | |
1844 | 1849 | | |
| |||
Lines changed: 55 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
275 | 293 | | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
276 | 320 | | |
277 | | - | |
278 | | - | |
| 321 | + | |
| 322 | + | |
279 | 323 | | |
280 | 324 | | |
281 | 325 | | |
282 | 326 | | |
283 | 327 | | |
284 | | - | |
| 328 | + | |
285 | 329 | | |
286 | 330 | | |
287 | 331 | | |
288 | 332 | | |
289 | 333 | | |
290 | | - | |
| 334 | + | |
291 | 335 | | |
292 | 336 | | |
293 | 337 | | |
| |||
331 | 375 | | |
332 | 376 | | |
333 | 377 | | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
| 144 | + | |
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
0 commit comments