xref: /aosp_15_r20/external/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.s.memtime.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=GCN %s
2*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=VI -check-prefix=GCN %s
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Workerdeclare i64 @llvm.amdgcn.s.memtime() #0
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Worker; GCN-LABEL: {{^}}test_s_memtime:
7*9880d681SAndroid Build Coastguard Worker; GCN-DAG: s_memtime s{{\[[0-9]+:[0-9]+\]}}
8*9880d681SAndroid Build Coastguard Worker; GCN-DAG: s_load_dwordx2
9*9880d681SAndroid Build Coastguard Worker; GCN: lgkmcnt
10*9880d681SAndroid Build Coastguard Worker; GCN: buffer_store_dwordx2
11*9880d681SAndroid Build Coastguard Worker; GCN-NOT: lgkmcnt
12*9880d681SAndroid Build Coastguard Worker; GCN: s_memtime s{{\[[0-9]+:[0-9]+\]}}
13*9880d681SAndroid Build Coastguard Worker; GCN: buffer_store_dwordx2
14*9880d681SAndroid Build Coastguard Workerdefine void @test_s_memtime(i64 addrspace(1)* %out) #0 {
15*9880d681SAndroid Build Coastguard Worker  %cycle0 = call i64 @llvm.amdgcn.s.memtime()
16*9880d681SAndroid Build Coastguard Worker  store volatile i64 %cycle0, i64 addrspace(1)* %out
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard Worker  %cycle1 = call i64 @llvm.amdgcn.s.memtime()
19*9880d681SAndroid Build Coastguard Worker  store volatile i64 %cycle1, i64 addrspace(1)* %out
20*9880d681SAndroid Build Coastguard Worker  ret void
21*9880d681SAndroid Build Coastguard Worker}
22*9880d681SAndroid Build Coastguard Worker
23*9880d681SAndroid Build Coastguard Workerattributes #0 = { nounwind }
24