1 ; RUN: llc < %s -march=nvptx64 -mcpu=sm_90 -mattr=+ptx80| FileCheck --check-prefixes=CHECK %s
2 ; RUN: %if ptxas-12.0 %{ llc < %s -march=nvptx64 -mcpu=sm_90 -mattr=+ptx80| %ptxas-verify -arch=sm_90 %}
4 ; CHECK-LABEL: test_isspacep
5 define i1 @test_isspacep_shared_cluster(ptr %p) {
6 ; CHECK: isspacep.shared::cluster
7 %a = tail call i1 @llvm.nvvm.isspacep.shared.cluster(ptr %p)
12 ; CHECK-LABEL: test_mapa(
13 define ptr @test_mapa(ptr %p, i32 %r) {
15 %a = call ptr @llvm.nvvm.mapa(ptr %p, i32 %r)
19 ; CHECK-LABEL: test_mapa_shared_cluster(
20 define ptr addrspace(3) @test_mapa_shared_cluster(ptr addrspace(3) %p, i32 %r) {
21 ; CHECK: mapa.shared::cluster.u64
22 %a = call ptr addrspace(3) @llvm.nvvm.mapa.shared.cluster(ptr addrspace(3) %p, i32 %r)
23 ret ptr addrspace(3) %a
26 ; CHECK-LABEL: test_getctarank(
27 define i32 @test_getctarank(ptr %p) {
28 ; CHECK: getctarank.u64
29 %a = call i32 @llvm.nvvm.getctarank(ptr %p)
33 ; CHECK-LABEL: test_getctarank_shared_cluster(
34 define i32 @test_getctarank_shared_cluster(ptr addrspace(3) %p) {
35 ; CHECK64: getctarank.shared::cluster.u64
36 ; CHECK32: getctarank.shared::cluster.u32
37 %a = call i32 @llvm.nvvm.getctarank.shared.cluster(ptr addrspace(3) %p)
41 ; CHECK-LABEL: test_clusterid_x(
42 define i32 @test_clusterid_x() {
43 ; CHECK: mov.u32 %r{{[0-9]+}}, %clusterid.x;
45 %x = call i32 @llvm.nvvm.read.ptx.sreg.clusterid.x()
48 ; CHECK-LABEL: test_clusterid_y(
49 define i32 @test_clusterid_y() {
50 ; CHECK: mov.u32 %r{{[0-9]+}}, %clusterid.y;
52 %x = call i32 @llvm.nvvm.read.ptx.sreg.clusterid.y()
55 ; CHECK-LABEL: test_clusterid_z(
56 define i32 @test_clusterid_z() {
57 ; CHECK: mov.u32 %r{{[0-9]+}}, %clusterid.z;
59 %x = call i32 @llvm.nvvm.read.ptx.sreg.clusterid.z()
62 ; CHECK-LABEL: test_clusterid_w(
63 define i32 @test_clusterid_w() {
64 ; CHECK: mov.u32 %r{{[0-9]+}}, %clusterid.w;
66 %x = call i32 @llvm.nvvm.read.ptx.sreg.clusterid.w()
70 ; CHECK-LABEL: test_nclusterid_x(
71 define i32 @test_nclusterid_x() {
72 ; CHECK: mov.u32 %r{{[0-9]+}}, %nclusterid.x;
74 %x = call i32 @llvm.nvvm.read.ptx.sreg.nclusterid.x()
77 ; CHECK-LABEL: test_nclusterid_y(
78 define i32 @test_nclusterid_y() {
79 ; CHECK: mov.u32 %r{{[0-9]+}}, %nclusterid.y;
81 %x = call i32 @llvm.nvvm.read.ptx.sreg.nclusterid.y()
84 ; CHECK-LABEL: test_nclusterid_z(
85 define i32 @test_nclusterid_z() {
86 ; CHECK: mov.u32 %r{{[0-9]+}}, %nclusterid.z;
88 %x = call i32 @llvm.nvvm.read.ptx.sreg.nclusterid.z()
91 ; CHECK-LABEL: test_nclusterid_w(
92 define i32 @test_nclusterid_w() {
93 ; CHECK: mov.u32 %r{{[0-9]+}}, %nclusterid.w;
95 %x = call i32 @llvm.nvvm.read.ptx.sreg.nclusterid.w()
99 ; CHECK-LABEL: test_cluster_ctarank(
100 define i32 @test_cluster_ctarank() {
101 ; CHECK: mov.u32 %r{{[0-9]+}}, %cluster_ctarank;
103 %x = call i32 @llvm.nvvm.read.ptx.sreg.cluster.ctarank()
107 ; CHECK-LABEL: test_cluster_nctarank(
108 define i32 @test_cluster_nctarank() {
109 ; CHECK: mov.u32 %r{{[0-9]+}}, %cluster_nctarank;
111 %x = call i32 @llvm.nvvm.read.ptx.sreg.cluster.nctarank()
115 ; CHECK-LABEL: test_is_explicit_cluster(
116 define i1 @test_is_explicit_cluster() {
117 ; CHECK: mov.pred %p{{[0-9]+}}, %is_explicit_cluster;
119 %x = call i1 @llvm.nvvm.is_explicit_cluster()
123 ; CHECK-LABEL: test_barrier_cluster(
124 define void @test_barrier_cluster() {
125 ; CHECK: barrier.cluster.arrive;
126 call void @llvm.nvvm.barrier.cluster.arrive()
127 ; CHECK: barrier.cluster.arrive.relaxed;
128 call void @llvm.nvvm.barrier.cluster.arrive.relaxed()
129 ; CHECK: barrier.cluster.wait;
130 call void @llvm.nvvm.barrier.cluster.wait()
131 ; CHECK: fence.sc.cluster
132 call void @llvm.nvvm.fence.sc.cluster()
137 declare i1 @llvm.nvvm.isspacep.shared.cluster(ptr %p);
138 declare ptr @llvm.nvvm.mapa(ptr %p, i32 %r);
139 declare ptr addrspace(3) @llvm.nvvm.mapa.shared.cluster(ptr addrspace(3) %p, i32 %r);
140 declare i32 @llvm.nvvm.getctarank(ptr %p);
141 declare i32 @llvm.nvvm.getctarank.shared.cluster(ptr addrspace(3) %p);
142 declare i32 @llvm.nvvm.read.ptx.sreg.clusterid.x()
143 declare i32 @llvm.nvvm.read.ptx.sreg.clusterid.y()
144 declare i32 @llvm.nvvm.read.ptx.sreg.clusterid.z()
145 declare i32 @llvm.nvvm.read.ptx.sreg.clusterid.w()
146 declare i32 @llvm.nvvm.read.ptx.sreg.nclusterid.x()
147 declare i32 @llvm.nvvm.read.ptx.sreg.nclusterid.y()
148 declare i32 @llvm.nvvm.read.ptx.sreg.nclusterid.z()
149 declare i32 @llvm.nvvm.read.ptx.sreg.nclusterid.w()
150 declare i32 @llvm.nvvm.read.ptx.sreg.cluster.ctarank()
151 declare i32 @llvm.nvvm.read.ptx.sreg.cluster.nctarank()
152 declare i1 @llvm.nvvm.is_explicit_cluster()
153 declare void @llvm.nvvm.barrier.cluster.arrive()
154 declare void @llvm.nvvm.barrier.cluster.arrive.relaxed()
155 declare void @llvm.nvvm.barrier.cluster.wait()
156 declare void @llvm.nvvm.fence.sc.cluster()