| 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: alloca <4 x i8 addrspace(4)*> |
| 9 |
; CHECK-LLVM-NEXT: alloca <4 x i8 addrspace(4)*> |
| 10 |
; CHECK-LLVM-NEXT: load <4 x i8 addrspace(4)*>, <4 x i8 addrspace(4)*>* |
| 11 |
; CHECK-LLVM-NEXT: store <4 x i8 addrspace(4)*> %[[#]], <4 x i8 addrspace(4)*>* |
| 12 |
; CHECK-LLVM-NEXT: bitcast <4 x i8 addrspace(4)*> %[[#]] to <4 x i32 addrspace(4)*> |
| 13 |
; CHECK-LLVM-NEXT: addrspacecast <4 x i32 addrspace(4)*> %{{.*}} to <4 x i32 addrspace(1)*> |
| 14 |
; CHECK-LLVM-NEXT: call spir_func <4 x i32 addrspace(1)*> @boo(<4 x i32 addrspace(1)*> |
| 15 |
; CHECK-LLVM-NEXT: getelementptr inbounds i32, <4 x i32 addrspace(1)*> %{{.*}}, i32 1 |
| 16 |
|
| 17 |
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" |
| 18 |
target triple = "spir" |
| 19 |
|
| 20 |
; Function Attrs: nounwind readnone |
| 21 |
define spir_kernel void @foo() { |
| 22 |
entry: |
| 23 |
%arg1 = alloca <4 x i8 addrspace(4)*> |
| 24 |
%arg2 = alloca <4 x i8 addrspace(4)*> |
| 25 |
%0 = load <4 x i8 addrspace(4)*>, <4 x i8 addrspace(4)*>* %arg1 |
| 26 |
store <4 x i8 addrspace(4)*> %0, <4 x i8 addrspace(4)*>* %arg2 |
| 27 |
%tmp1 = bitcast <4 x i8 addrspace(4)*> %0 to <4 x i32 addrspace(4)*> |
| 28 |
%tmp2 = addrspacecast <4 x i32 addrspace(4)*> %tmp1 to <4 x i32 addrspace(1)*> |
| 29 |
%tmp3 = call <4 x i32 addrspace(1)*> @boo(<4 x i32 addrspace(1)*> %tmp2) |
| 30 |
%tmp4 = getelementptr inbounds i32, <4 x i32 addrspace(1)*> %tmp3, i32 1 |
| 31 |
%tmp5 = addrspacecast <4 x i32 addrspace(4)*> %tmp1 to <4 x i8 addrspace(1)*> |
| 32 |
ret void |
| 33 |
} |
| 34 |
|
| 35 |
declare <4 x i32 addrspace(1)*> @boo(<4 x i32 addrspace(1)*> %a) |
| 36 |
|
| 37 |
!llvm.module.flags = !{!0} |
| 38 |
!opencl.spir.version = !{!1} |
| 39 |
|
| 40 |
!0 = !{i32 1, !"wchar_size", i32 4} |
| 41 |
!1 = !{i32 1, i32 2} |