[llvm] [NVPTX] Add intrinsics for prefetch.* (PR #125887)
Durgadoss R via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 7 03:28:03 PST 2025
================
@@ -740,6 +740,31 @@ foreach dim = [1, 2, 3, 4, 5] in {
}
}
+//Prefetch and Prefetchu
+class PREFETCH_INTRS<string InstName, Intrinsic Intrin> :
+ NVPTXInst<(outs), (ins Int64Regs:$addr),
+ !strconcat(InstName, " [$addr];"),
+ [(Intrin i64:$addr)]>,
+ Requires<[hasPTX<80>, hasSM<90>]>;
+
+
+// Only global supports evictlast and evictnormal.
+// Other variants (local and default) only support evictnormal
+foreach addr = ["global", "local", ""] in {
+ foreach level = ["L1", "L2"] in {
+ foreach evict = !if(!eq(addr, "global"),
+ ["evictlast", "evictnormal"],
+ ["evictnormal"]) in {
+
+ defvar inst_name = "prefetch." # !if(!eq(addr, ""), "", addr # ".") # level # "." # evict;
+ defvar intr_name = !strconcat("int_nvvm_", !subst(".", "_", inst_name));
----------------
durga4github wrote:
We can directly use a # here
https://github.com/llvm/llvm-project/pull/125887
More information about the llvm-commits
mailing list