| 1 |
; RUN: llvm-as %s -o %t.bc |
| 2 |
; RUN: llvm-spirv %t.bc -o %t.spv |
| 3 |
; RUN: llvm-spirv %t.spv -to-text -o %t.spt |
| 4 |
; RUN: FileCheck < %t.spt %s --check-prefix=CHECK-SPIRV |
| 5 |
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o %t.rev.bc |
| 6 |
; RUN: llvm-dis %t.rev.bc |
| 7 |
; RUN: FileCheck < %t.rev.ll %s --check-prefix=CHECK-LLVM |
| 8 |
|
| 9 |
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64" |
| 10 |
target triple = "spir64" |
| 11 |
|
| 12 |
define linkonce_odr hidden spir_func void @foo() { |
| 13 |
entry: |
| 14 |
|
| 15 |
; CHECK-SPIRV: Constant [[#]] [[#CONSTANT1:]] 65793 |
| 16 |
|
| 17 |
; 81 is OpCompositeExtract opcode |
| 18 |
; CHECK-SPIRV: SpecConstantOp [[#]] [[#MEMBER1_EXTRACT1:]] 81 [[#MEMBER1_EXTRACT1_BITCAST:]] 0 |
| 19 |
; CHECK-SPIRV: Constant [[#]] [[#CONSTANT2:]] 131586 |
| 20 |
; CHECK-SPIRV: SpecConstantOp [[#]] [[#MEMBER1_EXTRACT2:]] 81 [[#MEMBER1_EXTRACT2_BITCAST:]] 0 |
| 21 |
; 128 is OpIAdd opcode |
| 22 |
; CHECK-SPIRV: SpecConstantOp [[#]] [[#MEMBER_1:]] 128 [[#MEMBER1_EXTRACT1]] [[#MEMBER1_EXTRACT2]] |
| 23 |
|
| 24 |
; CHECK-SPIRV: SpecConstantOp [[#]] [[#MEMBER2_EXTRACT1:]] 81 [[#MEMBER1_EXTRACT1_BITCAST]] 1 |
| 25 |
; CHECK-SPIRV: SpecConstantOp [[#]] [[#MEMBER2_EXTRACT2:]] 81 [[#MEMBER1_EXTRACT2_BITCAST]] 1 |
| 26 |
; CHECK-SPIRV: SpecConstantOp [[#]] [[#MEMBER_2:]] 128 [[#MEMBER2_EXTRACT1]] [[#MEMBER2_EXTRACT2]] |
| 27 |
|
| 28 |
; CHECK-SPIRV: SpecConstantOp [[#]] [[#MEMBER3_EXTRACT1:]] 81 [[#MEMBER1_EXTRACT1_BITCAST]] 2 |
| 29 |
; CHECK-SPIRV: SpecConstantOp [[#]] [[#MEMBER3_EXTRACT2:]] 81 [[#MEMBER1_EXTRACT2_BITCAST]] 2 |
| 30 |
; CHECK-SPIRV: SpecConstantOp [[#]] [[#MEMBER_3:]] 128 [[#MEMBER3_EXTRACT1]] [[#MEMBER3_EXTRACT2]] |
| 31 |
; CHECK-SPIRV: Undef [[#]] [[#MEMBER_4:]] |
| 32 |
|
| 33 |
; CHECK-SPIRV: ConstantComposite [[#]] [[#COMPOS1:]] [[#CONSTANT1]] [[#CONSTANT1]] |
| 34 |
; 124 is OpBitcast opcode |
| 35 |
; CHECK-SPIRV: SpecConstantOp [[#]] [[#MEMBER1_EXTRACT1_BITCAST]] 124 [[#COMPOS1]] |
| 36 |
|
| 37 |
; CHECK-SPIRV: ConstantComposite [[#]] [[#COMPOS2:]] [[#CONSTANT2]] [[#CONSTANT2]] |
| 38 |
; CHECK-SPIRV: SpecConstantOp [[#]] [[#MEMBER1_EXTRACT2_BITCAST]] 124 [[#COMPOS2]] |
| 39 |
|
| 40 |
; CHECK-SPIRV: ConstantComposite [[#]] [[#FINAL_COMPOS:]] [[#MEMBER_1]] [[#MEMBER_2]] [[#MEMBER_3]] [[#MEMBER_4]] |
| 41 |
; CHECK-SPIRV: DebugValue [[#]] [[#FINAL_COMPOS]] |
| 42 |
|
| 43 |
|
| 44 |
; CHECK-LLVM: call void @llvm.dbg.value( |
| 45 |
; CHECK-LLVM-SAME: metadata <4 x i8> < |
| 46 |
; CHECK-LLVM-SAME: i8 add ( |
| 47 |
; CHECK-LLVM-SAME: i8 extractelement (<8 x i8> bitcast (<2 x i32> <i32 65793, i32 65793> to <8 x i8>), i32 0), |
| 48 |
; CHECK-LLVM-SAME: i8 extractelement (<8 x i8> bitcast (<2 x i32> <i32 131586, i32 131586> to <8 x i8>), i32 0)), |
| 49 |
; CHECK-LLVM-SAME: i8 add ( |
| 50 |
; CHECK-LLVM-SAME: i8 extractelement (<8 x i8> bitcast (<2 x i32> <i32 65793, i32 65793> to <8 x i8>), i32 1), |
| 51 |
; CHECK-LLVM-SAME: i8 extractelement (<8 x i8> bitcast (<2 x i32> <i32 131586, i32 131586> to <8 x i8>), i32 1)), |
| 52 |
; CHECK-LLVM-SAME: i8 add ( |
| 53 |
; CHECK-LLVM-SAME: i8 extractelement (<8 x i8> bitcast (<2 x i32> <i32 65793, i32 65793> to <8 x i8>), i32 2), |
| 54 |
; CHECK-LLVM-SAME: i8 extractelement (<8 x i8> bitcast (<2 x i32> <i32 131586, i32 131586> to <8 x i8>), i32 2)), |
| 55 |
; CHECK-LLVM-SAME: i8 undef>, |
| 56 |
; CHECK-LLVM-SAME: metadata ![[#]], metadata !DIExpression()), !dbg ![[#]] |
| 57 |
call void @llvm.dbg.value( |
| 58 |
metadata <4 x i8> < |
| 59 |
i8 add ( |
| 60 |
i8 extractelement (<8 x i8> bitcast (<2 x i32> <i32 65793, i32 65793> to <8 x i8>), i32 0), |
| 61 |
i8 extractelement (<8 x i8> bitcast (<2 x i32> <i32 131586, i32 131586> to <8 x i8>), i32 0)), |
| 62 |
i8 add ( |
| 63 |
i8 extractelement (<8 x i8> bitcast (<2 x i32> <i32 65793, i32 65793> to <8 x i8>), i32 1), |
| 64 |
i8 extractelement (<8 x i8> bitcast (<2 x i32> <i32 131586, i32 131586> to <8 x i8>), i32 1)), |
| 65 |
i8 add ( |
| 66 |
i8 extractelement (<8 x i8> bitcast (<2 x i32> <i32 65793, i32 65793> to <8 x i8>), i32 2), |
| 67 |
i8 extractelement (<8 x i8> bitcast (<2 x i32> <i32 131586, i32 131586> to <8 x i8>), i32 2)), |
| 68 |
i8 undef>, |
| 69 |
metadata !12, metadata !DIExpression()), !dbg !7 |
| 70 |
ret void |
| 71 |
} |
| 72 |
|
| 73 |
; Function Attrs: nofree nosync nounwind readnone speculatable willreturn |
| 74 |
declare void @llvm.dbg.value(metadata, metadata, metadata) |
| 75 |
|
| 76 |
!llvm.dbg.cu = !{!0} |
| 77 |
!llvm.module.flags = !{!3, !4} |
| 78 |
!opencl.used.extensions = !{!2} |
| 79 |
!opencl.used.optional.core.features = !{!2} |
| 80 |
!opencl.compiler.options = !{!2} |
| 81 |
!llvm.ident = !{!5} |
| 82 |
|
| 83 |
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 13.0.0 (https://github.com/intel/llvm.git)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None) |
| 84 |
!1 = !DIFile(filename: "main.cpp", directory: "/export/users") |
| 85 |
!2 = !{} |
| 86 |
!3 = !{i32 2, !"Debug Info Version", i32 3} |
| 87 |
!4 = !{i32 1, !"wchar_size", i32 4} |
| 88 |
!5 = !{!"clang version 13.0.0"} |
| 89 |
!6 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 1, type: !8, scopeLine: 4, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2) |
| 90 |
!7 = !DILocation(line: 1, scope: !6, inlinedAt: !11) |
| 91 |
!8 = !DISubroutineType(types: !9) |
| 92 |
!9 = !{!10} |
| 93 |
!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) |
| 94 |
!11 = !DILocation(line: 1, column: 0, scope: !6) |
| 95 |
!12 = !DILocalVariable(name: "resVec", scope: !6, file: !1, line: 1, type: !13) |
| 96 |
!13 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "vec<cl::sycl::detail::half_impl::half, 3>", scope: !6, file: !1, line: 1, size: 64, flags: DIFlagTypePassByValue, elements: !2) |