[clang] [CIR] Add MemChrOp for __builtin_char_memchr and __builtin_memchr (PR #175234)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 9 12:29:36 PST 2026
github-actions[bot] wrote:
<!--PREMERGE ADVISOR COMMENT: Linux-->
# :penguin: Linux x64 Test Results
* 86269 tests passed
* 751 tests skipped
* 2 tests failed
## Failed Tests
(click on a test name to see its output)
### Clang
<details>
<summary>Clang.CIR/CodeGen/builtin-memchr.c</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 -fclangir -emit-cir /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/builtin-memchr.c -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/builtin-memchr.c.tmp.cir
# 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 -fclangir -emit-cir /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/builtin-memchr.c -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/builtin-memchr.c.tmp.cir
# note: command had no output on stdout or stderr
# RUN: at line 2
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --check-prefix=CIR --input-file=/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/builtin-memchr.c.tmp.cir /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/builtin-memchr.c
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --check-prefix=CIR --input-file=/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/builtin-memchr.c.tmp.cir /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/builtin-memchr.c
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/builtin-memchr.c:14:9: error: CIR: expected string not found in input
# | // CIR: %[[LEN:.*]] = cir.const #cir.int<32> : !s32i
# | ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/builtin-memchr.c.tmp.cir:15:38: note: scanning from here
# | %4 = cir.const #cir.int<123> : !s32i loc(#loc7)
# | ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/builtin-memchr.c.tmp.cir:16:2: note: possible intended match here
# | %5 = cir.const #cir.int<32> : !u64i loc(#loc8)
# | ^
# |
# | Input file: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/builtin-memchr.c.tmp.cir
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/builtin-memchr.c
# |
# | -dump-input=help explains the following input dump.
# |
# | Input was:
# | <<<<<<
# | .
# | .
# | .
# | 10: %0 = cir.alloca !cir.ptr<!s8i>, !cir.ptr<!cir.ptr<!s8i>>, ["arg", init] {alignment = 8 : i64} loc(#loc13)
# | 11: %1 = cir.alloca !cir.ptr<!void>, !cir.ptr<!cir.ptr<!void>>, ["__retval"] {alignment = 8 : i64} loc(#loc2)
# | 12: cir.store %arg0, %0 : !cir.ptr<!s8i>, !cir.ptr<!cir.ptr<!s8i>> loc(#loc5)
# | 13: %2 = cir.load align(8) %0 : !cir.ptr<!cir.ptr<!s8i>>, !cir.ptr<!s8i> loc(#loc6)
# | 14: %3 = cir.cast bitcast %2 : !cir.ptr<!s8i> -> !cir.ptr<!void> loc(#loc6)
# | 15: %4 = cir.const #cir.int<123> : !s32i loc(#loc7)
# | check:14'0 X~~~~~~~~~~~ error: no match found
# | 16: %5 = cir.const #cir.int<32> : !u64i loc(#loc8)
# | check:14'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:14'1 ? possible intended match
# | 17: %6 = cir.libc.memchr(%3, %4, %5) loc(#loc9)
# | check:14'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 18: cir.store %6, %1 : !cir.ptr<!void>, !cir.ptr<!cir.ptr<!void>> loc(#loc14)
# | check:14'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 19: %7 = cir.load %1 : !cir.ptr<!cir.ptr<!void>>, !cir.ptr<!void> loc(#loc14)
# | check:14'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 20: cir.return %7 : !cir.ptr<!void> loc(#loc14)
# | check:14'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 21: } loc(#loc12)
# | check:14'0 ~~~~~~~~~~~~~~~
# | .
# | .
# | .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1
--
```
</details>
<details>
<summary>Clang.CIR/CodeGen/builtin-memchr.c</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 -fclangir -emit-cir /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/builtin-memchr.c -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/builtin-memchr.c.tmp.cir
# 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 -fclangir -emit-cir /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/builtin-memchr.c -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/builtin-memchr.c.tmp.cir
# note: command had no output on stdout or stderr
# RUN: at line 2
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --check-prefix=CIR --input-file=/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/builtin-memchr.c.tmp.cir /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/builtin-memchr.c
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --check-prefix=CIR --input-file=/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/builtin-memchr.c.tmp.cir /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/builtin-memchr.c
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/builtin-memchr.c:14:9: error: CIR: expected string not found in input
# | // CIR: %[[LEN:.*]] = cir.const #cir.int<32> : !s32i
# | ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/builtin-memchr.c.tmp.cir:15:38: note: scanning from here
# | %4 = cir.const #cir.int<123> : !s32i loc(#loc7)
# | ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/builtin-memchr.c.tmp.cir:16:2: note: possible intended match here
# | %5 = cir.const #cir.int<32> : !u64i loc(#loc8)
# | ^
# |
# | Input file: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/CIR/CodeGen/Output/builtin-memchr.c.tmp.cir
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CIR/CodeGen/builtin-memchr.c
# |
# | -dump-input=help explains the following input dump.
# |
# | Input was:
# | <<<<<<
# | .
# | .
# | .
# | 10: %0 = cir.alloca !cir.ptr<!s8i>, !cir.ptr<!cir.ptr<!s8i>>, ["arg", init] {alignment = 8 : i64} loc(#loc13)
# | 11: %1 = cir.alloca !cir.ptr<!void>, !cir.ptr<!cir.ptr<!void>>, ["__retval"] {alignment = 8 : i64} loc(#loc2)
# | 12: cir.store %arg0, %0 : !cir.ptr<!s8i>, !cir.ptr<!cir.ptr<!s8i>> loc(#loc5)
# | 13: %2 = cir.load align(8) %0 : !cir.ptr<!cir.ptr<!s8i>>, !cir.ptr<!s8i> loc(#loc6)
# | 14: %3 = cir.cast bitcast %2 : !cir.ptr<!s8i> -> !cir.ptr<!void> loc(#loc6)
# | 15: %4 = cir.const #cir.int<123> : !s32i loc(#loc7)
# | check:14'0 X~~~~~~~~~~~ error: no match found
# | 16: %5 = cir.const #cir.int<32> : !u64i loc(#loc8)
# | check:14'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:14'1 ? possible intended match
# | 17: %6 = cir.libc.memchr(%3, %4, %5) loc(#loc9)
# | check:14'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 18: cir.store %6, %1 : !cir.ptr<!void>, !cir.ptr<!cir.ptr<!void>> loc(#loc14)
# | check:14'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 19: %7 = cir.load %1 : !cir.ptr<!cir.ptr<!void>>, !cir.ptr<!void> loc(#loc14)
# | check:14'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 20: cir.return %7 : !cir.ptr<!void> loc(#loc14)
# | check:14'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 21: } loc(#loc12)
# | check:14'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/175234
More information about the cfe-commits
mailing list