[llvm] [InstCombine] Generalize zext(add X, -C) + C folding (PR #191723)

via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 12 10:00:14 PDT 2026


github-actions[bot] wrote:

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

* 172467 tests passed
* 3139 tests skipped
* 1 test failed

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

### LLVM
<details>
<summary>LLVM.Transforms/InstCombine/fneg.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/fneg.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/fneg.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/fneg.ll
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/InstCombine/fneg.ll:174:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: [[R:%.*]] = fdiv float [[X:%.*]], 0xFFF0000000000000
# |               ^
# | <stdin>:88:43: note: scanning from here
# | define float @fdiv_op1_constant_fneg_ninf(float %x) {
# |                                           ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/InstCombine/fneg.ll:196:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: [[R:%.*]] = fdiv float [[X:%.*]], -0.000000e+00
# |               ^
# | <stdin>:97:42: note: scanning from here
# | define float @fdiv_op1_constant_fneg_nsz(float %x) {
# |                                          ^
# | <stdin>:98:2: note: possible intended match here
# |  %r = fdiv nsz float %x, -0.000000e+00
# |  ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/InstCombine/fneg.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |            83: define float @fdiv_op1_constant_fneg_fmf(float %x) { 
# |            84:  %r = fdiv nnan float %x, 4.200000e+01 
# |            85:  ret float %r 
# |            86: } 
# |            87:  
# |            88: define float @fdiv_op1_constant_fneg_ninf(float %x) { 
# | next:174                                                 X~~~~~~~~~~~ error: no match found
# |            89:  ret float poison 
# | next:174       ~~~~~~~~~~~~~~~~~~
# |            90: } 
# | next:174       ~~
# |            91:  
# | next:174       ~
# |            92: define float @fdiv_ninf_op1_constant_fneg_ninf(float %x) { 
# | next:174       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            93:  %r = fdiv ninf float %x, 4.200000e+01 
# |            94:  ret float %r 
# |            95: } 
# |            96:  
# |            97: define float @fdiv_op1_constant_fneg_nsz(float %x) { 
# | next:196'0                                              X~~~~~~~~~~~ error: no match found
# |            98:  %r = fdiv nsz float %x, -0.000000e+00 
# | next:196'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | next:196'1      ?                                      possible intended match
# |            99:  ret float %r 
# | next:196'0     ~~~~~~~~~~~~~~
# |           100: } 
# | next:196'0     ~~
# |           101:  
# | next:196'0     ~
# |           102: define float @fdiv_nsz_op1_constant_fneg_nsz(float %x) { 
# | next:196'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           103:  %r = fdiv nsz float %x, -0.000000e+00 
# |             .
# |             .
# |             .
# | >>>>>>
# `-----------------------------
# 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/191723


More information about the llvm-commits mailing list