1 ; RUN: llc -march=amdgcn -mcpu=tahiti -verify-machineinstrs < %s | FileCheck --check-prefixes=SIVI,GCN %s
2 ; RUN: llc -march=amdgcn -mcpu=tonga -mattr=-flat-for-global -verify-machineinstrs < %s | FileCheck --check-prefixes=SIVI,GCN %s
3 ; RUN: llc -march=amdgcn -mcpu=gfx1010 -mattr=-flat-for-global -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
4 ; RUN: llc -march=amdgcn -mcpu=gfx1030 -mattr=-flat-for-global -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
6 declare i64 @llvm.amdgcn.s.memtime() #0
8 ; GCN-LABEL: {{^}}test_s_memtime:
9 ; GCN-DAG: s_memtime s{{\[[0-9]+:[0-9]+\]}}
10 ; GCN-DAG: s_load_dwordx2
12 ; GCN: {{buffer|global}}_store_dwordx2
14 ; GCN: s_memtime s{{\[[0-9]+:[0-9]+\]}}
15 ; GCN: {{buffer|global}}_store_dwordx2
16 define amdgpu_kernel void @test_s_memtime(ptr addrspace(1) %out) #0 {
17 %cycle0 = call i64 @llvm.amdgcn.s.memtime()
18 store volatile i64 %cycle0, ptr addrspace(1) %out
20 %cycle1 = call i64 @llvm.amdgcn.s.memtime()
21 store volatile i64 %cycle1, ptr addrspace(1) %out
25 attributes #0 = { nounwind }