[llvm] Early exit if compares are not using the same register (NFC) (PR #177377)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 22 07:43:14 PST 2026


github-actions[bot] wrote:

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

* 130083 tests passed
* 2879 tests skipped
* 1 test failed

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

### LLVM
<details>
<summary>LLVM.CodeGen/AArch64/combine-comparisons-by-cse.ll</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
c:\_work\llvm-project\llvm-project\build\bin\llc.exe -debugify-and-strip-all-safe < C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AArch64\combine-comparisons-by-cse.ll -mtriple=aarch64-linux-gnu | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AArch64\combine-comparisons-by-cse.ll
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\llc.exe' -debugify-and-strip-all-safe -mtriple=aarch64-linux-gnu
# 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\combine-comparisons-by-cse.ll'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AArch64\combine-comparisons-by-cse.ll:120:15: error: CHECK-NEXT: is not on the line after the previous match
# | ; CHECK-NEXT: ldr w8, [x8]
# |               ^
# | <stdin>:93:2: note: 'next' match was here
# |  ldr w8, [x8]
# |  ^
# | <stdin>:71:27: note: previous match ended here
# |  ldr x8, [x8, :got_lo12:a]
# |                           ^
# | <stdin>:72:1: note: non-matching line after previous match is here
# |  ldr w9, [x8]
# | ^
# | C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AArch64\combine-comparisons-by-cse.ll:186:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: cmp w8, #5
# |               ^
# | <stdin>:115:14: note: scanning from here
# |  ldr w8, [x8]
# |              ^
# | <stdin>:116:2: note: possible intended match here
# |  cmp w8, #6
# |  ^
# | C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AArch64\combine-comparisons-by-cse.ll:252:15: error: CHECK-NEXT: is not on the line after the previous match
# | ; CHECK-NEXT: ldr w8, [x8]
# |               ^
# | <stdin>:181:2: note: 'next' match was here
# |  ldr w8, [x8]
# |  ^
# | <stdin>:159:27: note: previous match ended here
# |  ldr x8, [x8, :got_lo12:a]
# |                           ^
# | <stdin>:160:1: note: non-matching line after previous match is here
# |  ldr w9, [x8]
# | ^
# | C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AArch64\combine-comparisons-by-cse.ll:318:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: cmp w8, #5
# |               ^
# | <stdin>:203:14: note: scanning from here
# |  ldr w8, [x8]
# |              ^
# | <stdin>:204:2: note: possible intended match here
# |  cmp w8, #4
# |  ^
# | C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AArch64\combine-comparisons-by-cse.ll:385:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: cmn w8, #5
# |               ^
# | <stdin>:248:14: note: scanning from here
# |  ldr w8, [x8]
# |              ^
# | <stdin>:249:2: note: possible intended match here
# |  cmn w8, #4
# |  ^
# | C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AArch64\combine-comparisons-by-cse.ll:452:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: cmn w8, #5
# |               ^
# | <stdin>:293:14: note: scanning from here
# |  ldr w8, [x8]
# |              ^
# | <stdin>:294:2: note: possible intended match here
# |  cmn w8, #6
# |  ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\llvm\test\CodeGen\AArch64\combine-comparisons-by-cse.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |            88:  cmp w9, #10 
# |            89:  b.lt .LBB3_6 
# |            90: .LBB3_4: // %land.lhs.true3 
# |            91:  adrp x9, :got:d 
# |            92:  ldr x9, [x9, :got_lo12:d] 
# |            93:  ldr w8, [x8] 
# | next:120        !~~~~~~~~~~~  error: match on wrong line
# |            94:  ldr w9, [x9] 
# |            95:  cmp w8, w9 
# |            96:  b.ne .LBB3_6 
# |            97: // %bb.5: 
# |            98:  mov w0, #1 // =0x1 
# |             .
# |             .
# |             .
# |           110: combine_gt_lt_5: // @combine_gt_lt_5 
# |           111:  .cfi_startproc 
# |           112: // %bb.0: // %entry 
# |           113:  adrp x8, :got:a 
# |           114:  ldr x8, [x8, :got_lo12:a] 
# |           115:  ldr w8, [x8] 
# | next:186'0                  X error: no match found
# |           116:  cmp w8, #6 
# | next:186'0     ~~~~~~~~~~~~
# | next:186'1      ?           possible intended match
# |           117:  b.lt .LBB4_3 
# | next:186'0     ~~~~~~~~~~~~~~
# |           118: // %bb.1: // %land.lhs.true 
# | next:186'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           119:  adrp x8, :got:b 
# | next:186'0     ~~~~~~~~~~~~~~~~~
# |           120:  adrp x9, :got:c 
# | next:186'0     ~~~~~~~~~~~~~~~~~
# |           121:  ldr x8, [x8, :got_lo12:b] 
# | next:186'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             .
# |             .
# |             .
# |           176:  cmp w9, #5 
# |           177:  b.gt .LBB5_6 
# |           178: .LBB5_4: // %land.lhs.true3 
# |           179:  adrp x9, :got:d 
# |           180:  ldr x9, [x9, :got_lo12:d] 
# |           181:  ldr w8, [x8] 
# | next:252        !~~~~~~~~~~~  error: match on wrong line
# |           182:  ldr w9, [x9] 
# |           183:  cmp w8, w9 
# |           184:  b.ne .LBB5_6 
# |           185: // %bb.5: 
# |           186:  mov w0, #1 // =0x1 
# |             .
# |             .
# |             .
# |           198: combine_lt_gt_5: // @combine_lt_gt_5 
# |           199:  .cfi_startproc 
# |           200: // %bb.0: // %entry 
# |           201:  adrp x8, :got:a 
# |           202:  ldr x8, [x8, :got_lo12:a] 
# |           203:  ldr w8, [x8] 
# | next:318'0                  X error: no match found
# |           204:  cmp w8, #4 
# | next:318'0     ~~~~~~~~~~~~
# | next:318'1      ?           possible intended match
# |           205:  b.gt .LBB6_3 
# | next:318'0     ~~~~~~~~~~~~~~
# |           206: // %bb.1: // %land.lhs.true 
# | next:318'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           207:  adrp x8, :got:b 
# | next:318'0     ~~~~~~~~~~~~~~~~~
# |           208:  adrp x9, :got:c 
# | next:318'0     ~~~~~~~~~~~~~~~~~
# |           209:  ldr x8, [x8, :got_lo12:b] 
# | next:318'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             .
# |             .
# |             .
# |           243: combine_gt_lt_n5: // @combine_gt_lt_n5 
# | next:318'0     ~~~~~~~~~~~~~~~~~
# |           244:  .cfi_startproc 
# |           245: // %bb.0: // %entry 
# |           246:  adrp x8, :got:a 
# |           247:  ldr x8, [x8, :got_lo12:a] 
# |           248:  ldr w8, [x8] 
# | next:385'0                  X error: no match found
# |           249:  cmn w8, #4 
# | next:385'0     ~~~~~~~~~~~~
# | next:385'1      ?           possible intended match
# |           250:  b.lt .LBB7_3 
# | next:385'0     ~~~~~~~~~~~~~~
# |           251: // %bb.1: // %land.lhs.true 
# | next:385'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           252:  adrp x8, :got:b 
# | next:385'0     ~~~~~~~~~~~~~~~~~
# |           253:  adrp x9, :got:c 
# | next:385'0     ~~~~~~~~~~~~~~~~~
# |           254:  ldr x8, [x8, :got_lo12:b] 
# | next:385'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             .
# |             .
# |             .
# |           288: combine_lt_gt_n5: // @combine_lt_gt_n5 
# | next:385'0     ~~~~~~~~~~~~~~~~~
# |           289:  .cfi_startproc 
# |           290: // %bb.0: // %entry 
# |           291:  adrp x8, :got:a 
# |           292:  ldr x8, [x8, :got_lo12:a] 
# |           293:  ldr w8, [x8] 
# | next:452'0                  X error: no match found
# |           294:  cmn w8, #6 
# | next:452'0     ~~~~~~~~~~~~
# | next:452'1      ?           possible intended match
# |           295:  b.gt .LBB8_3 
# | next:452'0     ~~~~~~~~~~~~~~
# |           296: // %bb.1: // %land.lhs.true 
# | next:452'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           297:  adrp x8, :got:b 
# | next:452'0     ~~~~~~~~~~~~~~~~~
# |           298:  adrp x9, :got:c 
# | next:452'0     ~~~~~~~~~~~~~~~~~
# |           299:  ldr x8, [x8, :got_lo12:b] 
# | next:452'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/177377


More information about the llvm-commits mailing list