[llvm] [VPlan] Allow tail folding with uncountable early exits (PR #174974)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 8 05:46:23 PST 2026


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Windows-->
# :window: Windows x64 Test Results

* 129243 tests passed
* 2852 tests skipped
* 3 tests failed

## Failed Tests
(click on a test name to see its output)

### LLVM
<details>
<summary>LLVM.Transforms/LoopVectorize/AArch64/early_exit_costs.ll</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
c:\_work\llvm-project\llvm-project\build\bin\opt.exe -S < C:\_work\llvm-project\llvm-project\llvm\test\Transforms\LoopVectorize\AArch64\early_exit_costs.ll -p loop-vectorize -disable-output    -debug-only=loop-vectorize 2>&1 | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\Transforms\LoopVectorize\AArch64\early_exit_costs.ll --check-prefixes=CHECK
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\opt.exe' -S -p loop-vectorize -disable-output -debug-only=loop-vectorize
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\Transforms\LoopVectorize\AArch64\early_exit_costs.ll' --check-prefixes=CHECK
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\llvm\test\Transforms\LoopVectorize\AArch64\early_exit_costs.ll:97:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: Cost of 1 for VF 1: EMIT vp<%first.active.lane> = first-active-lane ir<%t>
# |               ^
# | <stdin>:1892:58: note: scanning from here
# | Calculating cost of work in exit block vector.early.exit:
# |                                                          ^
# | <stdin>:1893:1: note: possible intended match here
# | Cost of 0 for VF 1: EMIT vp<%early.exit.value> = extract-lane vp<%first.active.lane>, ir<%l>
# | ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\llvm\test\Transforms\LoopVectorize\AArch64\early_exit_costs.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |            .
# |            .
# |            .
# |         1887: Cost of 1 for VF 1: induction instruction %iv.next = add i64 %iv, 1 
# |         1888: Cost of 0 for VF 1: induction instruction %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop.latch ] 
# |         1889: Cost of 0 for VF 1: exit condition instruction %t = trunc i64 %l to i1 
# |         1890: Cost of 1 for VF 1: exit condition instruction %ec = icmp eq i64 %iv.next, 100 
# |         1891: LV: Selecting VF: 1. 
# |         1892: Calculating cost of work in exit block vector.early.exit: 
# | next:97'0                                                              X error: no match found
# |         1893: Cost of 0 for VF 1: EMIT vp<%early.exit.value> = extract-lane vp<%first.active.lane>, ir<%l> 
# | next:97'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | next:97'1     ?                                                                                             possible intended match
# |         1894: Cost of 0 for VF 1: EMIT vp<%cmp.n> = icmp eq ir<100>, vp<%2> 
# | next:97'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |         1895: Cost of 0 for VF 1: EMIT branch-on-cond vp<%cmp.n> 
# | next:97'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |         1896: LV: Vectorization is possible but not beneficial. 
# | next:97'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |         1897: LV: Interleaving is not beneficial. 
# | next:97'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>LLVM.Transforms/LoopVectorize/loop-form.ll</summary>

```
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 2
c:\_work\llvm-project\llvm-project\build\bin\opt.exe -S -passes=loop-vectorize -force-vector-width=2 < C:\_work\llvm-project\llvm-project\llvm\test\Transforms\LoopVectorize\loop-form.ll | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\Transforms\LoopVectorize\loop-form.ll
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\opt.exe' -S -passes=loop-vectorize -force-vector-width=2
# .---command stderr------------
# | Assertion failed: is_contained(Plan.getExitBlocks().front()->predecessors(), Plan.getMiddleBlock()) && "the exit block must have middle block as a predecessor", file C:\_work\llvm-project\llvm-project\llvm\lib\Transforms\Vectorize\VPlanPredicator.cpp, line 314
# | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
# | Stack dump:
# | 0.	Program arguments: c:\\_work\\llvm-project\\llvm-project\\build\\bin\\opt.exe -S -passes=loop-vectorize -force-vector-width=2
# | 1.	Running pass "function(loop-vectorize<no-interleave-forced-only;no-vectorize-forced-only;>)" on module "<stdin>"
# | 2.	Running pass "loop-vectorize<no-interleave-forced-only;no-vectorize-forced-only;>" on function "optsize"
# | Exception Code: 0xC000001D
# |  #0 0x00007ff7e9497b76 (c:\_work\llvm-project\llvm-project\build\bin\opt.exe+0x907b76)
# |  #1 0x00007ffd672abb04 (C:\Windows\System32\ucrtbase.dll+0x7bb04)
# |  #2 0x00007ffd672acad1 (C:\Windows\System32\ucrtbase.dll+0x7cad1)
# |  #3 0x00007ffd672ae4a1 (C:\Windows\System32\ucrtbase.dll+0x7e4a1)
# |  #4 0x00007ffd672ae6e1 (C:\Windows\System32\ucrtbase.dll+0x7e6e1)
# |  #5 0x00007ff7ecde71c0 (c:\_work\llvm-project\llvm-project\build\bin\opt.exe+0x42571c0)
# |  #6 0x00007ff7eb4b15d8 (c:\_work\llvm-project\llvm-project\build\bin\opt.exe+0x29215d8)
# |  #7 0x00007ff7eb4a3a18 (c:\_work\llvm-project\llvm-project\build\bin\opt.exe+0x2913a18)
# |  #8 0x00007ff7eb4a3426 (c:\_work\llvm-project\llvm-project\build\bin\opt.exe+0x2913426)
# |  #9 0x00007ff7eb4b8c66 (c:\_work\llvm-project\llvm-project\build\bin\opt.exe+0x2928c66)
# | #10 0x00007ff7eb4c3dd2 (c:\_work\llvm-project\llvm-project\build\bin\opt.exe+0x2933dd2)
# | #11 0x00007ff7eb4c4a10 (c:\_work\llvm-project\llvm-project\build\bin\opt.exe+0x2934a10)
# | #12 0x00007ff7e9c46e11 (c:\_work\llvm-project\llvm-project\build\bin\opt.exe+0x10b6e11)
# | #13 0x00007ff7e99cc9cd (c:\_work\llvm-project\llvm-project\build\bin\opt.exe+0xe3c9cd)
# | #14 0x00007ff7e8fd7e11 (c:\_work\llvm-project\llvm-project\build\bin\opt.exe+0x447e11)
# | #15 0x00007ff7e99cfec6 (c:\_work\llvm-project\llvm-project\build\bin\opt.exe+0xe3fec6)
# | #16 0x00007ff7e8ec3b81 (c:\_work\llvm-project\llvm-project\build\bin\opt.exe+0x333b81)
# | #17 0x00007ff7e99cb94d (c:\_work\llvm-project\llvm-project\build\bin\opt.exe+0xe3b94d)
# | #18 0x00007ff7e8ebd87c (c:\_work\llvm-project\llvm-project\build\bin\opt.exe+0x32d87c)
# | #19 0x00007ff7e8b96f63 (c:\_work\llvm-project\llvm-project\build\bin\opt.exe+0x6f63)
# | #20 0x00007ff7e8b91025 (c:\_work\llvm-project\llvm-project\build\bin\opt.exe+0x1025)
# | #21 0x00007ff7ed3c9e34 (c:\_work\llvm-project\llvm-project\build\bin\opt.exe+0x4839e34)
# | #22 0x00007ffd6d0a4cb0 (C:\Windows\System32\KERNEL32.DLL+0x14cb0)
# | #23 0x00007ffd7861edcb (C:\Windows\SYSTEM32\ntdll.dll+0x7edcb)
# `-----------------------------
# error: command failed with exit status: 0xc000001d
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\Transforms\LoopVectorize\loop-form.ll'
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line:  c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\Transforms\LoopVectorize\loop-form.ll
# `-----------------------------
# error: command failed with exit status: 2

--

```
</details>

### LLVM-Unit
<details>
<summary>LLVM-Unit.Transforms/Vectorize/_/VectorizeTests_exe/VPUncountableExitTest/FindUncountableExitRecipes</summary>

```
Script:
--
C:\_work\llvm-project\llvm-project\build\unittests\Transforms\Vectorize\.\VectorizeTests.exe --gtest_filter=VPUncountableExitTest.FindUncountableExitRecipes
--
C:\_work\llvm-project\llvm-project\llvm\unittests\Transforms\Vectorize\VPlanUncountableExitTest.cpp:59
Value of: UncountableCondition.has_value()
  Actual: false
Expected: true


```
</details>

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.

https://github.com/llvm/llvm-project/pull/174974


More information about the llvm-commits mailing list