Skip to content

Commit 38a8fc1

Browse files
committed
remove multiclass and refine
1 parent 015908a commit 38a8fc1

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

llvm/lib/Target/NVPTX/NVPTXIntrinsics.td

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -790,20 +790,15 @@ def PREFETCH_GLOBAL_L2_EVICT_LAST : NVPTXInst<(outs), (ins Int64Regs:$addr),
790790
def PREFETCHU_L1 : PREFETCH_INTRS<"prefetchu.L1">;
791791

792792
//Applypriority intrinsics
793-
multiclass APPLYPRIORITY_L2_INTRS<string addr> {
794-
defvar InstName = "applypriority."
795-
# !if(!eq(addr, ""), "", addr # ".")
796-
# "L2::evict_normal";
797-
798-
def APPLYPRIORITY_L2 : NVPTXInst<(outs), (ins Int64Regs:$addr, Int64Regs:$size),
799-
InstName # " [$addr], $size;",
800-
[(!cast<Intrinsic>("int_nvvm_" # !subst("::", "_", !subst(".", "_", InstName)))
801-
i64:$addr, i64:$size)]>,
802-
Requires<[hasPTX<80>, hasSM<90>]>;
803-
}
804-
805-
defm APPLYPRIORITY_L2_EVICT_NORMAL : APPLYPRIORITY_L2_INTRS<"">;
806-
defm APPLYPRIORITY_GLOBAL_L2_EVICT_NORMAL : APPLYPRIORITY_L2_INTRS<"global">;
793+
class APPLYPRIORITY_L2_INTRS<string InstName> :
794+
NVPTXInst<(outs), (ins Int64Regs:$addr, Int64Regs:$size),
795+
InstName # " [$addr], $size;",
796+
[(!cast<Intrinsic>("int_nvvm_" # !subst("::", "_", !subst(".", "_", InstName)))
797+
i64:$addr, i64:$size)]>,
798+
Requires<[hasPTX<80>, hasSM<90>]>;
799+
800+
def APPLYPRIORITY_L2_EVICT_NORMAL : APPLYPRIORITY_L2_INTRS<"applypriority.L2::evict_normal">;
801+
def APPLYPRIORITY_GLOBAL_L2_EVICT_NORMAL : APPLYPRIORITY_L2_INTRS<"applypriority.global.L2::evict_normal">;
807802

808803
//-----------------------------------
809804
// MBarrier Functions

0 commit comments

Comments
 (0)