[clang] [CIR] Rewrite a raised std::find over bytes into memchr (PR #212355)
Rithik Sharma via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 12 16:53:44 PDT 2026
================
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t.cir
+// RUN: FileCheck %s --input-file=%t.cir
+
+namespace std {
+inline namespace __1 {
+template <class Iter, class T> Iter find(Iter first, Iter last, const T &value);
+}
+}
+
+char8_t *char8_call(char8_t *first, char8_t *last, const char8_t &value) {
+ return std::find(first, last, value);
+}
+// CHECK: cir.func{{.*}} @_ZNSt3__14findIPDuDuEET_S2_S2_RKT0_{{.*}} func_info<#cir.func_identity<"std::find">>
----------------
SharmaRithik wrote:
I added the --implicit-check-not=narrow_char_params and also added wchar_t, char16_t and char32_t with char8_t
https://github.com/llvm/llvm-project/pull/212355
More information about the cfe-commits
mailing list