1; ModuleID = '/nfs/site/home/aelizuno/tmp/conversions.bc' 2target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024" 3target triple = "spir64-unknown-unknown" 4 5; RUN: llvm-as %s -o %t.bc 6; RUN: llvm-spirv %t.bc -o %t.spv 7; RUN: llvm-spirv -r %t.spv -o %t.bc 8; RUN: llvm-dis < %t.bc | FileCheck %s 9 10; Check vector conversions w\o decorations are translated back to calls 11; to OCL built-ins. 12 13; CHECK: call spir_func <8 x i16> @_Z14convert_short8Dv8_c(<8 x i8> 14; CHECK: call spir_func <8 x i32> @_Z12convert_int8Dv8_t(<8 x i16> 15; CHECK: call spir_func <8 x i8> @_Z13convert_char8Dv8_i(<8 x i32> 16; CHECK: call spir_func <8 x double> @_Z15convert_double8Dv8_c(<8 x i8> 17; CHECK: call spir_func <8 x float> @_Z14convert_float8Dv8_d(<8 x double> 18; CHECK: call spir_func <8 x double> @_Z15convert_double8Dv8_f(<8 x float> 19; CHECK: call spir_func <8 x i32> @_Z13convert_uint8Dv8_d(<8 x double> 20; CHECK: call spir_func <8 x float> @_Z14convert_float8Dv8_j(<8 x i32> 21; CHECK: call spir_func <8 x i32> @_Z12convert_int8Dv8_f(<8 x float> 22 23; Function Attrs: nounwind 24define spir_kernel void @test_default_conversions(<8 x double> addrspace(1)* nocapture %out, <8 x i8> %in) #0 { 25 %1 = tail call spir_func <8 x i16> @_Z15convert_ushort8Dv8_c(<8 x i8> %in) #1 26 %2 = tail call spir_func <8 x i32> @_Z12convert_int8Dv8_t(<8 x i16> %1) #1 27 %3 = tail call spir_func <8 x i8> @_Z13convert_char8Dv8_i(<8 x i32> %2) #1 28 %4 = tail call spir_func <8 x double> @_Z15convert_double8Dv8_c(<8 x i8> %3) #1 29 %5 = tail call spir_func <8 x float> @_Z14convert_float8Dv8_d(<8 x double> %4) #1 30 %6 = tail call spir_func <8 x double> @_Z15convert_double8Dv8_f(<8 x float> %5) #1 31 %7 = tail call spir_func <8 x i32> @_Z13convert_uint8Dv8_d(<8 x double> %6) #1 32 %8 = tail call spir_func <8 x float> @_Z14convert_float8Dv8_j(<8 x i32> %7) #1 33 %9 = tail call spir_func <8 x i32> @_Z12convert_int8Dv8_f(<8 x float> %8) #1 34 %10 = tail call spir_func <8 x double> @_Z15convert_double8Dv8_i(<8 x i32> %9) #1 35 store <8 x double> %10, <8 x double> addrspace(1)* %out, align 64, !tbaa !9 36 ret void 37} 38 39; Function Attrs: nounwind readnone 40declare spir_func <8 x i16> @_Z15convert_ushort8Dv8_c(<8 x i8>) #1 41 42; Function Attrs: nounwind readnone 43declare spir_func <8 x i32> @_Z12convert_int8Dv8_t(<8 x i16>) #1 44 45; Function Attrs: nounwind readnone 46declare spir_func <8 x i8> @_Z13convert_char8Dv8_i(<8 x i32>) #1 47 48; Function Attrs: nounwind readnone 49declare spir_func <8 x double> @_Z15convert_double8Dv8_c(<8 x i8>) #1 50 51; Function Attrs: nounwind readnone 52declare spir_func <8 x float> @_Z14convert_float8Dv8_d(<8 x double>) #1 53 54; Function Attrs: nounwind readnone 55declare spir_func <8 x double> @_Z15convert_double8Dv8_f(<8 x float>) #1 56 57; Function Attrs: nounwind readnone 58declare spir_func <8 x i32> @_Z13convert_uint8Dv8_d(<8 x double>) #1 59 60; Function Attrs: nounwind readnone 61declare spir_func <8 x float> @_Z14convert_float8Dv8_j(<8 x i32>) #1 62 63; Function Attrs: nounwind readnone 64declare spir_func <8 x i32> @_Z12convert_int8Dv8_f(<8 x float>) #1 65 66; Function Attrs: nounwind readnone 67declare spir_func <8 x double> @_Z15convert_double8Dv8_i(<8 x i32>) #1 68 69attributes #0 = { nounwind } 70attributes #1 = { nounwind readnone } 71 72!opencl.kernels = !{!0} 73!opencl.enable.FP_CONTRACT = !{} 74!opencl.spir.version = !{!6} 75!opencl.ocl.version = !{!6} 76!opencl.used.extensions = !{!7} 77!opencl.used.optional.core.features = !{!8} 78!opencl.compiler.options = !{!7} 79 80!0 = !{void (<8 x double> addrspace(1)*, <8 x i8>)* @test_default_conversions, !1, !2, !3, !4, !5} 81!1 = !{!"kernel_arg_addr_space", i32 1, i32 0} 82!2 = !{!"kernel_arg_access_qual", !"none", !"none"} 83!3 = !{!"kernel_arg_type", !"double8*", !"char8"} 84!4 = !{!"kernel_arg_type_qual", !"", !""} 85!5 = !{!"kernel_arg_base_type", !"double8*", !"char8"} 86!6 = !{i32 1, i32 2} 87!7 = !{} 88!8 = !{!"cl_doubles"} 89!9 = !{!10, !10, i64 0} 90!10 = !{!"omnipotent char", !11} 91!11 = !{!"Simple C/C++ TBAA"} 92