[llvm] [AggressiveInstCombine] Guard memset with length in [0, 1] (PR #213240)

via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 27 02:28:20 PDT 2026


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Linux-->
# :penguin: Linux x64 Test Results

* 181369 tests passed
* 3741 tests skipped
* 1 test failed

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

### LLVM
<details>
<summary>LLVM.Transforms/AggressiveInstCombine/memset.ll</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/opt -passes=aggressive-instcombine -S < /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/AggressiveInstCombine/memset.ll | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/AggressiveInstCombine/memset.ll --check-prefix=AIC
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/opt -passes=aggressive-instcombine -S
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/AggressiveInstCombine/memset.ll --check-prefix=AIC
# note: command had no output on stdout or stderr
# RUN: at line 2
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/opt -passes='aggressive-instcombine,instcombine' -S < /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/AggressiveInstCombine/memset.ll | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/AggressiveInstCombine/memset.ll --check-prefix=COMBINED
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/opt -passes=aggressive-instcombine,instcombine -S
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/AggressiveInstCombine/memset.ll --check-prefix=COMBINED
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/AggressiveInstCombine/memset.ll:78:13: error: COMBINED: expected string not found in input
# | ; COMBINED: store volatile i8 [[VALUE]], ptr [[DST]], align 1
# |             ^
# | <stdin>:39:7: note: scanning from here
# |  br i1 %memset.notzero.not, label %1, label %0
# |       ^
# | <stdin>:39:7: note: with "VALUE" equal to "%value"
# |  br i1 %memset.notzero.not, label %1, label %0
# |       ^
# | <stdin>:39:7: note: with "DST" equal to "%dst"
# |  br i1 %memset.notzero.not, label %1, label %0
# |       ^
# | <stdin>:42:10: note: possible intended match here
# |  call void @llvm.memset.p0.i64(ptr align 1 %dst, i8 %value, i64 1, i1 true)
# |          ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/AggressiveInstCombine/memset.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |            34:  
# |            35: define void @range_0_1_volatile(ptr %dst, i8 %value, i64 %n) { 
# |            36: entry: 
# |            37:  %len = and i64 %n, 1 
# |            38:  %memset.notzero.not = icmp eq i64 %len, 0 
# |            39:  br i1 %memset.notzero.not, label %1, label %0 
# | check:78'0          {                                           search range start (exclusive)
# | check:78'1                                                      error: no match found in search range
# | check:78'2                                                      with "VALUE" equal to "%value"
# | check:78'3                                                      with "DST" equal to "%dst"
# |            40:  
# |            41: 0: ; preds = %entry 
# |            42:  call void @llvm.memset.p0.i64(ptr align 1 %dst, i8 %value, i64 1, i1 true) 
# | check:78'4              ?                                                                    possible intended match
# |            43:  br label %1 
# |            44:  
# |            45: 1: ; preds = %entry, %0 
# |            46:  ret void 
# |            47: } 
# |            48:  
# |            49: define void @range_0_2(ptr %dst, i8 %value, i64 %n) { 
# | check:78'5                            }                                search range end (exclusive)
# |            50: entry: 
# |            51:  %len = urem i64 %n, 3 
# |            52:  call void @llvm.memset.p0.i64(ptr align 1 %dst, i8 %value, i64 %len, i1 false) 
# |            53:  ret void 
# |            54: } 
# |            55:  
# |            56: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: write) } 
# | >>>>>>
# `-----------------------------
# 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/213240


More information about the llvm-commits mailing list