diff options
author | mingmingl <mingmingl@google.com> | 2024-02-13 11:11:15 -0800 |
---|---|---|
committer | mingmingl <mingmingl@google.com> | 2024-02-13 11:11:15 -0800 |
commit | 5de40c7ae250cf47a36f05d32e014a2bd9adfeef (patch) | |
tree | 9afc3edb9616399c97721d96c6cab702575a5f35 /llvm/test/CodeGen/NVPTX/intrinsics.ll | |
parent | 3f2da71253c4ea2ca75c4aaf9d659b11aab12c44 (diff) | |
parent | fc0e9c8315564288f9079a633892abadace534cf (diff) | |
download | llvm-5de40c7ae250cf47a36f05d32e014a2bd9adfeef.zip llvm-5de40c7ae250cf47a36f05d32e014a2bd9adfeef.tar.gz llvm-5de40c7ae250cf47a36f05d32e014a2bd9adfeef.tar.bz2 |
Diffstat (limited to 'llvm/test/CodeGen/NVPTX/intrinsics.ll')
-rw-r--r-- | llvm/test/CodeGen/NVPTX/intrinsics.ll | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/llvm/test/CodeGen/NVPTX/intrinsics.ll b/llvm/test/CodeGen/NVPTX/intrinsics.ll index 7e45b1f..e160280 100644 --- a/llvm/test/CodeGen/NVPTX/intrinsics.ll +++ b/llvm/test/CodeGen/NVPTX/intrinsics.ll @@ -1,7 +1,7 @@ -; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s -; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 | FileCheck %s -; RUN: %if ptxas && !ptxas-12.0 %{ llc < %s -march=nvptx -mcpu=sm_20 | %ptxas-verify %} -; RUN: %if ptxas %{ llc < %s -march=nvptx64 -mcpu=sm_20 | %ptxas-verify %} +; RUN: llc < %s -march=nvptx -mcpu=sm_60 | FileCheck %s +; RUN: llc < %s -march=nvptx64 -mcpu=sm_60 | FileCheck %s +; RUN: %if ptxas && !ptxas-12.0 %{ llc < %s -march=nvptx -mcpu=sm_60 | %ptxas-verify %} +; RUN: %if ptxas %{ llc < %s -march=nvptx64 -mcpu=sm_60 | %ptxas-verify %} ; CHECK-LABEL: test_fabsf( define float @test_fabsf(float %f) { @@ -151,6 +151,28 @@ define i64 @test_globaltimer() { ret i64 %ret } +; CHECK-LABEL: test_cyclecounter +define i64 @test_cyclecounter() { +; CHECK: mov.u64 %r{{.*}}, %clock64; + %a = tail call i64 @llvm.readcyclecounter() +; CHECK: mov.u64 %r{{.*}}, %clock64; + %b = tail call i64 @llvm.readcyclecounter() + %ret = add i64 %a, %b +; CHECK: ret + ret i64 %ret +} + +; CHECK-LABEL: test_steadycounter +define i64 @test_steadycounter() { +; CHECK: mov.u64 %r{{.*}}, %globaltimer; + %a = tail call i64 @llvm.readsteadycounter() +; CHECK: mov.u64 %r{{.*}}, %globaltimer; + %b = tail call i64 @llvm.readsteadycounter() + %ret = add i64 %a, %b +; CHECK: ret + ret i64 %ret +} + declare float @llvm.fabs.f32(float) declare double @llvm.fabs.f64(double) declare float @llvm.nvvm.sqrt.f(float) @@ -166,3 +188,5 @@ declare i32 @llvm.nvvm.read.ptx.sreg.clock() declare i64 @llvm.nvvm.read.ptx.sreg.clock64() declare void @llvm.nvvm.exit() declare i64 @llvm.nvvm.read.ptx.sreg.globaltimer() +declare i64 @llvm.readcyclecounter() +declare i64 @llvm.readsteadycounter() |