[llvm] [DAG] isKnownNeverZero: Add DemandedElts handling for ROTL/ROTR/BITREVERSE/BSWAP/CTPOP/ABS (PR #184033)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 6 08:47:59 PST 2026
github-actions[bot] wrote:
<!--PREMERGE ADVISOR COMMENT: Linux-->
# :penguin: Linux x64 Test Results
* 170829 tests passed
* 3015 tests skipped
* 2 tests failed
## Failed Tests
(click on a test name to see its output)
### LLVM
<details>
<summary>LLVM.CodeGen/X86/known-never-zero.ll</summary>
```
Exit Code: 1
Command Output (stdout):
--
# RUN: at line 2
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc < /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/known-never-zero.ll -mtriple=i686-unknown-unknown -mattr=+sse2 | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/known-never-zero.ll --check-prefixes=X86
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -mtriple=i686-unknown-unknown -mattr=+sse2
# 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/CodeGen/X86/known-never-zero.ll --check-prefixes=X86
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/known-never-zero.ll:34:13: error: X86-NEXT: expected string not found in input
# | ; X86-NEXT: bsfl %eax, %ecx
# | ^
# | <stdin>:35:18: note: scanning from here
# | movd %xmm0, %eax
# | ^
# | <stdin>:36:6: note: possible intended match here
# | rep bsfl %eax, %eax
# | ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/known-never-zero.ll:437:13: error: X86-NEXT: expected string not found in input
# | ; X86-NEXT: bsfl %eax, %ecx
# | ^
# | <stdin>:385:21: note: scanning from here
# | movzbl (%eax), %eax
# | ^
# | <stdin>:386:6: note: possible intended match here
# | rep bsfl %eax, %eax
# | ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/known-never-zero.ll:842:13: error: X86-NEXT: expected string not found in input
# | ; X86-NEXT: bsfl %eax, %ecx
# | ^
# | <stdin>:704:18: note: scanning from here
# | movd %xmm0, %eax
# | ^
# | <stdin>:705:6: note: possible intended match here
# | rep bsfl %eax, %eax
# | ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/known-never-zero.ll:982:13: error: X86-NEXT: expected string not found in input
# | ; X86-NEXT: bsfl %eax, %ecx
# | ^
# | <stdin>:815:18: note: scanning from here
# | movd %xmm2, %eax
# | ^
# | <stdin>:816:6: note: possible intended match here
# | rep bsfl %eax, %eax
# | ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/known-never-zero.ll:1236:13: error: X86-NEXT: expected string not found in input
# | ; X86-NEXT: bsfl %eax, %ecx
# | ^
# | <stdin>:989:18: note: scanning from here
# | movd %xmm0, %eax
# | ^
# | <stdin>:990:6: note: possible intended match here
# | rep bsfl %eax, %eax
# | ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/known-never-zero.ll:1294:13: error: X86-NEXT: expected string not found in input
# | ; X86-NEXT: bsfl %eax, %ecx
# | ^
# | <stdin>:1033:18: note: scanning from here
# | movd %xmm0, %eax
# | ^
# | <stdin>:1034:6: note: possible intended match here
# | rep bsfl %eax, %eax
# | ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/known-never-zero.ll:1375:13: error: X86-NEXT: expected string not found in input
# | ; X86-NEXT: bsfl %eax, %ecx
# | ^
# | <stdin>:1093:18: note: scanning from here
# | movd %xmm0, %eax
# | ^
# | <stdin>:1094:6: note: possible intended match here
# | rep bsfl %eax, %eax
# | ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/known-never-zero.ll:1433:13: error: X86-NEXT: expected string not found in input
# | ; X86-NEXT: bsfl %eax, %ecx
# | ^
# | <stdin>:1137:18: note: scanning from here
# | movd %xmm0, %eax
# | ^
# | <stdin>:1138:6: note: possible intended match here
# | rep bsfl %eax, %eax
# | ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/known-never-zero.ll:1793:13: error: X86-NEXT: expected string not found in input
# | ; X86-NEXT: bsfl %eax, %ecx
# | ^
# | <stdin>:1388:18: note: scanning from here
# | movd %xmm0, %eax
# | ^
# | <stdin>:1389:6: note: possible intended match here
# | rep bsfl %eax, %eax
# | ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/known-never-zero.ll:1920:13: error: X86-NEXT: expected string not found in input
# | ; X86-NEXT: bsfl %eax, %ecx
# | ^
# | <stdin>:1490:18: note: scanning from here
# | movd %xmm1, %eax
# | ^
# | <stdin>:1491:6: note: possible intended match here
# | rep bsfl %eax, %eax
# | ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/known-never-zero.ll:2340:13: error: X86-NEXT: is not on the line after the previous match
# | ; X86-NEXT: bsfl %eax, %eax
# | ^
# | <stdin>:1823:6: note: 'next' match was here
# | rep bsfl %eax, %eax
# | ^
# | <stdin>:1821:18: note: previous match ended here
# | movd %xmm1, %eax
# | ^
# | <stdin>:1822:1: note: non-matching line after previous match is here
# | rep bsfl %ecx, %edx
# | ^
# |
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/known-never-zero.ll
# |
# | -dump-input=help explains the following input dump.
# |
# | Input was:
# | <<<<<<
# | .
# | .
# | .
# | 30: .cfi_startproc
# | 31: # %bb.0:
# | 32: movl 4(%esp), %eax
# | 33: por .LCPI1_0, %xmm0
# | 34: movdqa %xmm0, (%eax)
# | 35: movd %xmm0, %eax
# | next:34'0 X error: no match found
# | 36: rep bsfl %eax, %eax
# | next:34'0 ~~~~~~~~~~~~~~~~~~~~~
# | next:34'1 ? possible intended match
# | 37: retl
# | next:34'0 ~~~~~~
# | 38: .Lfunc_end1:
# | next:34'0 ~~~~~~~~~~~~~
# | 39: .size or_known_nonzero_vec, .Lfunc_end1-or_known_nonzero_vec
# | next:34'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 40: .cfi_endproc
# | next:34'0 ~~~~~~~~~~~~~~
# | 41: # -- End function
# | next:34'0 ~~~~~~~~~~~~~~~~~~~
# | .
# | .
# | .
# | 380: .cfi_startproc
# | 381: # %bb.0:
# | 382: movl 4(%esp), %eax
# | 383: paddusb .LCPI15_0, %xmm0
# | 384: movdqa %xmm0, (%eax)
# | 385: movzbl (%eax), %eax
# | next:437'0 X error: no match found
# | 386: rep bsfl %eax, %eax
# | next:437'0 ~~~~~~~~~~~~~~~~~~~~~
# | next:437'1 ? possible intended match
# | 387: retl
# | next:437'0 ~~~~~~
# | 388: .Lfunc_end15:
# | next:437'0 ~~~~~~~~~~~~~~
# | 389: .size uaddsat_known_nonzero_vec, .Lfunc_end15-uaddsat_known_nonzero_vec
# | next:437'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 390: .cfi_endproc
# | next:437'0 ~~~~~~~~~~~~~~
# | 391: # -- End function
# | next:437'0 ~~~~~~~~~~~~~~~~~~~
# | .
# | .
# | .
# | 699: pcmpgtd %xmm0, %xmm2
# | 700: pand %xmm2, %xmm0
# | 701: pandn %xmm1, %xmm2
# | 702: por %xmm0, %xmm2
# | 703: pshufd $85, %xmm2, %xmm0 # xmm0 = xmm2[1,1,1,1]
# | 704: movd %xmm0, %eax
# | next:842'0 X error: no match found
# | 705: rep bsfl %eax, %eax
# | next:842'0 ~~~~~~~~~~~~~~~~~~~~~
# | next:842'1 ? possible intended match
# | 706: retl
# | next:842'0 ~~~~~~
# | 707: .Lfunc_end27:
# | next:842'0 ~~~~~~~~~~~~~~
# | 708: .size smin_known_never_zero_vec_element, .Lfunc_end27-smin_known_never_zero_vec_element
# | next:842'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 709: .cfi_endproc
# | next:842'0 ~~~~~~~~~~~~~~
# | 710: # -- End function
# | next:842'0 ~~~~~~~~~~~~~~~~~~~
# | .
# | .
# | .
# | 810: movdqa %xmm0, %xmm2
# | 811: pcmpgtd %xmm1, %xmm2
# | 812: pand %xmm2, %xmm0
# | 813: pandn %xmm1, %xmm2
# | 814: por %xmm0, %xmm2
# | 815: movd %xmm2, %eax
# | next:982'0 X error: no match found
# | 816: rep bsfl %eax, %eax
# | next:982'0 ~~~~~~~~~~~~~~~~~~~~~
# | next:982'1 ? possible intended match
# | 817: retl
# | next:982'0 ~~~~~~
# | 818: .Lfunc_end32:
# | next:982'0 ~~~~~~~~~~~~~~
# | 819: .size smax_known_never_zero_vec_element, .Lfunc_end32-smax_known_never_zero_vec_element
# | next:982'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 820: .cfi_endproc
# | next:982'0 ~~~~~~~~~~~~~~
# | 821: # -- End function
# | next:982'0 ~~~~~~~~~~~~~~~~~~~
# | .
# | .
# | .
# | 984: movss %xmm0, %xmm1 # xmm1 = xmm0[0],xmm1[1,2,3]
# | 985: movl 4(%esp), %eax
# | 986: movdqa .LCPI42_0, %xmm0 # xmm0 = [2147606891,65535,1,0]
# | 987: psrad %xmm1, %xmm0
# | 988: movdqa %xmm0, (%eax)
# | 989: movd %xmm0, %eax
# | next:1236'0 X error: no match found
# | 990: rep bsfl %eax, %eax
# | next:1236'0 ~~~~~~~~~~~~~~~~~~~~~
# | next:1236'1 ? possible intended match
# | 991: retl
# | next:1236'0 ~~~~~~
# | 992: .Lfunc_end42:
# | next:1236'0 ~~~~~~~~~~~~~~
# | 993: .size sra_known_nonzero_sign_bit_set_vec, .Lfunc_end42-sra_known_nonzero_sign_bit_set_vec
# | next:1236'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 994: .cfi_endproc
# | next:1236'0 ~~~~~~~~~~~~~~
# | 995: # -- End function
# | next:1236'0 ~~~~~~~~~~~~~~~~~~~
# | .
# | .
# | .
# | 1028: movl 4(%esp), %eax
# | 1029: por .LCPI44_0, %xmm1
# | 1030: psrad %xmm2, %xmm1
# | 1031: movdqa %xmm1, (%eax)
# | 1032: pshufd $85, %xmm1, %xmm0 # xmm0 = xmm1[1,1,1,1]
# | 1033: movd %xmm0, %eax
# | next:1294'0 X error: no match found
# | 1034: rep bsfl %eax, %eax
# | next:1294'0 ~~~~~~~~~~~~~~~~~~~~~
# | next:1294'1 ? possible intended match
# | 1035: retl
# | next:1294'0 ~~~~~~
# | 1036: .Lfunc_end44:
# | next:1294'0 ~~~~~~~~~~~~~~
# | 1037: .size sra_known_nonzero_exact_vec, .Lfunc_end44-sra_known_nonzero_exact_vec
# | next:1294'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 1038: .cfi_endproc
# | next:1294'0 ~~~~~~~~~~~~~~
# | 1039: # -- End function
# | next:1294'0 ~~~~~~~~~~~~~~~~~~~
# | .
# | .
# | .
# | 1088: movl 4(%esp), %eax
# | 1089: movdqa .LCPI47_0, %xmm0 # xmm0 = [0,65535,2147606891,0]
# | 1090: psrld %xmm1, %xmm0
# | 1091: movdqa %xmm0, (%eax)
# | 1092: pshufd $238, %xmm0, %xmm0 # xmm0 = xmm0[2,3,2,3]
# | 1093: movd %xmm0, %eax
# | next:1375'0 X error: no match found
# | 1094: rep bsfl %eax, %eax
# | next:1375'0 ~~~~~~~~~~~~~~~~~~~~~
# | next:1375'1 ? possible intended match
# | 1095: retl
# | next:1375'0 ~~~~~~
# | 1096: .Lfunc_end47:
# | next:1375'0 ~~~~~~~~~~~~~~
# | 1097: .size srl_known_nonzero_sign_bit_set_vec, .Lfunc_end47-srl_known_nonzero_sign_bit_set_vec
# | next:1375'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 1098: .cfi_endproc
# | next:1375'0 ~~~~~~~~~~~~~~
# | 1099: # -- End function
# | next:1375'0 ~~~~~~~~~~~~~~~~~~~
# | .
# | .
# | .
# | 1132: movl 4(%esp), %eax
# | 1133: por .LCPI49_0, %xmm1
# | 1134: psrld %xmm2, %xmm1
# | 1135: movdqa %xmm1, (%eax)
# | 1136: pshufd $255, %xmm1, %xmm0 # xmm0 = xmm1[3,3,3,3]
# | 1137: movd %xmm0, %eax
# | next:1433'0 X error: no match found
# | 1138: rep bsfl %eax, %eax
# | next:1433'0 ~~~~~~~~~~~~~~~~~~~~~
# | next:1433'1 ? possible intended match
# | 1139: retl
# | next:1433'0 ~~~~~~
# | 1140: .Lfunc_end49:
# | next:1433'0 ~~~~~~~~~~~~~~
# | 1141: .size srl_known_nonzero_exact_vec, .Lfunc_end49-srl_known_nonzero_exact_vec
# | next:1433'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 1142: .cfi_endproc
# | next:1433'0 ~~~~~~~~~~~~~~
# | 1143: # -- End function
# | next:1433'0 ~~~~~~~~~~~~~~~~~~~
# | .
# | .
# | .
# | 1383: .cfi_startproc
# | 1384: # %bb.0:
# | 1385: movl 4(%esp), %eax
# | 1386: paddd .LCPI59_0, %xmm0
# | 1387: movdqa %xmm0, (%eax)
# | 1388: movd %xmm0, %eax
# | next:1793'0 X error: no match found
# | 1389: rep bsfl %eax, %eax
# | next:1793'0 ~~~~~~~~~~~~~~~~~~~~~
# | next:1793'1 ? possible intended match
# | 1390: retl
# | next:1793'0 ~~~~~~
# | 1391: .Lfunc_end59:
# | next:1793'0 ~~~~~~~~~~~~~~
# | 1392: .size add_nuw_known_nonzero_vec, .Lfunc_end59-add_nuw_known_nonzero_vec
# | next:1793'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 1393: .cfi_endproc
# | next:1793'0 ~~~~~~~~~~~~~~
# | 1394: # -- End function
# | next:1793'0 ~~~~~~~~~~~~~~~~~~~
# | .
# | .
# | .
# | 1485: movl 4(%esp), %eax
# | 1486: por .LCPI64_0, %xmm0
# | 1487: movd .LCPI64_2, %xmm1 # xmm1 = [2,0,0,0]
# | 1488: psubd %xmm0, %xmm1
# | 1489: movdqa %xmm1, (%eax)
# | 1490: movd %xmm1, %eax
# | next:1920'0 X error: no match found
# | 1491: rep bsfl %eax, %eax
# | next:1920'0 ~~~~~~~~~~~~~~~~~~~~~
# | next:1920'1 ? possible intended match
# | 1492: retl
# | next:1920'0 ~~~~~~
# | 1493: .Lfunc_end64:
# | next:1920'0 ~~~~~~~~~~~~~~
# | 1494: .size sub_known_nonzero_ne_vec, .Lfunc_end64-sub_known_nonzero_ne_vec
# | next:1920'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 1495: .cfi_endproc
# | next:1920'0 ~~~~~~~~~~~~~~
# | 1496: # -- End function
# | next:1920'0 ~~~~~~~~~~~~~~~~~~~
# | .
# | .
# | .
# | 1818: punpckldq %xmm1, %xmm2 # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
# | 1819: movdqa %xmm0, 16(%eax)
# | 1820: movdqa %xmm2, (%eax)
# | 1821: movd %xmm1, %eax
# | 1822: rep bsfl %ecx, %edx
# | 1823: rep bsfl %eax, %eax
# | next:2340 !~~~~~~~~~~~~~~ error: match on wrong line
# | 1824: addl $32, %eax
# | 1825: testl %ecx, %ecx
# | 1826: cmovnel %edx, %eax
# | 1827: retl
# | 1828: .Lfunc_end82:
# | .
# | .
# | .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1
--
```
</details>
<details>
<summary>LLVM.Transforms/EarlyCSE/math-1.ll (Likely Already Failing)</summary>
This test is already failing at the base commit.
```
Exit Code: 1
Command Output (stdout):
--
# RUN: at line 2
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/opt -passes=early-cse -earlycse-debug-hash -S -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/EarlyCSE/math-1.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/EarlyCSE/math-1.ll
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/opt -passes=early-cse -earlycse-debug-hash -S -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/EarlyCSE/math-1.ll
# 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/EarlyCSE/math-1.ll
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/EarlyCSE/math-1.ll:189:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: [[RES:%.*]] = tail call fast float @tanhf(float 1.000000e+00)
# | ^
# | <stdin>:148:23: note: scanning from here
# | define float @f_tanhf() {
# | ^
# | <stdin>:149:2: note: possible intended match here
# | ret float 0x3FE85EFAC0000000
# | ^
# |
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/EarlyCSE/math-1.ll
# |
# | -dump-input=help explains the following input dump.
# |
# | Input was:
# | <<<<<<
# | .
# | .
# | .
# | 143: }
# | 144:
# | 145: ; Function Attrs: nofree nounwind willreturn
# | 146: declare float @tanhf(float) #0
# | 147:
# | 148: define float @f_tanhf() {
# | next:189'0 X~~~ error: no match found
# | 149: ret float 0x3FE85EFAC0000000
# | next:189'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | next:189'1 ? possible intended match
# | 150: }
# | next:189'0 ~~
# | 151:
# | next:189'0 ~
# | 152: attributes #0 = { nofree nounwind willreturn }
# | next:189'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 153: attributes #1 = { nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) }
# | next:189'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/184033
More information about the llvm-commits
mailing list