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