[llvm] [LoopVectorize] Enable vectorization of uncountable loops with invariant bound loads via speculative hoisting and runtime versioning. (PR #195027)

via llvm-commits llvm-commits at lists.llvm.org
Fri May 1 02:08:16 PDT 2026


github-actions[bot] wrote:

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

* 134130 tests passed
* 3190 tests skipped
* 3 tests failed

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

### LLVM
<details>
<summary>LLVM.Transforms/LoopVectorize/dynamic-bound-array-element.ll</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
c:\_work\llvm-project\llvm-project\build\bin\opt.exe < C:\_work\llvm-project\llvm-project\llvm\test\Transforms\LoopVectorize\dynamic-bound-array-element.ll -S -passes='loop-vectorize' | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\Transforms\LoopVectorize\dynamic-bound-array-element.ll
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\opt.exe' -S -passes=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\dynamic-bound-array-element.ll'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\llvm\test\Transforms\LoopVectorize\dynamic-bound-array-element.ll:170:10: error: CHECK: expected string not found in input
# | ; CHECK: [[LOOP4]] = distinct !{[[LOOP4]], [[META5:![0-9]+]], [[META6:![0-9]+]]}
# |          ^
# | <stdin>:136:27: note: scanning from here
# | !3 = !{!"Simple C++ TBAA"}
# |                           ^
# | <stdin>:136:27: note: with "LOOP4" equal to "!4"
# | !3 = !{!"Simple C++ TBAA"}
# |                           ^
# | <stdin>:136:27: note: with "LOOP4" equal to "!4"
# | !3 = !{!"Simple C++ TBAA"}
# |                           ^
# | <stdin>:142:2: note: possible intended match here
# | !9 = distinct !{!9, !10, !11}
# |  ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\llvm\test\Transforms\LoopVectorize\dynamic-bound-array-element.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |              .
# |              .
# |              .
# |            131: attributes #1 = { nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) } 
# |            132:  
# |            133: !0 = !{!1, !1, i64 0, i64 4} 
# |            134: !1 = !{!2, i64 4, !"int"} 
# |            135: !2 = !{!3, i64 1, !"omnipotent char"} 
# |            136: !3 = !{!"Simple C++ TBAA"} 
# | check:170'0                               X error: no match found
# | check:170'1                                 with "LOOP4" equal to "!4"
# | check:170'2                                 with "LOOP4" equal to "!4"
# |            137: !4 = distinct !{!4, !5, !6, !7} 
# | check:170'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            138: !5 = !{!"llvm.loop.speculative.bound.hoist.versioned"} 
# | check:170'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            139: !6 = !{!"llvm.loop.isvectorized", i32 1} 
# | check:170'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            140: !7 = !{!"llvm.loop.unroll.runtime.disable"} 
# | check:170'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            141: !8 = distinct !{!8, !5, !6} 
# | check:170'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            142: !9 = distinct !{!9, !10, !11} 
# | check:170'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:170'3      ?                             possible intended match
# |            143: !10 = !{!"llvm.loop.mustprogress"} 
# | check:170'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            144: !11 = !{!"llvm.loop.unroll.disable"} 
# | check:170'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>LLVM.Transforms/LoopVectorize/dynamic-bound-n-stores.ll</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
c:\_work\llvm-project\llvm-project\build\bin\opt.exe < C:\_work\llvm-project\llvm-project\llvm\test\Transforms\LoopVectorize\dynamic-bound-n-stores.ll -S -passes='loop-vectorize' | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\Transforms\LoopVectorize\dynamic-bound-n-stores.ll
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\opt.exe' -S -passes=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\dynamic-bound-n-stores.ll'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\llvm\test\Transforms\LoopVectorize\dynamic-bound-n-stores.ll:149:15: error: CHECK-NEXT: is not on the line after the previous match
# | ; CHECK-NEXT: br label %[[FOR_BODY:.*]]
# |               ^
# | <stdin>:163:2: note: 'next' match was here
# |  br label %vector.body
# |  ^
# | <stdin>:130:17: note: previous match ended here
# | ivbound.rtcheck: ; preds = %entry
# |                 ^
# | <stdin>:131:1: note: non-matching line after previous match is here
# |  %.speculatively.hoisted = load i32, ptr %LoopBound, align 4, !tbaa !4
# | ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\llvm\test\Transforms\LoopVectorize\dynamic-bound-n-stores.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |           .
# |           .
# |           .
# |         158:  br i1 %found.conflict8, label %scalar.ph, label %vector.ph 
# |         159:  
# |         160: vector.ph: ; preds = %vector.memcheck 
# |         161:  %n.mod.vf = urem i64 %smax9, 8 
# |         162:  %n.vec = sub i64 %smax9, %n.mod.vf 
# |         163:  br label %vector.body 
# | next:149      !~~~~~~~~~~~~~~~~~~~~  error: match on wrong line
# |         164:  
# |         165: vector.body: ; preds = %vector.body, %vector.ph 
# |         166:  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] 
# |         167:  %5 = getelementptr inbounds nuw i32, ptr %B, i64 %index 
# |         168:  %6 = getelementptr inbounds nuw i32, ptr %5, i64 4 
# |           .
# |           .
# |           .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>LLVM.Transforms/LoopVectorize/dynamic-bound-simple.ll</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
c:\_work\llvm-project\llvm-project\build\bin\opt.exe -passes=loop-vectorize -mtriple=aarch64-unknown-linux-gnu -S C:\_work\llvm-project\llvm-project\llvm\test\Transforms\LoopVectorize\dynamic-bound-simple.ll | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\Transforms\LoopVectorize\dynamic-bound-simple.ll
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\opt.exe' -passes=loop-vectorize -mtriple=aarch64-unknown-linux-gnu -S 'C:\_work\llvm-project\llvm-project\llvm\test\Transforms\LoopVectorize\dynamic-bound-simple.ll'
# 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\dynamic-bound-simple.ll'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\llvm\test\Transforms\LoopVectorize\dynamic-bound-simple.ll:154:10: error: CHECK: expected string not found in input
# | ; CHECK: [[LOOP12]] = distinct !{[[LOOP12]], [[META13:![0-9]+]], [[META14:![0-9]+]]}
# |          ^
# | <stdin>:135:26: note: scanning from here
# | !11 = distinct !{!11, !9}
# |                          ^
# | <stdin>:135:26: note: with "LOOP12" equal to "!12"
# | !11 = distinct !{!11, !9}
# |                          ^
# | <stdin>:135:26: note: with "LOOP12" equal to "!12"
# | !11 = distinct !{!11, !9}
# |                          ^
# | <stdin>:136:3: note: possible intended match here
# | !12 = distinct !{!12, !13, !14, !15}
# |   ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\llvm\test\Transforms\LoopVectorize\dynamic-bound-simple.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |              .
# |              .
# |              .
# |            130: !6 = !{!"Simple C++ TBAA"} 
# |            131: !7 = !{!8} 
# |            132: !8 = distinct !{!8, !9} 
# |            133: !9 = distinct !{!9, !"LVerDomain"} 
# |            134: !10 = !{!11} 
# |            135: !11 = distinct !{!11, !9} 
# | check:154'0                              X error: no match found
# | check:154'1                                with "LOOP12" equal to "!12"
# | check:154'2                                with "LOOP12" equal to "!12"
# |            136: !12 = distinct !{!12, !13, !14, !15} 
# | check:154'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:154'3       ?                                   possible intended match
# |            137: !13 = !{!"llvm.loop.speculative.bound.hoist.versioned"} 
# | check:154'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            138: !14 = !{!"llvm.loop.isvectorized", i32 1} 
# | check:154'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            139: !15 = !{!"llvm.loop.unroll.runtime.disable"} 
# | check:154'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            140: !16 = distinct !{!16, !13, !14} 
# | check:154'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            141: !17 = distinct !{!17, !18} 
# | check:154'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            142: !18 = !{!"llvm.loop.mustprogress"} 
# | check:154'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</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/195027


More information about the llvm-commits mailing list