xref: /llvm-project/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.s.memrealtime.ll (revision 9e9907f1cfa424366fba58d9520f9305b537cec9)
1; RUN: llc -mtriple=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
2; RUN: not --crash llc -mtriple=amdgcn -mcpu=gfx1100 -verify-machineinstrs < %s 2>&1 | FileCheck -check-prefix=ERR %s
3
4; ERR: LLVM ERROR: Cannot select: intrinsic %llvm.amdgcn.s.memrealtime
5
6declare i64 @llvm.amdgcn.s.memrealtime() #0
7
8; GCN-LABEL: {{^}}test_s_memrealtime:
9; GCN-DAG: s_memrealtime s{{\[[0-9]+:[0-9]+\]}}
10; GCN-DAG: s_load_dwordx2
11; GCN: lgkmcnt
12; GCN: _store_dwordx2
13; GCN-NOT: lgkmcnt
14; GCN: s_memrealtime s{{\[[0-9]+:[0-9]+\]}}
15; GCN: _store_dwordx2
16define amdgpu_kernel void @test_s_memrealtime(ptr addrspace(1) %out) #0 {
17  %cycle0 = call i64 @llvm.amdgcn.s.memrealtime()
18  store volatile i64 %cycle0, ptr addrspace(1) %out
19
20  %cycle1 = call i64 @llvm.amdgcn.s.memrealtime()
21  store volatile i64 %cycle1, ptr addrspace(1) %out
22  ret void
23}
24
25attributes #0 = { nounwind }
26