[llvm] [NVPTX] Add Intrinsics for applypriority.* (PR #127989)

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 20 11:35:18 PST 2025


================
@@ -789,6 +789,17 @@ def PREFETCH_GLOBAL_L2_EVICT_LAST   : NVPTXInst<(outs), (ins Int64Regs:$addr),
 
 def PREFETCHU_L1 : PREFETCH_INTRS<"prefetchu.L1">;
 
+//Applypriority intrinsics
+class APPLYPRIORITY_L2_INTRS<string InstName> :
+          NVPTXInst<(outs), (ins Int64Regs:$addr, Int64Regs:$size),
+          InstName # " [$addr], $size;",
+          [(!cast<Intrinsic>("int_nvvm_" # !subst("::", "_", !subst(".", "_", InstName)))
+          i64:$addr, i64:$size)]>,
+          Requires<[hasPTX<74>, hasSM<80>]>;
+
+def APPLYPRIORITY_L2_EVICT_NORMAL        : APPLYPRIORITY_L2_INTRS<"applypriority.L2::evict_normal">;
+def APPLYPRIORITY_GLOBAL_L2_EVICT_NORMAL : APPLYPRIORITY_L2_INTRS<"applypriority.global.L2::evict_normal">;
----------------
Artem-B wrote:

Instead of accepting complete instruction name, we could accept address space part only (I.e. `""` or `"global"`) and avoid having to replace dots/colons with underscores.

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


More information about the llvm-commits mailing list