[llvm] [InstCombine] Fold (X s>> (N-1)) | Y into (X s< 0) ? -1 : Y (PR #207228)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 2 10:26:23 PDT 2026


github-actions[bot] wrote:

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

* 176659 tests passed
* 3570 tests skipped
* 4 tests failed

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

### LLVM
<details>
<summary>LLVM.Transforms/InstCombine/ashr-or-mul-abs.ll</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/opt < /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/InstCombine/ashr-or-mul-abs.ll -passes=instcombine -S | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/InstCombine/ashr-or-mul-abs.ll
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/opt -passes=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/InstCombine/ashr-or-mul-abs.ll
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/InstCombine/ashr-or-mul-abs.ll:32:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: [[I2:%.*]] = call i32 @llvm.abs.i32(i32 [[X]], i1 false)
# |               ^
# | <stdin>:15:23: note: scanning from here
# |  %X = sdiv i32 42, %PX
# |                       ^
# | <stdin>:15:23: note: with "X" equal to "%X"
# |  %X = sdiv i32 42, %PX
# |                       ^
# | <stdin>:16:2: note: possible intended match here
# |  %i2 = call i32 @llvm.abs.i32(i32 %X, i1 true)
# |  ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/InstCombine/ashr-or-mul-abs.ll:93:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: [[I:%.*]] = ashr i32 [[X:%.*]], 31
# |               ^
# | <stdin>:42:37: note: scanning from here
# | define i32 @ashr_or_mul_to_abs_neg2(i32 %X) {
# |                                     ^
# | <stdin>:43:13: note: possible intended match here
# |  %isneg.inv = icmp sgt i32 %X, -1
# |             ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/InstCombine/ashr-or-mul-abs.ll:106:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: [[I:%.*]] = ashr i32 [[X:%.*]], 31
# |               ^
# | <stdin>:49:37: note: scanning from here
# | define i32 @ashr_or_mul_to_abs_neg3(i32 %X, i32 %Y) {
# |                                     ^
# | <stdin>:51:14: note: possible intended match here
# |  %isneg.inv1 = icmp slt i32 %X, 0
# |              ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/InstCombine/ashr-or-mul-abs.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |            10:  %i2 = call i32 @llvm.abs.i32(i32 %X, i1 false) 
# |            11:  ret i32 %i2 
# |            12: } 
# |            13:  
# |            14: define i32 @ashr_or_mul_to_abs3(i32 %PX) { 
# |            15:  %X = sdiv i32 42, %PX 
# | next:32'0                           {   search range start (exclusive)
# | next:32'1                               error: no match found in search range
# | next:32'2                               with "X" equal to "%X"
# |            16:  %i2 = call i32 @llvm.abs.i32(i32 %X, i1 true) 
# | next:32'3       ?                                               possible intended match
# |            17:  ret i32 %i2 
# |            18: } 
# |            19:  
# |            20: define <4 x i32> @ashr_or_mul_to_abs_vec(<4 x i32> %X) { 
# | next:32'4                                               }                 search range end (exclusive)
# |            21:  %i2 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %X, i1 false) 
# |            22:  ret <4 x i32> %i2 
# |            23: } 
# |            24:  
# |            25: define <4 x i32> @ashr_or_mul_to_abs_vec2(<4 x i32> %X) { 
# |             .
# |             .
# |             .
# |            37:  %i1 = or i32 %i, 1 
# |            38:  %i2 = mul nsw i32 %i1, %X 
# |            39:  ret i32 %i2 
# |            40: } 
# |            41:  
# |            42: define i32 @ashr_or_mul_to_abs_neg2(i32 %X) { 
# | next:93'0                                         {            search range start (exclusive)
# | next:93'1                                                      error: no match found in search range
# |            43:  %isneg.inv = icmp sgt i32 %X, -1 
# | next:93'2                  ?                       possible intended match
# |            44:  %i1 = select i1 %isneg.inv, i32 2, i32 -1 
# |            45:  %i2 = mul nsw i32 %i1, %X 
# |            46:  ret i32 %i2 
# |            47: } 
# |            48:  
# |            49: define i32 @ashr_or_mul_to_abs_neg3(i32 %X, i32 %Y) { 
# | next:93'3                                          }                   search range end (exclusive)
# | next:106'0                                        {                    search range start (exclusive)
# | next:106'1                                                             error: no match found in search range
# |            50:  %1 = sub nsw i32 0, %Y 
# |            51:  %isneg.inv1 = icmp slt i32 %X, 0 
# | next:106'2                  ?                      possible intended match
# |            52:  %i2 = select i1 %isneg.inv1, i32 %1, i32 %Y 
# |            53:  ret i32 %i2 
# |            54: } 
# |            55:  
# |            56: ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) 
# |            57: declare i32 @llvm.abs.i32(i32, i1 immarg) #0 
# |            58:  
# |            59: ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) 
# |            60: declare <4 x i32> @llvm.abs.v4i32(<4 x i32>, i1 immarg) #0 
# |            61:  
# |            62: attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } 
# | next:106'3                                                                                                } search range end (exclusive)
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>LLVM.Transforms/InstCombine/compare-signs.ll</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/opt -passes=instcombine -S < /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/InstCombine/compare-signs.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/InstCombine/compare-signs.ll
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/opt -passes=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/InstCombine/compare-signs.ll
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/InstCombine/compare-signs.ll:211:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: [[C:%.*]] = icmp slt <2 x i64> [[A:%.*]], splat (i64 1)
# |               ^
# | <stdin>:104:29: note: scanning from here
# | define <2 x i1> @test4c_vec(<2 x i64> %a) {
# |                             ^
# | <stdin>:107:6: note: possible intended match here
# |  %isneg.inv = icmp sgt <2 x i64> %a, splat (i64 -1)
# |      ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/InstCombine/compare-signs.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |            99: define i1 @test4c(i64 %a) { 
# |           100:  %c = icmp slt i64 %a, 1 
# |           101:  ret i1 %c 
# |           102: } 
# |           103:  
# |           104: define <2 x i1> @test4c_vec(<2 x i64> %a) { 
# | next:211'0                                {                  search range start (exclusive)
# | next:211'1                                                   error: no match found in search range
# |           105:  %na = sub <2 x i64> zeroinitializer, %a 
# |           106:  %r = lshr <2 x i64> %na, splat (i64 63) 
# |           107:  %isneg.inv = icmp sgt <2 x i64> %a, splat (i64 -1) 
# | next:211'2          ?                                                possible intended match
# |           108:  %signum = select <2 x i1> %isneg.inv, <2 x i64> %r, <2 x i64> splat (i64 -1) 
# |           109:  %signum.trunc = trunc nsw <2 x i64> %signum to <2 x i32> 
# |           110:  %c = icmp slt <2 x i32> %signum.trunc, splat (i32 1) 
# |           111:  ret <2 x i1> %c 
# |           112: } 
# |           113:  
# |           114: define i1 @shift_trunc_signbit_test(i32 %x) { 
# | next:211'3                                         }           search range end (exclusive)
# |           115:  %r = icmp slt i32 %x, 0 
# |           116:  ret i1 %r 
# |           117: } 
# |           118:  
# |           119: define <2 x i1> @shift_trunc_signbit_test_vec_uses(<2 x i17> %x, ptr %p1, ptr %p2) { 
# |             .
# |             .
# |             .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>LLVM.Transforms/InstCombine/or.ll</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/opt < /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/InstCombine/or.ll -passes=instcombine -S | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/InstCombine/or.ll --check-prefixes=CHECK,CONSTVEC
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/opt -passes=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/InstCombine/or.ll --check-prefixes=CHECK,CONSTVEC
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/InstCombine/or.ll:1476:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: [[SIGN:%.*]] = ashr i8 [[X:%.*]], 7
# |               ^
# | <stdin>:677:31: note: scanning from here
# | define i8 @ashr_bitwidth_mask(i8 %x, i8 %y) {
# |                               ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/InstCombine/or.ll:1488:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: [[SIGN:%.*]] = ashr <2 x i8> [[X:%.*]], splat (i8 7)
# |               ^
# | <stdin>:684:38: note: scanning from here
# |  %y = mul <2 x i8> %py, <i8 42, i8 2>
# |                                      ^
# | <stdin>:685:13: note: possible intended match here
# |  %isneg.inv = icmp sgt <2 x i8> %x, splat (i8 -1)
# |             ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/InstCombine/or.ll:2363:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: [[X_LOBIT:%.*]] = lshr i32 [[X]], 31
# |               ^
# | <stdin>:1111:28: note: scanning from here
# |  %x.lobit = ashr i32 %x, 31
# |                            ^
# | <stdin>:1111:28: note: with "X" equal to "%x"
# |  %x.lobit = ashr i32 %x, 31
# |                            ^
# | <stdin>:1112:10: note: possible intended match here
# |  ret i32 %x.lobit
# |          ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/InstCombine/or.ll:2378:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: [[SIGNBIT:%.*]] = ashr i32 [[X:%.*]], 31
# |               ^
# | <stdin>:1115:37: note: scanning from here
# | define i32 @signum_i32_or_wrong_ext(i32 %x) {
# |                                     ^
# | <stdin>:1116:10: note: possible intended match here
# |  %narrow = icmp ne i32 %x, 0
# |          ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/InstCombine/or.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |              .
# |              .
# |              .
# |            672:  call void @use(i32 %xor) 
# |            673:  %or1 = or i32 %xor, %neg 
# |            674:  ret i32 %or1 
# |            675: } 
# |            676:  
# |            677: define i8 @ashr_bitwidth_mask(i8 %x, i8 %y) { 
# | next:1476'0                                  {                  search range start (exclusive)
# | next:1476'1                                                     error: no match found in search range
# |            678:  %isneg.inv = icmp sgt i8 %x, -1 
# |            679:  %r = select i1 %isneg.inv, i8 %y, i8 -1 
# |            680:  ret i8 %r 
# |            681: } 
# |            682:  
# |            683: define <2 x i8> @ashr_bitwidth_mask_vec_commute(<2 x i8> %x, <2 x i8> %py) { 
# | next:1476'2                                                     }                              search range end (exclusive)
# |            684:  %y = mul <2 x i8> %py, <i8 42, i8 2> 
# | next:1488'0                                         {   search range start (exclusive)
# | next:1488'1                                             error: no match found in search range
# |            685:  %isneg.inv = icmp sgt <2 x i8> %x, splat (i8 -1) 
# | next:1488'2                 ?                                       possible intended match
# |            686:  %r = select <2 x i1> %isneg.inv, <2 x i8> %y, <2 x i8> splat (i8 -1) 
# |            687:  ret <2 x i8> %r 
# |            688: } 
# |            689:  
# |            690: define i32 @ashr_bitwidth_mask_use(i32 %x, i32 %y) { 
# | next:1488'3                                        }                   search range end (exclusive)
# |            691:  %sign = ashr i32 %x, 7 
# |            692:  call void @use(i32 %sign) 
# |            693:  %r = or i32 %sign, %y 
# |            694:  ret i32 %r 
# |            695: } 
# |              .
# |              .
# |              .
# |           1106:  %r = or i32 %signbit, %zgt0 
# |           1107:  ret i32 %r 
# |           1108: } 
# |           1109:  
# |           1110: define i32 @signum_i32_or_wrong_pred(i32 %x) { 
# |           1111:  %x.lobit = ashr i32 %x, 31 
# | next:2363'0                               {   search range start (exclusive)
# | next:2363'1                                   error: no match found in search range
# | next:2363'2                                   with "X" equal to "%x"
# |           1112:  ret i32 %x.lobit 
# | next:2363'3              ?          possible intended match
# |           1113: } 
# |           1114:  
# |           1115: define i32 @signum_i32_or_wrong_ext(i32 %x) { 
# | next:2363'4                                         }           search range end (exclusive)
# | next:2378'0                                        {            search range start (exclusive)
# | next:2378'1                                                     error: no match found in search range
# |           1116:  %narrow = icmp ne i32 %x, 0 
# | next:2378'2              ?                     possible intended match
# |           1117:  %r = sext i1 %narrow to i32 
# |           1118:  ret i32 %r 
# |           1119: } 
# |           1120:  
# |           1121: ; Function Attrs: nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) 
# |              .
# |              .
# |              .
# |           1132:  
# |           1133: ; Function Attrs: nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) 
# |           1134: declare range(i5 -1, 2) <2 x i5> @llvm.scmp.v2i5.v2i5(<2 x i5>, <2 x i5>) #1 
# |           1135:  
# |           1136: attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } 
# |           1137: attributes #1 = { nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) } 
# | next:2378'3                                                                                                                      } search range end (exclusive)
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>LLVM.Transforms/InstCombine/sub-ashr-or-to-icmp-select.ll</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/opt -passes=instcombine /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/InstCombine/sub-ashr-or-to-icmp-select.ll -S -o - | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/InstCombine/sub-ashr-or-to-icmp-select.ll
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/opt -passes=instcombine /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/InstCombine/sub-ashr-or-to-icmp-select.ll -S -o -
# 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/InstCombine/sub-ashr-or-to-icmp-select.ll
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/InstCombine/sub-ashr-or-to-icmp-select.ll:198:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: [[TMP1:%.*]] = icmp sgt i32 [[X]], [[Y]]
# |               ^
# | <stdin>:92:33: note: scanning from here
# |  store i32 %sub, ptr %p, align 4
# |                                 ^
# | <stdin>:92:33: note: with "X" equal to "%x"
# |  store i32 %sub, ptr %p, align 4
# |                                 ^
# | <stdin>:92:33: note: with "Y" equal to "%y"
# |  store i32 %sub, ptr %p, align 4
# |                                 ^
# | <stdin>:93:6: note: possible intended match here
# |  %isneg.inv = icmp sgt i32 %sub, -1
# |      ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/InstCombine/sub-ashr-or-to-icmp-select.ll:258:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: [[SHR:%.*]] = ashr i32 [[SUB]], 31
# |               ^
# | <stdin>:122:23: note: scanning from here
# |  %sub = sub i32 %y, %x
# |                       ^
# | <stdin>:122:23: note: with "SUB" equal to "%sub"
# |  %sub = sub i32 %y, %x
# |                       ^
# | <stdin>:124:26: note: possible intended match here
# |  %or = select i1 %isneg.inv, i32 %x, i32 -1
# |                          ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/InstCombine/sub-ashr-or-to-icmp-select.ll:286:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: [[SHR:%.*]] = ashr <4 x i32> [[SUB]], splat (i32 31)
# |               ^
# | <stdin>:137:65: note: scanning from here
# |  %sub = sub <4 x i32> <i32 255, i32 255, i32 undef, i32 255>, %x
# |                                                                 ^
# | <stdin>:137:65: note: with "SUB" equal to "%sub"
# |  %sub = sub <4 x i32> <i32 255, i32 255, i32 undef, i32 255>, %x
# |                                                                 ^
# | <stdin>:139:39: note: possible intended match here
# |  %or = select <4 x i1> %isneg.inv, <4 x i32> %x, <4 x i32> splat (i32 -1)
# |                                       ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/InstCombine/sub-ashr-or-to-icmp-select.ll:327:12: error: undefined variable: PROF1
# | ; CHECK: [[PROF1]] = !{!"unknown", !"instcombine"}
# |            ^
# | <stdin>:163:2: note: possible intended match here
# | !1 = !{!"unknown", !"instcombine"}
# |  ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/InstCombine/sub-ashr-or-to-icmp-select.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |              .
# |              .
# |              .
# |             87:  ret <4 x i32> %shr 
# |             88: } 
# |             89:  
# |             90: define i32 @sub_ashr_or_i32_extra_use_sub(i32 %x, i32 %y, ptr %p) !prof !0 { 
# |             91:  %sub = sub nsw i32 %y, %x 
# |             92:  store i32 %sub, ptr %p, align 4 
# | next:198'0                                     {   search range start (exclusive)
# | next:198'1                                         error: no match found in search range
# | next:198'2                                         with "X" equal to "%x"
# | next:198'3                                         with "Y" equal to "%y"
# |             93:  %isneg.inv = icmp sgt i32 %sub, -1 
# | next:198'4           ?                                possible intended match
# |             94:  %or = select i1 %isneg.inv, i32 %x, i32 -1, !prof !1 
# |             95:  ret i32 %or 
# |             96: } 
# |             97:  
# |             98: define i32 @sub_ashr_or_i32_extra_use_or(i32 %x, i32 %y, ptr %p) { 
# | next:198'5                                               }                           search range end (exclusive)
# |             99:  %1 = icmp slt i32 %y, %x 
# |            100:  %or = select i1 %1, i32 -1, i32 %x 
# |            101:  store i32 %or, ptr %p, align 4 
# |            102:  ret i32 %or 
# |            103: } 
# |              .
# |              .
# |              .
# |            117:  %or = or i32 %x, %shr 
# |            118:  ret i32 %or 
# |            119: } 
# |            120:  
# |            121: define i32 @sub_ashr_or_i32_no_nsw_nuw(i32 %x, i32 %y) { 
# |            122:  %sub = sub i32 %y, %x 
# | next:258'0                           {   search range start (exclusive)
# | next:258'1                               error: no match found in search range
# | next:258'2                               with "SUB" equal to "%sub"
# |            123:  %isneg.inv = icmp sgt i32 %sub, -1 
# |            124:  %or = select i1 %isneg.inv, i32 %x, i32 -1 
# | next:258'3                               ?                    possible intended match
# |            125:  ret i32 %or 
# |            126: } 
# |            127:  
# |            128: define i32 @neg_or_extra_use_ashr_i32(i32 %x, ptr %p) { 
# | next:258'4                                            }                   search range end (exclusive)
# |            129:  %neg = sub i32 0, %x 
# |            130:  %or = or i32 %x, %neg 
# |            131:  %shr = ashr i32 %or, 31 
# |            132:  store i32 %or, ptr %p, align 4 
# |            133:  ret i32 %shr 
# |            134: } 
# |            135:  
# |            136: define <4 x i32> @sub_ashr_or_i32_vec_undef1(<4 x i32> %x) { 
# |            137:  %sub = sub <4 x i32> <i32 255, i32 255, i32 undef, i32 255>, %x 
# | next:286'0                                                                     {   search range start (exclusive)
# | next:286'1                                                                         error: no match found in search range
# | next:286'2                                                                         with "SUB" equal to "%sub"
# |            138:  %isneg.inv = icmp sgt <4 x i32> %sub, splat (i32 -1) 
# |            139:  %or = select <4 x i1> %isneg.inv, <4 x i32> %x, <4 x i32> splat (i32 -1) 
# | next:286'3                                            ?                                     possible intended match
# |            140:  ret <4 x i32> %or 
# |            141: } 
# |            142:  
# |            143: define <4 x i32> @sub_ashr_or_i32_vec_undef2(<4 x i32> %x) { 
# | next:286'4                                                   }                 search range end (exclusive)
# |            144:  %sub = sub nsw <4 x i32> splat (i32 255), %x 
# |            145:  %shr = ashr <4 x i32> %sub, <i32 undef, i32 31, i32 31, i32 31> 
# |            146:  %or = or <4 x i32> %shr, %x 
# |            147:  ret <4 x i32> %or 
# |            148: } 
# |              .
# |              .
# |              .
# |            157: ; Function Attrs: nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) 
# |            158: declare i32 @llvm.smin.i32(i32, i32) #0 
# |            159:  
# |            160: attributes #0 = { nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) } 
# |            161:  
# |            162: !0 = !{!"function_entry_count", i64 1000} 
# | check:327'0                                             {   search range start (exclusive)
# | check:327'1                                                 error: match failed for invalid pattern
# | check:327'2                                                 undefined variable: PROF1
# |            163: !1 = !{!"unknown", !"instcombine"} 
# | check:327'3      ?                                   possible intended match
# | check:327'4                                        } search range end (exclusive)
# | >>>>>>
# `-----------------------------
# 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/207228


More information about the llvm-commits mailing list