[llvm] [DAGCombiner] `visitSIGN_EXTEND_INREG` - fold `(sext_inreg (freeze (extload x)))` -> `(freeze (sextload x))` (PR #226208)

via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 28 03:27:24 PDT 2026


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Windows-->
# :window: Windows x64 Test Results

* 142816 tests passed
* 3382 tests skipped
* 4 tests failed

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

### LLVM
<details>
<summary>LLVM.CodeGen/AArch64/sve-ldst-sext.ll</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
c:\_work\llvm-project\llvm-project\build\bin\llc.exe -mtriple=aarch64--linux-gnu -mattr=+sve < C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AArch64\sve-ldst-sext.ll | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AArch64\sve-ldst-sext.ll
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\llc.exe' -mtriple=aarch64--linux-gnu -mattr=+sve
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AArch64\sve-ldst-sext.ll'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AArch64\sve-ldst-sext.ll:275:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: ld1b { z1.d }, p0/z, [x0]
# |               ^
# | <stdin>:314:12: note: scanning from here
# |  ptrue p0.d
# |            ^
# | <stdin>:315:2: note: possible intended match here
# |  ld1sb { z0.d }, p0/z, [x0]
# |  ^
# | C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AArch64\sve-ldst-sext.ll:292:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: ld1b { z0.d }, p0/z, [x0]
# |               ^
# | <stdin>:329:12: note: scanning from here
# |  ptrue p0.d
# |            ^
# | <stdin>:330:2: note: possible intended match here
# |  ld1sb { z0.d }, p0/z, [x0]
# |  ^
# | C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AArch64\sve-ldst-sext.ll:313:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: ld1b { z0.d }, p0/z, [x0]
# |               ^
# | <stdin>:347:12: note: scanning from here
# |  ptrue p0.d
# |            ^
# | <stdin>:348:2: note: possible intended match here
# |  ld1sb { z0.d }, p0/z, [x0]
# |  ^
# | C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AArch64\sve-ldst-sext.ll:346:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: ld1b { z0.d }, p0/z, [x0]
# |               ^
# | <stdin>:371:24: note: scanning from here
# |  mov z3.d, #27 // =0x1b
# |                        ^
# | <stdin>:372:2: note: possible intended match here
# |  ld1sb { z0.d }, p0/z, [x0]
# |  ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AArch64\sve-ldst-sext.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |           309:  .type load_frozen_before_sext_multiuse, at function 
# |           310:  .variant_pcs load_frozen_before_sext_multiuse 
# |           311: load_frozen_before_sext_multiuse: // @load_frozen_before_sext_multiuse 
# |           312:  .cfi_startproc 
# |           313: // %bb.0: 
# |           314:  ptrue p0.d 
# | next:275'0               {   search range start (exclusive)
# | next:275'1                   error: no match found in search range
# |           315:  ld1sb { z0.d }, p0/z, [x0] 
# | next:275'2      ?                            possible intended match
# |           316:  // fake_use: $z0 
# |           317:  ret 
# |           318: .Lfunc_end19: 
# |           319:  .size load_frozen_before_sext_multiuse, .Lfunc_end19-load_frozen_before_sext_multiuse 
# |           320:  .cfi_endproc 
# |           321:  // -- End function 
# |           322:  .globl load_frozen_before_sext_multiuse2 // -- Begin function load_frozen_before_sext_multiuse2 
# |           323:  .p2align 2 
# |           324:  .type load_frozen_before_sext_multiuse2, at function 
# |           325:  .variant_pcs load_frozen_before_sext_multiuse2 
# |           326: load_frozen_before_sext_multiuse2: // @load_frozen_before_sext_multiuse2 
# | next:275'3                                       }                                        search range end (exclusive)
# |           327:  .cfi_startproc 
# |           328: // %bb.0: 
# |           329:  ptrue p0.d 
# | next:292'0               {   search range start (exclusive)
# | next:292'1                   error: no match found in search range
# |           330:  ld1sb { z0.d }, p0/z, [x0] 
# | next:292'2      ?                            possible intended match
# |           331:  movprfx z1, z0 
# |           332:  mul z1.d, z1.d, #13 
# |           333:  and z1.d, z1.d, #0xff 
# |           334:  add z0.d, z0.d, z1.d 
# |           335:  ret 
# |           336: .Lfunc_end20: 
# |           337:  .size load_frozen_before_sext_multiuse2, .Lfunc_end20-load_frozen_before_sext_multiuse2 
# |           338:  .cfi_endproc 
# |           339:  // -- End function 
# |           340:  .globl load_frozen_before_sext_multiuse3 // -- Begin function load_frozen_before_sext_multiuse3 
# |           341:  .p2align 2 
# |           342:  .type load_frozen_before_sext_multiuse3, at function 
# |           343:  .variant_pcs load_frozen_before_sext_multiuse3 
# |           344: load_frozen_before_sext_multiuse3: // @load_frozen_before_sext_multiuse3 
# | next:292'3                                       }                                        search range end (exclusive)
# |           345:  .cfi_startproc 
# |           346: // %bb.0: 
# |           347:  ptrue p0.d 
# | next:313'0               {   search range start (exclusive)
# | next:313'1                   error: no match found in search range
# |           348:  ld1sb { z0.d }, p0/z, [x0] 
# | next:313'2      ?                            possible intended match
# |           349:  movprfx z1, z0 
# |           350:  and z1.d, z1.d, #0xff 
# |           351:  movprfx z2, z1 
# |           352:  mul z2.d, z2.d, #49 
# |           353:  mul z1.d, z1.d, #33 
# |             .
# |             .
# |             .
# |           361:  // -- End function 
# |           362:  .globl load_frozen_before_sext_multiuse4 // -- Begin function load_frozen_before_sext_multiuse4 
# |           363:  .p2align 2 
# |           364:  .type load_frozen_before_sext_multiuse4, at function 
# |           365:  .variant_pcs load_frozen_before_sext_multiuse4 
# |           366: load_frozen_before_sext_multiuse4: // @load_frozen_before_sext_multiuse4 
# | next:313'3                                       }                                        search range end (exclusive)
# |           367:  .cfi_startproc 
# |           368: // %bb.0: 
# |           369:  ptrue p0.d 
# |           370:  mov w8, #1234 // =0x4d2 
# |           371:  mov z3.d, #27 // =0x1b 
# | next:346'0                           {   search range start (exclusive)
# | next:346'1                               error: no match found in search range
# |           372:  ld1sb { z0.d }, p0/z, [x0] 
# | next:346'2      ?                            possible intended match
# |           373:  ld1b { z2.d }, p0/z, [x1] 
# |           374:  movprfx z1, z0 
# |           375:  and z1.d, z1.d, #0xff 
# |           376:  cmpeq p1.d, p0/z, z1.d, #3 
# |           377:  mov z1.d, x8 
# |             .
# |             .
# |             .
# |           385:  // -- End function 
# |           386:  .globl load_frozen_before_zext_multiuse5_dst_illegal // -- Begin function load_frozen_before_zext_multiuse5_dst_illegal 
# |           387:  .p2align 2 
# |           388:  .type load_frozen_before_zext_multiuse5_dst_illegal, at function 
# |           389:  .variant_pcs load_frozen_before_zext_multiuse5_dst_illegal 
# |           390: load_frozen_before_zext_multiuse5_dst_illegal: // @load_frozen_before_zext_multiuse5_dst_illegal 
# | next:346'3                                                   }                                                    search range end (exclusive)
# |           391:  .cfi_startproc 
# |           392: // %bb.0: 
# |           393:  ptrue p0.d 
# |           394:  mov z24.d, #3 // =0x3 
# |           395:  ld1sb { z0.d }, p0/z, [x0] 
# |             .
# |             .
# |             .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>LLVM.CodeGen/AArch64/sve-ldst-zext.ll</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
c:\_work\llvm-project\llvm-project\build\bin\llc.exe -mtriple=aarch64--linux-gnu -mattr=+sve < C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AArch64\sve-ldst-zext.ll | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AArch64\sve-ldst-zext.ll
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\llc.exe' -mtriple=aarch64--linux-gnu -mattr=+sve
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AArch64\sve-ldst-zext.ll'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AArch64\sve-ldst-zext.ll:313:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: ld1b { z0.d }, p0/z, [x0]
# |               ^
# | <stdin>:350:12: note: scanning from here
# |  ptrue p0.d
# |            ^
# | <stdin>:351:2: note: possible intended match here
# |  ld1sb { z0.d }, p0/z, [x0]
# |  ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AArch64\sve-ldst-zext.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |           345:  .type load_frozen_before_sext_multiuse3, at function 
# |           346:  .variant_pcs load_frozen_before_sext_multiuse3 
# |           347: load_frozen_before_sext_multiuse3: // @load_frozen_before_sext_multiuse3 
# |           348:  .cfi_startproc 
# |           349: // %bb.0: 
# |           350:  ptrue p0.d 
# | next:313'0               {   search range start (exclusive)
# | next:313'1                   error: no match found in search range
# |           351:  ld1sb { z0.d }, p0/z, [x0] 
# | next:313'2      ?                            possible intended match
# |           352:  movprfx z1, z0 
# |           353:  mul z1.d, z1.d, #49 
# |           354:  movprfx z2, z0 
# |           355:  and z2.d, z2.d, #0xff 
# |           356:  movprfx z3, z0 
# |             .
# |             .
# |             .
# |           365:  // -- End function 
# |           366:  .globl load_frozen_before_zext_multiuse4 // -- Begin function load_frozen_before_zext_multiuse4 
# |           367:  .p2align 2 
# |           368:  .type load_frozen_before_zext_multiuse4, at function 
# |           369:  .variant_pcs load_frozen_before_zext_multiuse4 
# |           370: load_frozen_before_zext_multiuse4: // @load_frozen_before_zext_multiuse4 
# | next:313'3                                       }                                        search range end (exclusive)
# |           371:  .cfi_startproc 
# |           372: // %bb.0: 
# |           373:  ptrue p0.d 
# |           374:  mov w8, #1234 // =0x4d2 
# |           375:  mov z3.d, #27 // =0x1b 
# |             .
# |             .
# |             .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>LLVM.CodeGen/WebAssembly/PR41149.ll</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
c:\_work\llvm-project\llvm-project\build\bin\llc.exe < C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\WebAssembly\PR41149.ll -mtriple=wasm32-unknown-unknown | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\WebAssembly\PR41149.ll
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\llc.exe' -mtriple=wasm32-unknown-unknown
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\WebAssembly\PR41149.ll'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\WebAssembly\PR41149.ll:13:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: i32.load8_u 0
# |               ^
# | <stdin>:11:13: note: scanning from here
# |  local.get 0
# |             ^
# | <stdin>:12:2: note: possible intended match here
# |  i32.load8_s 0
# |  ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\WebAssembly\PR41149.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |            .
# |            .
# |            .
# |            6: mod: # @mod 
# |            7:  .functype mod () -> () 
# |            8:  .local i32 
# |            9: # %bb.0: 
# |           10:  local.get 0 
# |           11:  local.get 0 
# | next:13'0                {   search range start (exclusive)
# | next:13'1                    error: no match found in search range
# |           12:  i32.load8_s 0 
# | next:13'2      ?               possible intended match
# |           13:  local.tee 0 
# |           14:  local.get 0 
# |           15:  i32.const 7 
# |           16:  i32.shr_s 
# |           17:  local.tee 0 
# |            .
# |            .
# |            .
# |           46:  .int8 15 
# |           47:  .ascii "reference-types" 
# |           48:  .int8 43 
# |           49:  .int8 8 
# |           50:  .ascii "sign-ext" 
# |           51:  .section .text.mod,"",@ 
# | next:13'3                              } search range end (exclusive)
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>LLVM.CodeGen/X86/pr38539.ll</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
c:\_work\llvm-project\llvm-project\build\bin\llc.exe < C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\X86\pr38539.ll -mtriple=x86_64-unknown -verify-machineinstrs | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\X86\pr38539.ll --check-prefix=X64
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\llc.exe' -mtriple=x86_64-unknown -verify-machineinstrs
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\X86\pr38539.ll' --check-prefix=X64
# note: command had no output on stdout or stderr
# RUN: at line 3
c:\_work\llvm-project\llvm-project\build\bin\llc.exe < C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\X86\pr38539.ll -mtriple=i686-unknown -verify-machineinstrs | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\X86\pr38539.ll --check-prefix=X86
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\llc.exe' -mtriple=i686-unknown -verify-machineinstrs
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\X86\pr38539.ll' --check-prefix=X86
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\X86\pr38539.ll:26:13: error: X86-NEXT: is not on the line after the previous match
# | ; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
# |             ^
# | <stdin>:69:2: note: 'next' match was here
# |  movl 8(%esp), %edx # 4-byte Reload
# |  ^
# | <stdin>:15:16: note: previous match ended here
# |  subl $96, %esp
# |                ^
# | <stdin>:16:1: note: non-matching line after previous match is here
# |  movl 64(%esp), %esi
# | ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\X86\pr38539.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |            .
# |            .
# |            .
# |           10:  movl %esp, %ebp 
# |           11:  pushl %ebx 
# |           12:  pushl %edi 
# |           13:  pushl %esi 
# |           14:  andl $-16, %esp 
# |           15:  subl $96, %esp 
# | next:26'0                   {   search range start (exclusive)
# |           16:  movl 64(%esp), %esi 
# |           17:  movl 68(%esp), %edi 
# |           18:  movl 72(%esp), %ecx 
# |           19:  shll $30, %ecx 
# |           20:  movl %ecx, %edx 
# |            .
# |            .
# |            .
# |           64:  jne .LBB0_8 
# |           65: .LBB0_7: # %BB_udiv-special-cases 
# |           66:  addl $64, %edx 
# |           67:  movl %edx, 8(%esp) # 4-byte Spill 
# |           68: .LBB0_8: # %BB_udiv-special-cases 
# |           69:  movl 8(%esp), %edx # 4-byte Reload 
# | next:26'1      !~~~~~~~~~~~~~~~~~                   error: match on wrong line
# |           70:  addl $-66, %edx 
# |           71:  movl $0, %eax 
# |           72:  adcl $-1, %eax 
# |           73:  movl %eax, 4(%esp) # 4-byte Spill 
# |           74:  movl $0, %eax 
# |            .
# |            .
# |            .
# |          210:  .size f, .Lfunc_end0-f 
# |          211:  # -- End function 
# |          212:  .globl g # -- Begin function g 
# |          213:  .prefalign 4, .Lfunc_end1, nop 
# |          214:  .type g, at function 
# |          215: g: # @g 
# | next:26'2       }       search range end (exclusive)
# |          216: # %bb.0: # %BB 
# |          217:  pushl %ebp 
# |          218:  movl %esp, %ebp 
# |          219:  andl $-8, %esp 
# |          220:  subl $8, %esp 
# |            .
# |            .
# |            .
# | >>>>>>
# `-----------------------------
# 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/226208


More information about the llvm-commits mailing list