diff options
author | Stephen Hines <srhines@google.com> | 2014-12-01 14:51:49 -0800 |
---|---|---|
committer | Stephen Hines <srhines@google.com> | 2014-12-02 16:08:10 -0800 |
commit | 37ed9c199ca639565f6ce88105f9e39e898d82d0 (patch) | |
tree | 8fb36d3910e3ee4c4e1b7422f4f017108efc52f5 /test/CodeGen/R600/work-item-intrinsics.ll | |
parent | d2327b22152ced7bc46dc629fc908959e8a52d03 (diff) | |
download | external_llvm-37ed9c199ca639565f6ce88105f9e39e898d82d0.zip external_llvm-37ed9c199ca639565f6ce88105f9e39e898d82d0.tar.gz external_llvm-37ed9c199ca639565f6ce88105f9e39e898d82d0.tar.bz2 |
Update aosp/master LLVM for rebase to r222494.
Change-Id: Ic787f5e0124df789bd26f3f24680f45e678eef2d
Diffstat (limited to 'test/CodeGen/R600/work-item-intrinsics.ll')
-rw-r--r-- | test/CodeGen/R600/work-item-intrinsics.ll | 183 |
1 files changed, 100 insertions, 83 deletions
diff --git a/test/CodeGen/R600/work-item-intrinsics.ll b/test/CodeGen/R600/work-item-intrinsics.ll index 90079b0..47f65f5 100644 --- a/test/CodeGen/R600/work-item-intrinsics.ll +++ b/test/CodeGen/R600/work-item-intrinsics.ll @@ -1,13 +1,14 @@ -; RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck --check-prefix=R600-CHECK %s -; RUN: llc < %s -march=r600 -mcpu=SI -verify-machineinstrs | FileCheck --check-prefix=SI-CHECK %s - -; R600-CHECK: @ngroups_x -; R600-CHECK: MEM_RAT_CACHELESS STORE_RAW [[VAL:T[0-9]+\.X]] -; R600-CHECK: MOV [[VAL]], KC0[0].X -; SI-CHECK: @ngroups_x -; SI-CHECK: S_LOAD_DWORD [[VAL:s[0-9]+]], s[0:1], 0 -; SI-CHECK: V_MOV_B32_e32 [[VVAL:v[0-9]+]], [[VAL]] -; SI-CHECK: BUFFER_STORE_DWORD [[VVAL]] +; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=EG -check-prefix=FUNC %s +; RUN: llc -march=r600 -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s + + +; FUNC-LABEL: {{^}}ngroups_x: +; EG: MEM_RAT_CACHELESS STORE_RAW [[VAL:T[0-9]+\.X]] +; EG: MOV [[VAL]], KC0[0].X + +; SI: s_load_dword [[VAL:s[0-9]+]], s[0:1], 0 +; SI: v_mov_b32_e32 [[VVAL:v[0-9]+]], [[VAL]] +; SI: buffer_store_dword [[VVAL]] define void @ngroups_x (i32 addrspace(1)* %out) { entry: %0 = call i32 @llvm.r600.read.ngroups.x() #0 @@ -15,13 +16,13 @@ entry: ret void } -; R600-CHECK: @ngroups_y -; R600-CHECK: MEM_RAT_CACHELESS STORE_RAW [[VAL:T[0-9]+\.X]] -; R600-CHECK: MOV [[VAL]], KC0[0].Y -; SI-CHECK: @ngroups_y -; SI-CHECK: S_LOAD_DWORD [[VAL:s[0-9]+]], s[0:1], 0x1 -; SI-CHECK: V_MOV_B32_e32 [[VVAL:v[0-9]+]], [[VAL]] -; SI-CHECK: BUFFER_STORE_DWORD [[VVAL]] +; FUNC-LABEL: {{^}}ngroups_y: +; EG: MEM_RAT_CACHELESS STORE_RAW [[VAL:T[0-9]+\.X]] +; EG: MOV [[VAL]], KC0[0].Y + +; SI: s_load_dword [[VAL:s[0-9]+]], s[0:1], 0x1 +; SI: v_mov_b32_e32 [[VVAL:v[0-9]+]], [[VAL]] +; SI: buffer_store_dword [[VVAL]] define void @ngroups_y (i32 addrspace(1)* %out) { entry: %0 = call i32 @llvm.r600.read.ngroups.y() #0 @@ -29,13 +30,13 @@ entry: ret void } -; R600-CHECK: @ngroups_z -; R600-CHECK: MEM_RAT_CACHELESS STORE_RAW [[VAL:T[0-9]+\.X]] -; R600-CHECK: MOV [[VAL]], KC0[0].Z -; SI-CHECK: @ngroups_z -; SI-CHECK: S_LOAD_DWORD [[VAL:s[0-9]+]], s[0:1], 0x2 -; SI-CHECK: V_MOV_B32_e32 [[VVAL:v[0-9]+]], [[VAL]] -; SI-CHECK: BUFFER_STORE_DWORD [[VVAL]] +; FUNC-LABEL: {{^}}ngroups_z: +; EG: MEM_RAT_CACHELESS STORE_RAW [[VAL:T[0-9]+\.X]] +; EG: MOV [[VAL]], KC0[0].Z + +; SI: s_load_dword [[VAL:s[0-9]+]], s[0:1], 0x2 +; SI: v_mov_b32_e32 [[VVAL:v[0-9]+]], [[VAL]] +; SI: buffer_store_dword [[VVAL]] define void @ngroups_z (i32 addrspace(1)* %out) { entry: %0 = call i32 @llvm.r600.read.ngroups.z() #0 @@ -43,13 +44,13 @@ entry: ret void } -; R600-CHECK: @global_size_x -; R600-CHECK: MEM_RAT_CACHELESS STORE_RAW [[VAL:T[0-9]+\.X]] -; R600-CHECK: MOV [[VAL]], KC0[0].W -; SI-CHECK: @global_size_x -; SI-CHECK: S_LOAD_DWORD [[VAL:s[0-9]+]], s[0:1], 0x3 -; SI-CHECK: V_MOV_B32_e32 [[VVAL:v[0-9]+]], [[VAL]] -; SI-CHECK: BUFFER_STORE_DWORD [[VVAL]] +; FUNC-LABEL: {{^}}global_size_x: +; EG: MEM_RAT_CACHELESS STORE_RAW [[VAL:T[0-9]+\.X]] +; EG: MOV [[VAL]], KC0[0].W + +; SI: s_load_dword [[VAL:s[0-9]+]], s[0:1], 0x3 +; SI: v_mov_b32_e32 [[VVAL:v[0-9]+]], [[VAL]] +; SI: buffer_store_dword [[VVAL]] define void @global_size_x (i32 addrspace(1)* %out) { entry: %0 = call i32 @llvm.r600.read.global.size.x() #0 @@ -57,13 +58,13 @@ entry: ret void } -; R600-CHECK: @global_size_y -; R600-CHECK: MEM_RAT_CACHELESS STORE_RAW [[VAL:T[0-9]+\.X]] -; R600-CHECK: MOV [[VAL]], KC0[1].X -; SI-CHECK: @global_size_y -; SI-CHECK: S_LOAD_DWORD [[VAL:s[0-9]+]], s[0:1], 0x4 -; SI-CHECK: V_MOV_B32_e32 [[VVAL:v[0-9]+]], [[VAL]] -; SI-CHECK: BUFFER_STORE_DWORD [[VVAL]] +; FUNC-LABEL: {{^}}global_size_y: +; EG: MEM_RAT_CACHELESS STORE_RAW [[VAL:T[0-9]+\.X]] +; EG: MOV [[VAL]], KC0[1].X + +; SI: s_load_dword [[VAL:s[0-9]+]], s[0:1], 0x4 +; SI: v_mov_b32_e32 [[VVAL:v[0-9]+]], [[VAL]] +; SI: buffer_store_dword [[VVAL]] define void @global_size_y (i32 addrspace(1)* %out) { entry: %0 = call i32 @llvm.r600.read.global.size.y() #0 @@ -71,13 +72,13 @@ entry: ret void } -; R600-CHECK: @global_size_z -; R600-CHECK: MEM_RAT_CACHELESS STORE_RAW [[VAL:T[0-9]+\.X]] -; R600-CHECK: MOV [[VAL]], KC0[1].Y -; SI-CHECK: @global_size_z -; SI-CHECK: S_LOAD_DWORD [[VAL:s[0-9]+]], s[0:1], 0x5 -; SI-CHECK: V_MOV_B32_e32 [[VVAL:v[0-9]+]], [[VAL]] -; SI-CHECK: BUFFER_STORE_DWORD [[VVAL]] +; FUNC-LABEL: {{^}}global_size_z: +; EG: MEM_RAT_CACHELESS STORE_RAW [[VAL:T[0-9]+\.X]] +; EG: MOV [[VAL]], KC0[1].Y + +; SI: s_load_dword [[VAL:s[0-9]+]], s[0:1], 0x5 +; SI: v_mov_b32_e32 [[VVAL:v[0-9]+]], [[VAL]] +; SI: buffer_store_dword [[VVAL]] define void @global_size_z (i32 addrspace(1)* %out) { entry: %0 = call i32 @llvm.r600.read.global.size.z() #0 @@ -85,13 +86,13 @@ entry: ret void } -; R600-CHECK: @local_size_x -; R600-CHECK: MEM_RAT_CACHELESS STORE_RAW [[VAL:T[0-9]+\.X]] -; R600-CHECK: MOV [[VAL]], KC0[1].Z -; SI-CHECK: @local_size_x -; SI-CHECK: S_LOAD_DWORD [[VAL:s[0-9]+]], s[0:1], 0x6 -; SI-CHECK: V_MOV_B32_e32 [[VVAL:v[0-9]+]], [[VAL]] -; SI-CHECK: BUFFER_STORE_DWORD [[VVAL]] +; FUNC-LABEL: {{^}}local_size_x: +; EG: MEM_RAT_CACHELESS STORE_RAW [[VAL:T[0-9]+\.X]] +; EG: MOV [[VAL]], KC0[1].Z + +; SI: s_load_dword [[VAL:s[0-9]+]], s[0:1], 0x6 +; SI: v_mov_b32_e32 [[VVAL:v[0-9]+]], [[VAL]] +; SI: buffer_store_dword [[VVAL]] define void @local_size_x (i32 addrspace(1)* %out) { entry: %0 = call i32 @llvm.r600.read.local.size.x() #0 @@ -99,13 +100,13 @@ entry: ret void } -; R600-CHECK: @local_size_y -; R600-CHECK: MEM_RAT_CACHELESS STORE_RAW [[VAL:T[0-9]+\.X]] -; R600-CHECK: MOV [[VAL]], KC0[1].W -; SI-CHECK: @local_size_y -; SI-CHECK: S_LOAD_DWORD [[VAL:s[0-9]+]], s[0:1], 0x7 -; SI-CHECK: V_MOV_B32_e32 [[VVAL:v[0-9]+]], [[VAL]] -; SI-CHECK: BUFFER_STORE_DWORD [[VVAL]] +; FUNC-LABEL: {{^}}local_size_y: +; EG: MEM_RAT_CACHELESS STORE_RAW [[VAL:T[0-9]+\.X]] +; EG: MOV [[VAL]], KC0[1].W + +; SI: s_load_dword [[VAL:s[0-9]+]], s[0:1], 0x7 +; SI: v_mov_b32_e32 [[VVAL:v[0-9]+]], [[VAL]] +; SI: buffer_store_dword [[VVAL]] define void @local_size_y (i32 addrspace(1)* %out) { entry: %0 = call i32 @llvm.r600.read.local.size.y() #0 @@ -113,13 +114,13 @@ entry: ret void } -; R600-CHECK: @local_size_z -; R600-CHECK: MEM_RAT_CACHELESS STORE_RAW [[VAL:T[0-9]+\.X]] -; R600-CHECK: MOV [[VAL]], KC0[2].X -; SI-CHECK: @local_size_z -; SI-CHECK: S_LOAD_DWORD [[VAL:s[0-9]+]], s[0:1], 0x8 -; SI-CHECK: V_MOV_B32_e32 [[VVAL:v[0-9]+]], [[VAL]] -; SI-CHECK: BUFFER_STORE_DWORD [[VVAL]] +; FUNC-LABEL: {{^}}local_size_z: +; EG: MEM_RAT_CACHELESS STORE_RAW [[VAL:T[0-9]+\.X]] +; EG: MOV [[VAL]], KC0[2].X + +; SI: s_load_dword [[VAL:s[0-9]+]], s[0:1], 0x8 +; SI: v_mov_b32_e32 [[VVAL:v[0-9]+]], [[VAL]] +; SI: buffer_store_dword [[VVAL]] define void @local_size_z (i32 addrspace(1)* %out) { entry: %0 = call i32 @llvm.r600.read.local.size.z() #0 @@ -127,13 +128,27 @@ entry: ret void } -; The tgid values are stored in ss offset by the number of user ss. -; Currently we always use exactly 2 user ss for the pointer to the +; FUNC-LABEL: {{^}}get_work_dim: +; EG: MEM_RAT_CACHELESS STORE_RAW [[VAL:T[0-9]+\.X]] +; EG: MOV [[VAL]], KC0[2].Z + +; SI: s_load_dword [[VAL:s[0-9]+]], s[0:1], 0xb +; SI: v_mov_b32_e32 [[VVAL:v[0-9]+]], [[VAL]] +; SI: buffer_store_dword [[VVAL]] +define void @get_work_dim (i32 addrspace(1)* %out) { +entry: + %0 = call i32 @llvm.AMDGPU.read.workdim() #0 + store i32 %0, i32 addrspace(1)* %out + ret void +} + +; The tgid values are stored in sgprs offset by the number of user sgprs. +; Currently we always use exactly 2 user sgprs for the pointer to the ; kernel arguments, but this may change in the future. -; SI-CHECK: @tgid_x -; SI-CHECK: V_MOV_B32_e32 [[VVAL:v[0-9]+]], s2 -; SI-CHECK: BUFFER_STORE_DWORD [[VVAL]] +; FUNC-LABEL: {{^}}tgid_x: +; SI: v_mov_b32_e32 [[VVAL:v[0-9]+]], s4 +; SI: buffer_store_dword [[VVAL]] define void @tgid_x (i32 addrspace(1)* %out) { entry: %0 = call i32 @llvm.r600.read.tgid.x() #0 @@ -141,9 +156,9 @@ entry: ret void } -; SI-CHECK: @tgid_y -; SI-CHECK: V_MOV_B32_e32 [[VVAL:v[0-9]+]], s3 -; SI-CHECK: BUFFER_STORE_DWORD [[VVAL]] +; FUNC-LABEL: {{^}}tgid_y: +; SI: v_mov_b32_e32 [[VVAL:v[0-9]+]], s5 +; SI: buffer_store_dword [[VVAL]] define void @tgid_y (i32 addrspace(1)* %out) { entry: %0 = call i32 @llvm.r600.read.tgid.y() #0 @@ -151,9 +166,9 @@ entry: ret void } -; SI-CHECK: @tgid_z -; SI-CHECK: V_MOV_B32_e32 [[VVAL:v[0-9]+]], s4 -; SI-CHECK: BUFFER_STORE_DWORD [[VVAL]] +; FUNC-LABEL: {{^}}tgid_z: +; SI: v_mov_b32_e32 [[VVAL:v[0-9]+]], s6 +; SI: buffer_store_dword [[VVAL]] define void @tgid_z (i32 addrspace(1)* %out) { entry: %0 = call i32 @llvm.r600.read.tgid.z() #0 @@ -161,8 +176,8 @@ entry: ret void } -; SI-CHECK: @tidig_x -; SI-CHECK: BUFFER_STORE_DWORD v0 +; FUNC-LABEL: {{^}}tidig_x: +; SI: buffer_store_dword v0 define void @tidig_x (i32 addrspace(1)* %out) { entry: %0 = call i32 @llvm.r600.read.tidig.x() #0 @@ -170,8 +185,8 @@ entry: ret void } -; SI-CHECK: @tidig_y -; SI-CHECK: BUFFER_STORE_DWORD v1 +; FUNC-LABEL: {{^}}tidig_y: +; SI: buffer_store_dword v1 define void @tidig_y (i32 addrspace(1)* %out) { entry: %0 = call i32 @llvm.r600.read.tidig.y() #0 @@ -179,8 +194,8 @@ entry: ret void } -; SI-CHECK: @tidig_z -; SI-CHECK: BUFFER_STORE_DWORD v2 +; FUNC-LABEL: {{^}}tidig_z: +; SI: buffer_store_dword v2 define void @tidig_z (i32 addrspace(1)* %out) { entry: %0 = call i32 @llvm.r600.read.tidig.z() #0 @@ -208,4 +223,6 @@ declare i32 @llvm.r600.read.tidig.x() #0 declare i32 @llvm.r600.read.tidig.y() #0 declare i32 @llvm.r600.read.tidig.z() #0 +declare i32 @llvm.AMDGPU.read.workdim() #0 + attributes #0 = { readnone } |