diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:41:05 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:41:05 +0000 |
| commit | 01095a5d43bbfde13731688ddcf6048ebb8b7721 (patch) | |
| tree | 4def12e759965de927d963ac65840d663ef9d1ea /test/CodeGen/AMDGPU/readcyclecounter.ll | |
| parent | f0f4822ed4b66e3579e92a89f368f8fb860e218e (diff) | |
Notes
Diffstat (limited to 'test/CodeGen/AMDGPU/readcyclecounter.ll')
| -rw-r--r-- | test/CodeGen/AMDGPU/readcyclecounter.ll | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/CodeGen/AMDGPU/readcyclecounter.ll b/test/CodeGen/AMDGPU/readcyclecounter.ll new file mode 100644 index 000000000000..e6d0efd0ff94 --- /dev/null +++ b/test/CodeGen/AMDGPU/readcyclecounter.ll @@ -0,0 +1,25 @@ +; RUN: llc -march=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=GCN %s +; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=VI -check-prefix=GCN %s + +declare i64 @llvm.readcyclecounter() #0 + +; GCN-LABEL: {{^}}test_readcyclecounter: +; SI-DAG: s_memtime s{{\[[0-9]+:[0-9]+\]}} +; VI-DAG: s_memrealtime s{{\[[0-9]+:[0-9]+\]}} +; GCN-DAG: s_load_dwordx2 +; GCN: lgkmcnt +; GCN: buffer_store_dwordx2 +; GCN-NOT: lgkmcnt +; SI: s_memtime s{{\[[0-9]+:[0-9]+\]}} +; VI: s_memrealtime s{{\[[0-9]+:[0-9]+\]}} +; GCN: buffer_store_dwordx2 +define void @test_readcyclecounter(i64 addrspace(1)* %out) #0 { + %cycle0 = call i64 @llvm.readcyclecounter() + store volatile i64 %cycle0, i64 addrspace(1)* %out + + %cycle1 = call i64 @llvm.readcyclecounter() + store volatile i64 %cycle1, i64 addrspace(1)* %out + ret void +} + +attributes #0 = { nounwind } |
