[llvm] [LV] Accept swapped operands in early-exit condition compare (PR #199989)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 23 22:49:01 PDT 2026


github-actions[bot] wrote:

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

* 136115 tests passed
* 3475 tests skipped
* 1 test failed

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

### LLVM
<details>
<summary>LLVM.Transforms/LoopVectorize/early_exit_with_stores.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\early_exit_with_stores.ll -p loop-vectorize -force-vector-width=4 -force-target-supports-masked-memory-ops -enable-early-exit-vectorization-with-side-effects | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\Transforms\LoopVectorize\early_exit_with_stores.ll
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\opt.exe' -S -p loop-vectorize -force-vector-width=4 -force-target-supports-masked-memory-ops -enable-early-exit-vectorization-with-side-effects
# 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\early_exit_with_stores.ll'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\llvm\test\Transforms\LoopVectorize\early_exit_with_stores.ll:1330:15: error: CHECK-NEXT: is not on the line after the previous match
# | ; CHECK-NEXT: [[TMP0:%.*]] = getelementptr i16, ptr [[ARRAY]], i64 [[INDEX]]
# |               ^
# | <stdin>:799:2: note: 'next' match was here
# |  %3 = getelementptr i16, ptr %array, i64 %index
# |  ^
# | <stdin>:793:67: note: previous match ended here
# |  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
# |                                                                   ^
# | <stdin>:794:1: note: non-matching line after previous match is here
# |  %0 = getelementptr inbounds nuw i16, ptr %pred, i64 %index
# | ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\llvm\test\Transforms\LoopVectorize\early_exit_with_stores.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |            .
# |            .
# |            .
# |          794:  %0 = getelementptr inbounds nuw i16, ptr %pred, i64 %index 
# |          795:  %wide.load = load <4 x i16>, ptr %0, align 2 
# |          796:  %1 = icmp slt <4 x i16> splat (i16 500), %wide.load 
# |          797:  %2 = call i64 @llvm.experimental.cttz.elts.i64.v4i1(<4 x i1> %1, i1 false) 
# |          798:  %uncountable.exit.mask = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i64(i64 0, i64 %2) 
# |          799:  %3 = getelementptr i16, ptr %array, i64 %index 
# | next:1330      !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  error: match on wrong line
# |          800:  %wide.masked.load = call <4 x i16> @llvm.masked.load.v4i16.p0(ptr align 2 %3, <4 x i1> %uncountable.exit.mask, <4 x i16> poison) 
# |          801:  %4 = add nsw <4 x i16> %wide.masked.load, splat (i16 1) 
# |          802:  call void @llvm.masked.store.v4i16.p0(<4 x i16> %4, ptr align 2 %3, <4 x i1> %uncountable.exit.mask) 
# |          803:  %5 = freeze <4 x i1> %1 
# |          804:  %6 = call i1 @llvm.vector.reduce.or.v4i1(<4 x i1> %5) 
# |            .
# |            .
# |            .
# | >>>>>>
# `-----------------------------
# 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/199989


More information about the llvm-commits mailing list