|
| 1 | +; This test verifies that the Vector16 capability is correctly added |
| 2 | +; if an OpenCL kernel uses a vector of eight elements. |
| 3 | +; |
| 4 | +;Source: |
| 5 | +;__kernel void test( int8 v ) {} |
| 6 | + |
| 7 | +; RUN: llvm-as %s -o %t.bc |
| 8 | +; RUN: llvm-spirv %t.bc -o - -spirv-text | FileCheck %s --check-prefix=CHECK-SPIRV |
| 9 | +; RUN: llvm-spirv %t.bc -o %t.spv |
| 10 | +; RUN: llvm-spirv -r %t.spv -o %t.rev.bc |
| 11 | +; RUN: llvm-dis < %t.rev.bc | FileCheck %s --check-prefix=CHECK-LLVM |
| 12 | + |
| 13 | +; CHECK-SPIRV: Capability Vector16 |
| 14 | + |
| 15 | +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-n8:16:32:64" |
| 16 | +target triple = "spir" |
| 17 | + |
| 18 | +; Function Attrs: nounwind |
| 19 | +define spir_kernel void @test(<8 x i32> %v) #0 { |
| 20 | +; CHECK-LLVM: <8 x i32> |
| 21 | + %1 = alloca <8 x i32>, align 32 |
| 22 | + store <8 x i32> %v, <8 x i32>* %1, align 32 |
| 23 | + ret void |
| 24 | +} |
| 25 | + |
| 26 | +attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } |
| 27 | + |
| 28 | +!opencl.kernels = !{!0} |
| 29 | +!opencl.enable.FP_CONTRACT = !{} |
| 30 | +!opencl.spir.version = !{!6} |
| 31 | +!opencl.ocl.version = !{!6} |
| 32 | +!opencl.used.extensions = !{!7} |
| 33 | +!opencl.used.optional.core.features = !{!7} |
| 34 | +!opencl.compiler.options = !{!7} |
| 35 | +!llvm.ident = !{!8} |
| 36 | + |
| 37 | +!0 = !{void (<8 x i32>)* @test, !1, !2, !3, !4, !5} |
| 38 | +!1 = !{!"kernel_arg_addr_space", i32 0} |
| 39 | +!2 = !{!"kernel_arg_access_qual", !"none"} |
| 40 | +!3 = !{!"kernel_arg_type", !"int8"} |
| 41 | +!4 = !{!"kernel_arg_base_type", !"int8"} |
| 42 | +!5 = !{!"kernel_arg_type_qual", !""} |
| 43 | +!6 = !{i32 1, i32 2} |
| 44 | +!7 = !{} |
| 45 | +!8 = !{!"clang version 3.6.1 (https://github.com/KhronosGroup/SPIR 2b577882b436ba3133457f27e0aa999f2ac8b11c) (https://github.com/KhronosGroup/SPIRV-LLVM.git 44ec76519179879c7900a5da4e724c751ce516a9)"} |
0 commit comments