Recommit r310809 with a fix for the spill problem
[llvm-core.git] / test / CodeGen / AMDGPU / llvm.amdgcn.image.getlod.ll
blob2e78e2a4c6f57dac8eaee1e9fa88f06e430a6947
1 ; RUN: llc < %s -march=amdgcn -mcpu=verde -verify-machineinstrs | FileCheck --check-prefix=GCN %s
2 ; RUN: llc < %s -march=amdgcn -mcpu=tonga -verify-machineinstrs | FileCheck --check-prefix=GCN %s
4 ; GCN-LABEL: {{^}}getlod:
5 ; GCN: image_get_lod {{v\[[0-9]+:[0-9]+\]}}, {{v[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}} dmask:0xf da
6 define amdgpu_kernel void @getlod(<4 x float> addrspace(1)* %out) {
7 main_body:
8   %r = call <4 x float> @llvm.amdgcn.image.getlod.v4f32.f32.v8i32(float undef, <8 x i32> undef, <4 x i32> undef, i32 15, i1 0, i1 0, i1 0, i1 0, i1 1)
9   store <4 x float> %r, <4 x float> addrspace(1)* %out
10   ret void
13 ; GCN-LABEL: {{^}}getlod_v2:
14 ; GCN: image_get_lod {{v\[[0-9]+:[0-9]+\]}}, {{v\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}} dmask:0xf da
15 define amdgpu_kernel void @getlod_v2(<4 x float> addrspace(1)* %out) {
16 main_body:
17   %r = call <4 x float> @llvm.amdgcn.image.getlod.v4f32.v2f32.v8i32(<2 x float> undef, <8 x i32> undef, <4 x i32> undef, i32 15, i1 0, i1 0, i1 0, i1 0, i1 1)
18   store <4 x float> %r, <4 x float> addrspace(1)* %out
19   ret void
22 ; GCN-LABEL: {{^}}getlod_v4:
23 ; GCN: image_get_lod {{v\[[0-9]+:[0-9]+\]}}, {{v\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}} dmask:0xf da
24 define amdgpu_kernel void @getlod_v4(<4 x float> addrspace(1)* %out) {
25 main_body:
26   %r = call <4 x float> @llvm.amdgcn.image.getlod.v4f32.v4f32.v8i32(<4 x float> undef, <8 x i32> undef, <4 x i32> undef, i32 15, i1 0, i1 0, i1 0, i1 0, i1 1)
27   store <4 x float> %r, <4 x float> addrspace(1)* %out
28   ret void
31 ; GCN-LABEL: {{^}}adjust_writemask_getlod_none_enabled:
32 ; GCN-NOT: image
33 ; GCN-NOT: store
34 define amdgpu_kernel void @adjust_writemask_getlod_none_enabled(float addrspace(1)* %out) {
35 main_body:
36   %r = call <4 x float> @llvm.amdgcn.image.getlod.v4f32.v4f32.v8i32(<4 x float> undef, <8 x i32> undef, <4 x i32> undef, i32 0, i1 false, i1 false, i1 false, i1 false, i1 false)
37   %elt0 = extractelement <4 x float> %r, i32 0
38   store float %elt0, float addrspace(1)* %out
39   ret void
42 declare <4 x float> @llvm.amdgcn.image.getlod.v4f32.f32.v8i32(float, <8 x i32>, <4 x i32>, i32, i1, i1, i1, i1, i1) #0
43 declare <4 x float> @llvm.amdgcn.image.getlod.v4f32.v2f32.v8i32(<2 x float>, <8 x i32>, <4 x i32>, i32, i1, i1, i1, i1, i1) #0
44 declare <4 x float> @llvm.amdgcn.image.getlod.v4f32.v4f32.v8i32(<4 x float>, <8 x i32>, <4 x i32>, i32, i1, i1, i1, i1, i1) #0
47 attributes #0 = { nounwind readnone }