[clang] [CIR] Upstream three way compare op (PR #169963)

via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 28 15:04:44 PST 2025


github-actions[bot] wrote:

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

* 85541 tests passed
* 743 tests skipped
* 2 tests failed

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

### Clang
<details>
<summary>Clang.CIR/CodeGen/three-way-cmp.cpp</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/22/include -nostdsysteminc -triple x86_64-unknown-linux-gnu -std=c++20 -fclangir -emit-cir -mmlir --mlir-print-ir-before=cir-lowering-prepare /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/three-way-cmp.cpp -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/three-way-cmp.cpp.tmp.cir 2>&1 | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/three-way-cmp.cpp -check-prefix=BEFORE
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/22/include -nostdsysteminc -triple x86_64-unknown-linux-gnu -std=c++20 -fclangir -emit-cir -mmlir --mlir-print-ir-before=cir-lowering-prepare /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/three-way-cmp.cpp -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/three-way-cmp.cpp.tmp.cir
# 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/clang/test/CIR/CodeGen/three-way-cmp.cpp -check-prefix=BEFORE
# note: command had no output on stdout or stderr
# RUN: at line 2
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/22/include -nostdsysteminc -triple x86_64-unknown-linux-gnu -std=c++20 -fclangir -emit-cir -mmlir --mlir-print-ir-after=cir-lowering-prepare /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/three-way-cmp.cpp -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/three-way-cmp.cpp.tmp.cir 2>&1 | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/three-way-cmp.cpp -check-prefix=AFTER
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/22/include -nostdsysteminc -triple x86_64-unknown-linux-gnu -std=c++20 -fclangir -emit-cir -mmlir --mlir-print-ir-after=cir-lowering-prepare /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/three-way-cmp.cpp -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/three-way-cmp.cpp.tmp.cir
# 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/clang/test/CIR/CodeGen/three-way-cmp.cpp -check-prefix=AFTER
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/three-way-cmp.cpp:22:16: error: AFTER-NEXT: expected string not found in input
# | // AFTER-NEXT: %[[#LT:]] = cir.const(#cir.int<-1> : !s8i) : !s8i
# |                ^
# | <stdin>:14:52: note: scanning from here
# |  %4 = cir.load align(4) %1 : !cir.ptr<!s32i>, !s32i
# |                                                    ^
# | <stdin>:15:2: note: possible intended match here
# |  %5 = cir.const #cir.int<-1> : !s8i
# |  ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/three-way-cmp.cpp
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |            .
# |            .
# |            .
# |            9:  %1 = cir.alloca !s32i, !cir.ptr<!s32i>, ["y", init] {alignment = 4 : i64} 
# |           10:  %2 = cir.alloca !rec_std3A3A__13A3Astrong_ordering, !cir.ptr<!rec_std3A3A__13A3Astrong_ordering>, ["__retval"] {alignment = 1 : i64} 
# |           11:  cir.store %arg0, %0 : !s32i, !cir.ptr<!s32i> 
# |           12:  cir.store %arg1, %1 : !s32i, !cir.ptr<!s32i> 
# |           13:  %3 = cir.load align(4) %0 : !cir.ptr<!s32i>, !s32i 
# |           14:  %4 = cir.load align(4) %1 : !cir.ptr<!s32i>, !s32i 
# | next:22'0                                                        X error: no match found
# |           15:  %5 = cir.const #cir.int<-1> : !s8i 
# | next:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | next:22'1      ?                                   possible intended match
# |           16:  %6 = cir.const #cir.int<0> : !s8i 
# | next:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           17:  %7 = cir.const #cir.int<1> : !s8i 
# | next:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           18:  %8 = cir.cmp(lt, %3, %4) : !s32i, !cir.bool 
# | next:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           19:  %9 = cir.cmp(lt, %3, %4) : !s32i, !cir.bool 
# | next:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           20:  %10 = cir.select if %9 then %6 else %7 : (!cir.bool, !s8i, !s8i) -> !s8i 
# | next:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            .
# |            .
# |            .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>Clang.CIR/CodeGen/three-way-cmp.cpp</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/22/include -nostdsysteminc -triple x86_64-unknown-linux-gnu -std=c++20 -fclangir -emit-cir -mmlir --mlir-print-ir-before=cir-lowering-prepare /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/three-way-cmp.cpp -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/three-way-cmp.cpp.tmp.cir 2>&1 | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/three-way-cmp.cpp -check-prefix=BEFORE
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/22/include -nostdsysteminc -triple x86_64-unknown-linux-gnu -std=c++20 -fclangir -emit-cir -mmlir --mlir-print-ir-before=cir-lowering-prepare /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/three-way-cmp.cpp -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/three-way-cmp.cpp.tmp.cir
# 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/clang/test/CIR/CodeGen/three-way-cmp.cpp -check-prefix=BEFORE
# note: command had no output on stdout or stderr
# RUN: at line 2
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/22/include -nostdsysteminc -triple x86_64-unknown-linux-gnu -std=c++20 -fclangir -emit-cir -mmlir --mlir-print-ir-after=cir-lowering-prepare /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/three-way-cmp.cpp -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/three-way-cmp.cpp.tmp.cir 2>&1 | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/three-way-cmp.cpp -check-prefix=AFTER
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/22/include -nostdsysteminc -triple x86_64-unknown-linux-gnu -std=c++20 -fclangir -emit-cir -mmlir --mlir-print-ir-after=cir-lowering-prepare /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/three-way-cmp.cpp -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/three-way-cmp.cpp.tmp.cir
# 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/clang/test/CIR/CodeGen/three-way-cmp.cpp -check-prefix=AFTER
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/three-way-cmp.cpp:22:16: error: AFTER-NEXT: expected string not found in input
# | // AFTER-NEXT: %[[#LT:]] = cir.const(#cir.int<-1> : !s8i) : !s8i
# |                ^
# | <stdin>:14:52: note: scanning from here
# |  %4 = cir.load align(4) %1 : !cir.ptr<!s32i>, !s32i
# |                                                    ^
# | <stdin>:15:2: note: possible intended match here
# |  %5 = cir.const #cir.int<-1> : !s8i
# |  ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/three-way-cmp.cpp
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |            .
# |            .
# |            .
# |            9:  %1 = cir.alloca !s32i, !cir.ptr<!s32i>, ["y", init] {alignment = 4 : i64} 
# |           10:  %2 = cir.alloca !rec_std3A3A__13A3Astrong_ordering, !cir.ptr<!rec_std3A3A__13A3Astrong_ordering>, ["__retval"] {alignment = 1 : i64} 
# |           11:  cir.store %arg0, %0 : !s32i, !cir.ptr<!s32i> 
# |           12:  cir.store %arg1, %1 : !s32i, !cir.ptr<!s32i> 
# |           13:  %3 = cir.load align(4) %0 : !cir.ptr<!s32i>, !s32i 
# |           14:  %4 = cir.load align(4) %1 : !cir.ptr<!s32i>, !s32i 
# | next:22'0                                                        X error: no match found
# |           15:  %5 = cir.const #cir.int<-1> : !s8i 
# | next:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | next:22'1      ?                                   possible intended match
# |           16:  %6 = cir.const #cir.int<0> : !s8i 
# | next:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           17:  %7 = cir.const #cir.int<1> : !s8i 
# | next:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           18:  %8 = cir.cmp(lt, %3, %4) : !s32i, !cir.bool 
# | next:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           19:  %9 = cir.cmp(lt, %3, %4) : !s32i, !cir.bool 
# | next:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           20:  %10 = cir.select if %9 then %6 else %7 : (!cir.bool, !s8i, !s8i) -> !s8i 
# | next:22'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/169963


More information about the cfe-commits mailing list