| 1 |
; RUN: llvm-as %s -o %t.bc |
| 2 |
; RUN: llvm-spirv %t.bc -spirv-text -o %t.txt |
| 3 |
; RUN: FileCheck < %t.txt %s --check-prefix=CHECK-SPIRV |
| 4 |
; RUN: llvm-spirv %t.bc -o %t.spv |
| 5 |
; RUN: spirv-val %t.spv |
| 6 |
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o %t.rev.bc |
| 7 |
; RUN: llvm-dis < %t.rev.bc | FileCheck %s --check-prefix=CHECK-LLVM |
| 8 |
|
| 9 |
; The OpDot operands must be vectors; check that translating dot with |
| 10 |
; scalar arguments does not result in OpDot. |
| 11 |
; CHECK-SPIRV-LABEL: 5 Function |
| 12 |
; CHECK-SPIRV: 5 FMul |
| 13 |
; CHECK-SPIRV-NOT: Dot |
| 14 |
; CHECK-SPIRV: FunctionEnd |
| 15 |
|
| 16 |
; CHECK-LLVM-LABEL: @testScalar |
| 17 |
; CHECK-LLVM: fmul |
| 18 |
|
| 19 |
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" |
| 20 |
target triple = "spir-unknown-unknown" |
| 21 |
|
| 22 |
; Function Attrs: nounwind |
| 23 |
define spir_kernel void @testScalar(float %f) #0 !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !3 !kernel_arg_base_type !4 !kernel_arg_type_qual !5 { |
| 24 |
entry: |
| 25 |
%call = tail call spir_func float @_Z3dotff(float %f, float %f) #2 |
| 26 |
ret void |
| 27 |
} |
| 28 |
|
| 29 |
; CHECK-SPIRV-LABEL: 5 Function |
| 30 |
; CHECK-SPIRV: Dot |
| 31 |
; CHECK-SPIRV: FunctionEnd |
| 32 |
|
| 33 |
; CHECK-LLVM-LABEL: @testVector |
| 34 |
; CHECK-LLVM: call spir_func float @_Z3dotDv2_fS_( |
| 35 |
|
| 36 |
; Function Attrs: nounwind |
| 37 |
define spir_kernel void @testVector(<2 x float> %f) #0 !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !3 !kernel_arg_base_type !4 !kernel_arg_type_qual !5 { |
| 38 |
entry: |
| 39 |
%call = tail call spir_func float @_Z3dotDv2_fS_(<2 x float> %f, <2 x float> %f) #2 |
| 40 |
ret void |
| 41 |
} |
| 42 |
|
| 43 |
declare spir_func float @_Z3dotff(float, float) #1 |
| 44 |
|
| 45 |
declare spir_func float @_Z3dotDv2_fS_(<2 x float>, <2 x float>) #1 |
| 46 |
|
| 47 |
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" } |
| 48 |
attributes #1 = { "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" } |
| 49 |
attributes #2 = { nounwind } |
| 50 |
|
| 51 |
!opencl.enable.FP_CONTRACT = !{} |
| 52 |
!opencl.spir.version = !{!6} |
| 53 |
!opencl.ocl.version = !{!7} |
| 54 |
!opencl.used.extensions = !{!8} |
| 55 |
!opencl.used.optional.core.features = !{!8} |
| 56 |
!opencl.compiler.options = !{!8} |
| 57 |
|
| 58 |
!1 = !{i32 0} |
| 59 |
!2 = !{!"none"} |
| 60 |
!3 = !{!"float"} |
| 61 |
!4 = !{!"float"} |
| 62 |
!5 = !{!""} |
| 63 |
!6 = !{i32 1, i32 2} |
| 64 |
!7 = !{i32 2, i32 0} |
| 65 |
!8 = !{} |