AMDGPU: Implement readcyclecounter
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Sat, 27 Feb 2016 08:53:46 +0000 (08:53 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Sat, 27 Feb 2016 08:53:46 +0000 (08:53 +0000)
commit61738cbcb6c40cdaf6a6c560787b07373415114c
tree07e4ca2782e2f1996a768a1dfe09241c4630ac59
parent353c84e747924745eb0e5df4defc2afd90a1758e
AMDGPU: Implement readcyclecounter

This matches the behavior of the HSAIL clock instruction.
s_realmemtime is used if the subtarget supports it, and falls
back to s_memtime if not.

Also introduces new intrinsics for each of s_memtime / s_memrealtime.

llvm-svn: 262119
12 files changed:
llvm/include/llvm/IR/IntrinsicsAMDGPU.td
llvm/lib/Target/AMDGPU/AMDGPU.td
llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp
llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h
llvm/lib/Target/AMDGPU/SIISelLowering.cpp
llvm/lib/Target/AMDGPU/SIInstrInfo.td
llvm/lib/Target/AMDGPU/SIInstructions.td
llvm/lib/Target/AMDGPU/VIInstructions.td
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.s.memrealtime.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.s.memtime.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/readcyclecounter.ll [new file with mode: 0644]
llvm/test/MC/AMDGPU/smrd.s