[clang] [CIR] Upstream handling for __builtin_prefetch (PR #164387)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 21 13:09:36 PDT 2025


================
@@ -0,0 +1,20 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-cir %s -o - | FileCheck %s -check-prefix=CIR
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-llvm %s -o - | FileCheck %s -check-prefix=LLVM
+
+void foo(void *a) {
+  __builtin_prefetch(a, 1, 1);
+}
----------------
andykaylor wrote:

```suggestion
void test_prefetch(void *a) {
  __builtin_prefetch(a);
  __builtin_prefetch(a, 0);
  __builtin_prefetch(a, 1);
  __builtin_prefetch(a, 1, 1);
}
```

https://github.com/llvm/llvm-project/pull/164387


More information about the cfe-commits mailing list