1 ; RUN: llc -march=r600 -mcpu=juniper < %s | FileCheck -check-prefix=EG -check-prefix=FUNC %s
3 ; FUNC-LABEL: {{^}}test_0:
4 ; EG: MEM_RAT_CACHELESS STORE_RAW [[VAL:T[0-9]+\.X]]
5 ; EG: MOV [[VAL]], literal.x
8 define amdgpu_kernel void @test_0(i32 %in0, i32 addrspace(1)* %out) {
10 %0 = call i32 @llvm.OpenCL.sampler.get.resource.id(i32 %in0) #0
11 store i32 %0, i32 addrspace(1)* %out
15 ; FUNC-LABEL: {{^}}test_1:
16 ; EG: MEM_RAT_CACHELESS STORE_RAW [[VAL:T[0-9]+\.X]]
17 ; EG: MOV [[VAL]], literal.x
20 define amdgpu_kernel void @test_1(i32 %in0, i32 %in1, i32 addrspace(1)* %out) {
22 %0 = call i32 @llvm.OpenCL.sampler.get.resource.id(i32 %in1) #0
23 store i32 %0, i32 addrspace(1)* %out
27 ; FUNC-LABEL: {{^}}test_2:
28 ; EG: MEM_RAT_CACHELESS STORE_RAW [[VAL:T[0-9]+\.X]]
29 ; EG: MOV [[VAL]], literal.x
32 define amdgpu_kernel void @test_2(i32 %in0, i32 %in1, i32 %in2, i32 addrspace(1)* %out) {
34 %0 = call i32 @llvm.OpenCL.sampler.get.resource.id(i32 %in2) #0
35 store i32 %0, i32 addrspace(1)* %out
40 declare i32 @llvm.OpenCL.sampler.get.resource.id(i32) #0
42 attributes #0 = { readnone }
44 !opencl.kernels = !{!0, !1, !2}
46 !0 = !{void (i32, i32 addrspace(1)*)* @test_0, !10, !20, !30, !40, !50}
47 !10 = !{!"kernel_arg_addr_space", i32 0, i32 1}
48 !20 = !{!"kernel_arg_access_qual", !"none", !"none"}
49 !30 = !{!"kernel_arg_type", !"sampler_t", !"int*"}
50 !40 = !{!"kernel_arg_base_type", !"sampler_t", !"int*"}
51 !50 = !{!"kernel_arg_type_qual", !"", !""}
53 !1 = !{void (i32, i32, i32 addrspace(1)*)* @test_1, !11, !21, !31, !41, !51}
54 !11 = !{!"kernel_arg_addr_space", i32 0, i32 0, i32 1}
55 !21 = !{!"kernel_arg_access_qual", !"none", !"none", !"none"}
56 !31 = !{!"kernel_arg_type", !"sampler_t", !"sampler_t", !"int*"}
57 !41 = !{!"kernel_arg_base_type", !"sampler_t", !"sampler_t", !"int*"}
58 !51 = !{!"kernel_arg_type_qual", !"", !"", !""}
60 !2 = !{void (i32, i32, i32, i32 addrspace(1)*)* @test_2, !12, !22, !32, !42, !52}
61 !12 = !{!"kernel_arg_addr_space", i32 0, i32 0, i32 0, i32 1}
62 !22 = !{!"kernel_arg_access_qual", !"none", !"none", !"none", !"none"}
63 !32 = !{!"kernel_arg_type", !"sampler_t", !"sampler_t", !"sampler_t", !"int*"}
64 !42 = !{!"kernel_arg_base_type", !"sampler_t", !"sampler_t", !"sampler_t", !"int*"}
65 !52 = !{!"kernel_arg_type_qual", !"", !"", !"", !""}