[llvm] [SelectionDAG] Handle add(x, signbit) in ComputeNumSignBits (PR #214848)

via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 7 22:43:51 PDT 2026


github-actions[bot] wrote:

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

* 180231 tests passed
* 3643 tests skipped
* 3 tests failed

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

### LLVM
<details>
<summary>LLVM.CodeGen/ARM/sdiv-pow2-arm-size.ll</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -mtriple=armv7a -mattr=+hwdiv-arm /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/ARM/sdiv-pow2-arm-size.ll -o - | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/ARM/sdiv-pow2-arm-size.ll --check-prefixes=CHECK,DIV
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -mtriple=armv7a -mattr=+hwdiv-arm /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/ARM/sdiv-pow2-arm-size.ll -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/CodeGen/ARM/sdiv-pow2-arm-size.ll --check-prefixes=CHECK,DIV
# note: command had no output on stdout or stderr
# RUN: at line 3
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -mtriple=armv7a -mattr=-hwdiv-arm /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/ARM/sdiv-pow2-arm-size.ll -o - | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/ARM/sdiv-pow2-arm-size.ll --check-prefixes=CHECK,NODIV
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -mtriple=armv7a -mattr=-hwdiv-arm /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/ARM/sdiv-pow2-arm-size.ll -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/CodeGen/ARM/sdiv-pow2-arm-size.ll --check-prefixes=CHECK,NODIV
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/ARM/sdiv-pow2-arm-size.ll:33:15: error: NODIV-NEXT: is not on the line after the previous match
# | ; NODIV-NEXT: asr r0, r0, #1
# |               ^
# | <stdin>:47:2: note: 'next' match was here
# |  asr r0, r0, #1
# |  ^
# | <stdin>:45:25: note: previous match ended here
# |  add r0, r0, r1, lsr #15
# |                         ^
# | <stdin>:46:1: note: non-matching line after previous match is here
# |  sxth r0, r0
# | ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/ARM/sdiv-pow2-arm-size.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |            .
# |            .
# |            .
# |           40:  .code 32 
# |           41: f0: @ @f0 
# |           42:  .fnstart 
# |           43: @ %bb.0: @ %entry 
# |           44:  uxth r1, r0 
# |           45:  add r0, r0, r1, lsr #15 
# | next:33'0                            {   search range start (exclusive)
# |           46:  sxth r0, r0 
# |           47:  asr r0, r0, #1 
# | next:33'1      !~~~~~~~~~~~~~   error: match on wrong line
# |           48:  bx lr 
# |           49: .Lfunc_end1: 
# |           50:  .size f0, .Lfunc_end1-f0 
# |           51:  .cantunwind 
# |           52:  .fnend 
# |           53:  @ -- End function 
# |           54:  .globl f1 @ -- Begin function f1 
# |           55:  .p2align 2 
# |           56:  .type f1,%function 
# |           57:  .code 32 
# |           58: f1: @ @f1 
# | next:33'2        }        search range end (exclusive)
# |           59:  .fnstart 
# |           60: @ %bb.0: @ %entry 
# |           61:  asr r1, r0, #31 
# |           62:  add r0, r0, r1, lsr #30 
# |           63:  asr r0, r0, #2 
# |            .
# |            .
# |            .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>LLVM.CodeGen/ARM/sdiv-pow2-thumb-size.ll</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -mtriple=thumbv8 /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/ARM/sdiv-pow2-thumb-size.ll -o -       | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/ARM/sdiv-pow2-thumb-size.ll --check-prefixes=CHECK,T2
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -mtriple=thumbv8 /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/ARM/sdiv-pow2-thumb-size.ll -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/CodeGen/ARM/sdiv-pow2-thumb-size.ll --check-prefixes=CHECK,T2
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/ARM/sdiv-pow2-thumb-size.ll:119:12: error: T2-NEXT: is not on the line after the previous match
# | ; T2-NEXT: asrs r0, r0, #1
# |            ^
# | <stdin>:101:2: note: 'next' match was here
# |  asrs r0, r0, #1
# |  ^
# | <stdin>:99:27: note: previous match ended here
# |  add.w r0, r0, r1, lsr #15
# |                           ^
# | <stdin>:100:1: note: non-matching line after previous match is here
# |  sxth r0, r0
# | ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/ARM/sdiv-pow2-thumb-size.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |            94:  .thumb_func 
# |            95: f4: @ @f4 
# |            96:  .fnstart 
# |            97: @ %bb.0: @ %entry 
# |            98:  uxth r1, r0 
# |            99:  add.w r0, r0, r1, lsr #15 
# | next:119'0                              {   search range start (exclusive)
# |           100:  sxth r0, r0 
# |           101:  asrs r0, r0, #1 
# | next:119'1      !~~~~~~~~~~~~~~   error: match on wrong line
# |           102:  bx lr 
# |           103: .Lfunc_end4: 
# |           104:  .size f4, .Lfunc_end4-f4 
# |           105:  .fnend 
# |           106:  @ -- End function 
# |           107:  .globl f5 @ -- Begin function f5 
# |           108:  .p2align 1 
# |           109:  .type f5,%function 
# |           110:  .code 16 
# |           111:  .thumb_func 
# |           112: f5: @ @f5 
# | next:119'2        }        search range end (exclusive)
# |           113:  .fnstart 
# |           114: @ %bb.0: @ %entry 
# |           115:  asrs r1, r0, #31 
# |           116:  add.w r0, r0, r1, lsr #30 
# |           117:  asrs r0, r0, #2 
# |             .
# |             .
# |             .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>LLVM.CodeGen/RISCV/sdiv-pow2-cmov.ll</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -mtriple=riscv64 -mattr=+c,+m -verify-machineinstrs < /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/RISCV/sdiv-pow2-cmov.ll    | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefixes=CHECK,NOSFB /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/RISCV/sdiv-pow2-cmov.ll
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -mtriple=riscv64 -mattr=+c,+m -verify-machineinstrs
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefixes=CHECK,NOSFB /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/RISCV/sdiv-pow2-cmov.ll
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/RISCV/sdiv-pow2-cmov.ll:12:15: error: NOSFB-NEXT: expected string not found in input
# | ; NOSFB-NEXT: srai a0, a0, 1
# |               ^
# | <stdin>:12:16: note: scanning from here
# |  add a0, a0, a1
# |                ^
# | <stdin>:13:2: note: possible intended match here
# |  sraiw a0, a0, 1
# |  ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/RISCV/sdiv-pow2-cmov.ll:32:15: error: NOSFB-NEXT: expected string not found in input
# | ; NOSFB-NEXT: srai a0, a0, 1
# |               ^
# | <stdin>:26:16: note: scanning from here
# |  add a0, a0, a1
# |                ^
# | <stdin>:27:2: note: possible intended match here
# |  sraiw a0, a0, 1
# |  ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/RISCV/sdiv-pow2-cmov.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |            .
# |            .
# |            .
# |            7:  .type sdiv2_32, at function 
# |            8: sdiv2_32: # @sdiv2_32 
# |            9:  .cfi_startproc 
# |           10: # %bb.0: 
# |           11:  srliw a1, a0, 31 
# |           12:  add a0, a0, a1 
# | next:12'0                   {   search range start (exclusive)
# | next:12'1                       error: no match found in search range
# |           13:  sraiw a0, a0, 1 
# | next:12'2      ?                 possible intended match
# |           14:  ret 
# |           15: .Lfunc_end0: 
# |           16:  .size sdiv2_32, .Lfunc_end0-sdiv2_32 
# |           17:  .cfi_endproc 
# |           18:  # -- End function 
# |           19:  .globl sdivneg2_32 # -- Begin function sdivneg2_32 
# |           20:  .p2align 1 
# |           21:  .type sdivneg2_32, at function 
# |           22: sdivneg2_32: # @sdivneg2_32 
# | next:12'3                 }                 search range end (exclusive)
# |           23:  .cfi_startproc 
# |           24: # %bb.0: 
# |           25:  srliw a1, a0, 31 
# |           26:  add a0, a0, a1 
# | next:32'0                   {   search range start (exclusive)
# | next:32'1                       error: no match found in search range
# |           27:  sraiw a0, a0, 1 
# | next:32'2      ?                 possible intended match
# |           28:  neg a0, a0 
# |           29:  ret 
# |           30: .Lfunc_end1: 
# |           31:  .size sdivneg2_32, .Lfunc_end1-sdivneg2_32 
# |           32:  .cfi_endproc 
# |           33:  # -- End function 
# |           34:  .globl sdiv2_64 # -- Begin function sdiv2_64 
# |           35:  .p2align 1 
# |           36:  .type sdiv2_64, at function 
# |           37: sdiv2_64: # @sdiv2_64 
# | next:32'3              }              search range end (exclusive)
# |           38:  .cfi_startproc 
# |           39: # %bb.0: 
# |           40:  srli a1, a0, 63 
# |           41:  add a0, a0, a1 
# |           42:  srai a0, a0, 1 
# |            .
# |            .
# |            .
# | >>>>>>
# `-----------------------------
# 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/214848


More information about the llvm-commits mailing list