File: bitcast.ll

package info (click to toggle)
intel-graphics-compiler 1.0.12504.6-1%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 83,912 kB
  • sloc: cpp: 910,147; lisp: 202,655; ansic: 15,197; python: 4,025; yacc: 2,241; lex: 1,570; pascal: 244; sh: 104; makefile: 25
file content (187 lines) | stat: -rw-r--r-- 11,765 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
;=========================== begin_copyright_notice ============================
;
; Copyright (C) 2022 Intel Corporation
;
; SPDX-License-Identifier: MIT
;
;============================ end_copyright_notice =============================
;
; RUN: igc_opt -GenOptLegalizer -S < %s | FileCheck %s
; ------------------------------------------------
; GenOptLegalizer
; ------------------------------------------------
; This test checks that GenOptLegalizer pass follows
; 'How to Update Debug Info' llvm guideline.
;
; Debug MD for this test was created with debugify pass.
; ------------------------------------------------

; CHECK: define void @test{{.*}} !dbg [[SCOPE:![0-9]*]]
; CHECK-DAG: store half [[VAL3_V:%[A-z0-9]*]], {{.*}}, !dbg [[STR1_LOC:![0-9]*]]
; CHECK-DAG: void @llvm.dbg.value(metadata half [[VAL3_V]], metadata [[VAL3_MD:![0-9]*]], metadata !DIExpression()), !dbg [[VAL3_LOC:![0-9]*]]
; CHECK-DAG: [[VAL3_V]] = {{.*}}, !dbg [[VAL3_LOC]]
; CHECK-DAG: store half [[VAL7_V:%[A-z0-9]*]], {{.*}}, !dbg [[STR2_LOC:![0-9]*]]
; CHECK-DAG: void @llvm.dbg.value(metadata half [[VAL7_V]], metadata [[VAL7_MD:![0-9]*]], metadata !DIExpression()), !dbg [[VAL7_LOC:![0-9]*]]
; CHECK-DAG: [[VAL7_V]] = {{.*}}, !dbg [[VAL7_LOC]]
; CHECK-DAG: store float [[VAL11_V:%[A-z0-9]*]], {{.*}}, !dbg [[STR3_LOC:![0-9]*]]
; CHECK-DAG: store float [[VAL12_V:%[A-z0-9]*]], {{.*}}, !dbg [[STR4_LOC:![0-9]*]]
; CHECK-DAG: store float [[VAL13_V:%[A-z0-9]*]], {{.*}}, !dbg [[STR5_LOC:![0-9]*]]
; CHECK-DAG: void @llvm.dbg.value(metadata float [[VAL11_V]], metadata [[VAL11_MD:![0-9]*]], metadata !DIExpression()), !dbg [[VAL11_LOC:![0-9]*]]
; CHECK-DAG: [[VAL11_V]] = {{.*}}, !dbg [[VAL11_LOC]]
; CHECK-DAG: void @llvm.dbg.value(metadata float [[VAL12_V]], metadata [[VAL12_MD:![0-9]*]], metadata !DIExpression()), !dbg [[VAL12_LOC:![0-9]*]]
; CHECK-DAG: [[VAL12_V]] = {{.*}}, !dbg [[VAL12_LOC]]
; CHECK-DAG: void @llvm.dbg.value(metadata float [[VAL13_V]], metadata [[VAL13_MD:![0-9]*]], metadata !DIExpression()), !dbg [[VAL13_LOC:![0-9]*]]
; CHECK-DAG: [[VAL13_V]] = {{.*}}, !dbg [[VAL13_LOC]]
; CHECK-DAG: store i8 [[VAL16_V:%[A-z0-9]*]], {{.*}}, !dbg [[STR6_LOC:![0-9]*]]
; CHECK-DAG: void @llvm.dbg.value(metadata i8 [[VAL16_V]], metadata [[VAL16_MD:![0-9]*]], metadata !DIExpression()), !dbg [[VAL16_LOC:![0-9]*]]
; CHECK-DAG: [[VAL16_V]] = {{.*}}, !dbg [[VAL16_LOC]]
; CHECK-DAG: store i8 [[VAL19_V:%[A-z0-9]*]], {{.*}}, !dbg [[STR7_LOC:![0-9]*]]
; CHECK-DAG: void @llvm.dbg.value(metadata i8 [[VAL19_V]], metadata [[VAL19_MD:![0-9]*]], metadata !DIExpression()), !dbg [[VAL19_LOC:![0-9]*]]
; CHECK-DAG: [[VAL19_V]] = {{.*}}, !dbg [[VAL19_LOC]]


define void @test(<3 x half> %src1, half* %dst1, <4 x float> %src2, float* %dst2, i8* %dst3) !dbg !6 {
  %1 = bitcast <3 x half> %src1 to i48, !dbg !34
  call void @llvm.dbg.value(metadata i48 %1, metadata !9, metadata !DIExpression()), !dbg !34
  %2 = trunc i48 %1 to i16, !dbg !35
  call void @llvm.dbg.value(metadata i16 %2, metadata !11, metadata !DIExpression()), !dbg !35
  %3 = bitcast i16 %2 to half, !dbg !36
  call void @llvm.dbg.value(metadata half %3, metadata !13, metadata !DIExpression()), !dbg !36
  store half %3, half* %dst1, !dbg !37
  %4 = bitcast <3 x half> %src1 to i48, !dbg !38
  call void @llvm.dbg.value(metadata i48 %4, metadata !14, metadata !DIExpression()), !dbg !38
  %5 = lshr i48 %4, 16, !dbg !39
  call void @llvm.dbg.value(metadata i48 %5, metadata !15, metadata !DIExpression()), !dbg !39
  %6 = trunc i48 %5 to i16, !dbg !40
  call void @llvm.dbg.value(metadata i16 %6, metadata !16, metadata !DIExpression()), !dbg !40
  %7 = bitcast i16 %6 to half, !dbg !41
  call void @llvm.dbg.value(metadata half %7, metadata !17, metadata !DIExpression()), !dbg !41
  store half %7, half* %dst1, !dbg !42
  %8 = bitcast <4 x float> %src2 to i128, !dbg !43
  call void @llvm.dbg.value(metadata i128 %8, metadata !18, metadata !DIExpression()), !dbg !43
  %9 = trunc i128 %8 to i96, !dbg !44
  call void @llvm.dbg.value(metadata i96 %9, metadata !20, metadata !DIExpression()), !dbg !44
  %10 = bitcast i96 %9 to <3 x float>, !dbg !45
  call void @llvm.dbg.value(metadata <3 x float> %10, metadata !22, metadata !DIExpression()), !dbg !45
  %11 = extractelement <3 x float> %10, i32 0, !dbg !46
  call void @llvm.dbg.value(metadata float %11, metadata !23, metadata !DIExpression()), !dbg !46
  %12 = extractelement <3 x float> %10, i32 1, !dbg !47
  call void @llvm.dbg.value(metadata float %12, metadata !25, metadata !DIExpression()), !dbg !47
  %13 = extractelement <3 x float> %10, i32 2, !dbg !48
  call void @llvm.dbg.value(metadata float %13, metadata !26, metadata !DIExpression()), !dbg !48
  store float %11, float* %dst2, !dbg !49
  store float %12, float* %dst2, !dbg !50
  store float %13, float* %dst2, !dbg !51
  %14 = bitcast <4 x float> %src2 to <4 x i32>, !dbg !52
  call void @llvm.dbg.value(metadata <4 x i32> %14, metadata !27, metadata !DIExpression()), !dbg !52
  %15 = bitcast <4 x i32> %14 to i128, !dbg !53
  call void @llvm.dbg.value(metadata i128 %15, metadata !28, metadata !DIExpression()), !dbg !53
  %16 = trunc i128 %15 to i8, !dbg !54
  call void @llvm.dbg.value(metadata i8 %16, metadata !29, metadata !DIExpression()), !dbg !54
  store i8 %16, i8* %dst3, !dbg !55
  %17 = bitcast <4 x i32> %14 to i128, !dbg !56
  call void @llvm.dbg.value(metadata i128 %17, metadata !31, metadata !DIExpression()), !dbg !56
  %18 = lshr i128 %17, 8, !dbg !57
  call void @llvm.dbg.value(metadata i128 %18, metadata !32, metadata !DIExpression()), !dbg !57
  %19 = trunc i128 %18 to i8, !dbg !58
  call void @llvm.dbg.value(metadata i8 %19, metadata !33, metadata !DIExpression()), !dbg !58
  store i8 %19, i8* %dst3, !dbg !59
  ret void, !dbg !60
}

; CHECK-DAG: [[FILE:![0-9]*]] = !DIFile(filename: "bitcast.ll", directory: "/")
; CHECK-DAG: [[SCOPE]] = distinct !DISubprogram(name: "test", linkageName: "test", scope: null, file: [[FILE]], line: 1
; CHECK-DAG: [[VAL3_MD]] = !DILocalVariable(name: "3", scope: [[SCOPE]], file: [[FILE]], line: 3
; CHECK-DAG: [[VAL3_LOC]] = !DILocation(line: 3, column: 1, scope: [[SCOPE]])
; CHECK-DAG: [[STR1_LOC]] = !DILocation(line: 4, column: 1, scope: [[SCOPE]])
; CHECK-DAG: [[VAL7_MD]] = !DILocalVariable(name: "7", scope: [[SCOPE]], file: [[FILE]], line: 8
; CHECK-DAG: [[VAL7_LOC]] = !DILocation(line: 8, column: 1, scope: [[SCOPE]])
; CHECK-DAG: [[STR2_LOC]] = !DILocation(line: 9, column: 1, scope: [[SCOPE]])
; CHECK-DAG: [[VAL11_MD]] = !DILocalVariable(name: "11", scope: [[SCOPE]], file: [[FILE]], line: 13
; CHECK-DAG: [[VAL11_LOC]] = !DILocation(line: 13, column: 1, scope: [[SCOPE]])
; CHECK-DAG: [[VAL12_MD]] = !DILocalVariable(name: "12", scope: [[SCOPE]], file: [[FILE]], line: 14
; CHECK-DAG: [[VAL12_LOC]] = !DILocation(line: 14, column: 1, scope: [[SCOPE]])
; CHECK-DAG: [[VAL13_MD]] = !DILocalVariable(name: "13", scope: [[SCOPE]], file: [[FILE]], line: 15
; CHECK-DAG: [[VAL13_LOC]] = !DILocation(line: 15, column: 1, scope: [[SCOPE]])
; CHECK-DAG: [[STR3_LOC]] = !DILocation(line: 16, column: 1, scope: [[SCOPE]])
; CHECK-DAG: [[STR4_LOC]] = !DILocation(line: 17, column: 1, scope: [[SCOPE]])
; CHECK-DAG: [[STR5_LOC]] = !DILocation(line: 18, column: 1, scope: [[SCOPE]])
; CHECK-DAG: [[VAL16_MD]] = !DILocalVariable(name: "16", scope: [[SCOPE]], file: [[FILE]], line: 21
; CHECK-DAG: [[VAL16_LOC]] = !DILocation(line: 21, column: 1, scope: [[SCOPE]])
; CHECK-DAG: [[STR6_LOC]] = !DILocation(line: 22, column: 1, scope: [[SCOPE]])
; CHECK-DAG: [[VAL19_MD]] = !DILocalVariable(name: "19", scope: [[SCOPE]], file: [[FILE]], line: 25
; CHECK-DAG: [[VAL19_LOC]] = !DILocation(line: 25, column: 1, scope: [[SCOPE]])
; CHECK-DAG: [[STR7_LOC]] = !DILocation(line: 26, column: 1, scope: [[SCOPE]])



; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #0

attributes #0 = { nounwind readnone speculatable }

!llvm.dbg.cu = !{!0}
!llvm.debugify = !{!3, !4}
!llvm.module.flags = !{!5}

!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
!1 = !DIFile(filename: "bitcast.ll", directory: "/")
!2 = !{}
!3 = !{i32 27}
!4 = !{i32 19}
!5 = !{i32 2, !"Debug Info Version", i32 3}
!6 = distinct !DISubprogram(name: "test", linkageName: "test", scope: null, file: !1, line: 1, type: !7, scopeLine: 1, unit: !0, retainedNodes: !8)
!7 = !DISubroutineType(types: !2)
!8 = !{!9, !11, !13, !14, !15, !16, !17, !18, !20, !22, !23, !25, !26, !27, !28, !29, !31, !32, !33}
!9 = !DILocalVariable(name: "1", scope: !6, file: !1, line: 1, type: !10)
!10 = !DIBasicType(name: "ty64", size: 64, encoding: DW_ATE_unsigned)
!11 = !DILocalVariable(name: "2", scope: !6, file: !1, line: 2, type: !12)
!12 = !DIBasicType(name: "ty16", size: 16, encoding: DW_ATE_unsigned)
!13 = !DILocalVariable(name: "3", scope: !6, file: !1, line: 3, type: !12)
!14 = !DILocalVariable(name: "4", scope: !6, file: !1, line: 5, type: !10)
!15 = !DILocalVariable(name: "5", scope: !6, file: !1, line: 6, type: !10)
!16 = !DILocalVariable(name: "6", scope: !6, file: !1, line: 7, type: !12)
!17 = !DILocalVariable(name: "7", scope: !6, file: !1, line: 8, type: !12)
!18 = !DILocalVariable(name: "8", scope: !6, file: !1, line: 10, type: !19)
!19 = !DIBasicType(name: "ty128", size: 128, encoding: DW_ATE_unsigned)
!20 = !DILocalVariable(name: "9", scope: !6, file: !1, line: 11, type: !21)
!21 = !DIBasicType(name: "ty96", size: 96, encoding: DW_ATE_unsigned)
!22 = !DILocalVariable(name: "10", scope: !6, file: !1, line: 12, type: !19)
!23 = !DILocalVariable(name: "11", scope: !6, file: !1, line: 13, type: !24)
!24 = !DIBasicType(name: "ty32", size: 32, encoding: DW_ATE_unsigned)
!25 = !DILocalVariable(name: "12", scope: !6, file: !1, line: 14, type: !24)
!26 = !DILocalVariable(name: "13", scope: !6, file: !1, line: 15, type: !24)
!27 = !DILocalVariable(name: "14", scope: !6, file: !1, line: 19, type: !19)
!28 = !DILocalVariable(name: "15", scope: !6, file: !1, line: 20, type: !19)
!29 = !DILocalVariable(name: "16", scope: !6, file: !1, line: 21, type: !30)
!30 = !DIBasicType(name: "ty8", size: 8, encoding: DW_ATE_unsigned)
!31 = !DILocalVariable(name: "17", scope: !6, file: !1, line: 23, type: !19)
!32 = !DILocalVariable(name: "18", scope: !6, file: !1, line: 24, type: !19)
!33 = !DILocalVariable(name: "19", scope: !6, file: !1, line: 25, type: !30)
!34 = !DILocation(line: 1, column: 1, scope: !6)
!35 = !DILocation(line: 2, column: 1, scope: !6)
!36 = !DILocation(line: 3, column: 1, scope: !6)
!37 = !DILocation(line: 4, column: 1, scope: !6)
!38 = !DILocation(line: 5, column: 1, scope: !6)
!39 = !DILocation(line: 6, column: 1, scope: !6)
!40 = !DILocation(line: 7, column: 1, scope: !6)
!41 = !DILocation(line: 8, column: 1, scope: !6)
!42 = !DILocation(line: 9, column: 1, scope: !6)
!43 = !DILocation(line: 10, column: 1, scope: !6)
!44 = !DILocation(line: 11, column: 1, scope: !6)
!45 = !DILocation(line: 12, column: 1, scope: !6)
!46 = !DILocation(line: 13, column: 1, scope: !6)
!47 = !DILocation(line: 14, column: 1, scope: !6)
!48 = !DILocation(line: 15, column: 1, scope: !6)
!49 = !DILocation(line: 16, column: 1, scope: !6)
!50 = !DILocation(line: 17, column: 1, scope: !6)
!51 = !DILocation(line: 18, column: 1, scope: !6)
!52 = !DILocation(line: 19, column: 1, scope: !6)
!53 = !DILocation(line: 20, column: 1, scope: !6)
!54 = !DILocation(line: 21, column: 1, scope: !6)
!55 = !DILocation(line: 22, column: 1, scope: !6)
!56 = !DILocation(line: 23, column: 1, scope: !6)
!57 = !DILocation(line: 24, column: 1, scope: !6)
!58 = !DILocation(line: 25, column: 1, scope: !6)
!59 = !DILocation(line: 26, column: 1, scope: !6)
!60 = !DILocation(line: 27, column: 1, scope: !6)