Debian Codegraph @

IGC/ocloc_tests/SPIRV-extenstions/SPV_INTEL_masked_gather_scatter/intel-gather-scatter.ll

raw
1 ; UNSUPPORTED: system-windows
2 ; REQUIRES: llvm-spirv, regkeys, dg2-supported
3
4 ; RUN: llvm-as %s -o %t.bc
5 ; RUN: llvm-spirv %t.bc --spirv-ext=+SPV_INTEL_masked_gather_scatter -o %t.spv
6 ; RUN: ocloc compile -spirv_input -file %t.spv -device dg2 -options " -igc_opts 'ShaderDumpTranslationOnly=1'" 2>&1 | FileCheck %s --check-prefixes=CHECK-LLVM
7
8 ; CHECK-LLVM: %[[#VECGATHER:]] = load <4 x i32 addrspace(4)*>, <4 x i32 addrspace(4)*>*
9 ; CHECK-LLVM: %[[#VECSCATTER:]] = load <4 x i32 addrspace(4)*>, <4 x i32 addrspace(4)*>*
10 ; CHECK-LLVM: %[[GATHER:[a-z0-9]+]] = call <4 x i32> @llvm.masked.gather.v4i32.v4p4i32(<4 x i32 addrspace(4)*> %[[#VECGATHER]], i32 4, <4 x i1> <i1 true, i1 false, i1 true, i1 true>, <4 x i32> <i32 4, i32 0, i32 1, i32 0>)
11 ; CHECK-LLVM: call void @llvm.masked.scatter.v4i32.v4p4i32(<4 x i32> %[[GATHER]], <4 x i32 addrspace(4)*> %[[#VECSCATTER]], i32 4, <4 x i1> <i1 true, i1 true, i1 true, i1 true>)
12
13 ; CHECK-LLVM-DAG: declare <4 x i32> @llvm.masked.gather.v4i32.v4p4i32(<4 x i32 addrspace(4)*>{{.*}}, i32 immarg{{.*}}, <4 x i1>{{.*}}, <4 x i32>{{.*}})
14 ; CHECK-LLVM-DAG: declare void @llvm.masked.scatter.v4i32.v4p4i32(<4 x i32>{{.*}}, <4 x i32 addrspace(4)*>{{.*}}, i32 immarg{{.*}}, <4 x i1>{{.*}})
15
16 target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"
17 target triple = "spir"
18
19 ; Function Attrs: nounwind readnone
20 define spir_kernel void @foo() {
21 entry:
22 %arg0 = alloca <4 x i32 addrspace(4)*>
23 %arg1 = alloca <4 x i32 addrspace(4)*>
24 %0 = load <4 x i32 addrspace(4)*>, <4 x i32 addrspace(4)*>* %arg0
25 %1 = load <4 x i32 addrspace(4)*>, <4 x i32 addrspace(4)*>* %arg1
26 %res = call <4 x i32> @llvm.masked.gather.v4i32.v4p4i32(<4 x i32 addrspace(4)*> %0, i32 4, <4 x i1> <i1 true, i1 false, i1 true, i1 true>, <4 x i32> <i32 4, i32 0, i32 1, i32 0>)
27 call void @llvm.masked.scatter.v4i32.v4p4i32(<4 x i32> %res, <4 x i32 addrspace(4)*> %1, i32 4, <4 x i1> <i1 true, i1 true, i1 true, i1 true>)
28 ret void
29 }
30
31 declare <4 x i32> @llvm.masked.gather.v4i32.v4p4i32(<4 x i32 addrspace(4)*>, i32, <4 x i1>, <4 x i32>)
32
33 declare void @llvm.masked.scatter.v4i32.v4p4i32(<4 x i32>, <4 x i32 addrspace(4)*>, i32, <4 x i1>)
34
35 !llvm.module.flags = !{!0}
36 !opencl.spir.version = !{!1}
37
38 !0 = !{i32 1, !"wchar_size", i32 4}
39 !1 = !{i32 1, i32 2}