[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:35 PDT 2025
================
@@ -4049,6 +4049,39 @@ def CIR_ExpectOp : CIR_Op<"expect", [
}];
}
+//===----------------------------------------------------------------------===//
+// PrefetchOp
+//===----------------------------------------------------------------------===//
+
+def CIR_PrefetchOp : CIR_Op<"prefetch"> {
+ let summary = "prefetch operation";
+ let description = [{
+ The `cir.prefetch` op prefetches data from the memmory address.
+
+ ```mlir
+ cir.prefetch(%0 : !cir.ptr<!void>) locality(1) write
+ ```
+
+ This opcode has the three attributes:
----------------
andykaylor wrote:
```suggestion
This opcode has two attributes:
```
The missing third attribute is "cache type" (data or code), and we'll need that when we implement target-specific prefetch intrinsics, but we don't need it for this PR.
It is probably better to just omit this line.
https://github.com/llvm/llvm-project/pull/164387
More information about the cfe-commits
mailing list