Debian Codegraph @

IGC/ocloc_tests/SPIRV-extenstions/SPV_INTEL_fpga_reg/IntelFPGAReg.ll

raw
1 ; LLVM IR for the test can be generated by SYCL Clang Compiler -
2 ; see https://github.com/intel/llvm
3 ; SYCL source code can be found below:
4
5 ; struct st {
6 ; int a;
7 ; float b;
8 ; };
9 ;
10 ; union un {
11 ; int a;
12 ; char c[4];
13 ; };
14 ;
15 ; class A {
16 ; public:
17 ; A(int a) {
18 ; m_val = a;
19 ; }
20 ; A(const A &a) {
21 ; m_val = a.m_val;
22 ; }
23 ; private:
24 ; int m_val;
25 ; };
26 ;
27 ; typedef int myInt;
28
29 ; void foo() {
30 ; int a=123;
31 ; myInt myA = 321;
32 ; int b = __builtin_intel_fpga_reg(a);
33 ; int myB = __builtin_intel_fpga_reg(myA);
34 ; int c = __builtin_intel_fpga_reg(2.0f);
35 ; int d = __builtin_intel_fpga_reg( __builtin_intel_fpga_reg( b+12 ));
36 ; int e = __builtin_intel_fpga_reg( __builtin_intel_fpga_reg( a+b ));
37 ; int f;
38 ; f = __builtin_intel_fpga_reg(a);
39 ;
40 ; struct st i = {1, 5.0f};
41 ; struct st i2 = i;
42 ; struct st ii = __builtin_intel_fpga_reg(i);
43 ; struct st iii;
44 ; iii = __builtin_intel_fpga_reg(ii);
45 ;
46 ; struct st *iiii = __builtin_intel_fpga_reg(&iii);
47 ;
48 ; union un u1 = {1};
49 ; union un u2, *u3;
50 ; u2 = __builtin_intel_fpga_reg(u1);
51 ;
52 ; u3 = __builtin_intel_fpga_reg(&u2);
53 ;
54 ; A ca(213);
55 ; A cb = __builtin_intel_fpga_reg(ca);
56
57 ; UNSUPPORTED: system-windows
58 ; REQUIRES: llvm-spirv, regkeys, dg2-supported
59
60 ; RUN: llvm-as %s -o %t.bc
61 ; RUN: llvm-spirv %t.bc --spirv-ext=+SPV_INTEL_fpga_reg -o %t.spv
62 ; RUN: ocloc compile -spirv_input -file %t.spv -device dg2 -options " -igc_opts 'ShaderDumpTranslationOnly=1'" 2>&1 | FileCheck %s --check-prefixes=CHECK-LLVM
63
64 ; CHECK-LLVM-DAG: @[[STR:[0-9]+]] = {{.*}}__builtin_intel_fpga_reg
65 ; CHECK-LLVM-DAG: @[[STR1:[0-9]+]] = {{.*}}__builtin_intel_fpga_reg
66 ; CHECK-LLVM-DAG: @[[STR2:[0-9]+]] = {{.*}}__builtin_intel_fpga_reg
67 ; CHECK-LLVM-DAG: @[[STR3:[0-9]+]] = {{.*}}__builtin_intel_fpga_reg
68 ; CHECK-LLVM-DAG: @[[STR4:[0-9]+]] = {{.*}}__builtin_intel_fpga_reg
69 ; CHECK-LLVM-DAG: @[[STR5:[0-9]+]] = {{.*}}__builtin_intel_fpga_reg
70 ; CHECK-LLVM-DAG: @[[STR6:[0-9]+]] = {{.*}}__builtin_intel_fpga_reg
71 ; CHECK-LLVM-DAG: @[[STR7:[0-9]+]] = {{.*}}__builtin_intel_fpga_reg
72 ; CHECK-LLVM-DAG: @[[STR8:[0-9]+]] = {{.*}}__builtin_intel_fpga_reg
73 ; CHECK-LLVM-DAG: @[[STR9:[0-9]+]] = {{.*}}__builtin_intel_fpga_reg
74 ; CHECK-LLVM-DAG: @[[STR10:[0-9]+]] = {{.*}}__builtin_intel_fpga_reg
75 ; CHECK-LLVM-DAG: @[[STR11:[0-9]+]] = {{.*}}__builtin_intel_fpga_reg
76 ; CHECK-LLVM-DAG: @[[STR12:[0-9]+]] = {{.*}}__builtin_intel_fpga_reg
77 ; CHECK-LLVM-DAG: @[[STR13:[0-9]+]] = {{.*}}__builtin_intel_fpga_reg
78 ; CHECK-LLVM-DAG: @[[STR14:[0-9]+]] = {{.*}}__builtin_intel_fpga_reg
79
80 target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"
81 target triple = "spir64-unknown-linux"
82
83 %struct._ZTS2st.st = type { i32, float }
84 %union._ZTS2un.un = type { i32 }
85 %"class._ZTSZ4mainE3$_0.anon" = type { i8 }
86 %class._ZTS1A.A = type { i32 }
87
88 $_ZN1AC1Ei = comdat any
89
90 $_ZN1AC2Ei = comdat any
91
92 @.str = private unnamed_addr constant [25 x i8] c"__builtin_intel_fpga_reg\00", section "llvm.metadata"
93 @.str.1 = private unnamed_addr constant [9 x i8] c"test.cpp\00", section "llvm.metadata"
94 @__const._Z3foov.i = private unnamed_addr constant %struct._ZTS2st.st { i32 1, float 5.000000e+00 }, align 4
95 @__const._Z3foov.u1 = private unnamed_addr constant %union._ZTS2un.un { i32 1 }, align 4
96
97 ; Function Attrs: nounwind
98 define spir_kernel void @_ZTSZ4mainE11fake_kernel() #0 !kernel_arg_addr_space !4 !kernel_arg_access_qual !4 !kernel_arg_type !4 !kernel_arg_base_type !4 !kernel_arg_type_qual !4 {
99 entry:
100 %0 = alloca %"class._ZTSZ4mainE3$_0.anon", align 1
101 %1 = bitcast %"class._ZTSZ4mainE3$_0.anon"* %0 to i8*
102 call void @llvm.lifetime.start.p0i8(i64 1, i8* %1) #4
103 %2 = addrspacecast %"class._ZTSZ4mainE3$_0.anon"* %0 to %"class._ZTSZ4mainE3$_0.anon" addrspace(4)*
104 call spir_func void @"_ZZ4mainENK3$_0clEv"(%"class._ZTSZ4mainE3$_0.anon" addrspace(4)* %2)
105 %3 = bitcast %"class._ZTSZ4mainE3$_0.anon"* %0 to i8*
106 call void @llvm.lifetime.end.p0i8(i64 1, i8* %3) #4
107 ret void
108 }
109
110 ; Function Attrs: argmemonly nounwind
111 declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1
112
113 ; Function Attrs: inlinehint nounwind
114 define internal spir_func void @"_ZZ4mainENK3$_0clEv"(%"class._ZTSZ4mainE3$_0.anon" addrspace(4)* %this) #2 align 2 {
115 entry:
116 %this.addr = alloca %"class._ZTSZ4mainE3$_0.anon" addrspace(4)*, align 8
117 store %"class._ZTSZ4mainE3$_0.anon" addrspace(4)* %this, %"class._ZTSZ4mainE3$_0.anon" addrspace(4)** %this.addr, align 8, !tbaa !5
118 %this1 = load %"class._ZTSZ4mainE3$_0.anon" addrspace(4)*, %"class._ZTSZ4mainE3$_0.anon" addrspace(4)** %this.addr, align 8
119 call spir_func void @_Z3foov()
120 ret void
121 }
122
123 ; Function Attrs: argmemonly nounwind
124 declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1
125
126 ; Function Attrs: nounwind
127 define spir_func void @_Z3foov() #3 {
128 entry:
129 %a = alloca i32, align 4
130 %myA = alloca i32, align 4
131 %b = alloca i32, align 4
132 %myB = alloca i32, align 4
133 %c = alloca i32, align 4
134 %d = alloca i32, align 4
135 %e = alloca i32, align 4
136 %f = alloca i32, align 4
137 %i = alloca %struct._ZTS2st.st, align 4
138 %i2 = alloca %struct._ZTS2st.st, align 4
139 %ii = alloca %struct._ZTS2st.st, align 4
140 %agg-temp = alloca %struct._ZTS2st.st, align 4
141 %iii = alloca %struct._ZTS2st.st, align 4
142 %ref.tmp = alloca %struct._ZTS2st.st, align 4
143 %agg-temp2 = alloca %struct._ZTS2st.st, align 4
144 %iiii = alloca %struct._ZTS2st.st addrspace(4)*, align 8
145 %u1 = alloca %union._ZTS2un.un, align 4
146 %u2 = alloca %union._ZTS2un.un, align 4
147 %u3 = alloca %union._ZTS2un.un addrspace(4)*, align 8
148 %ref.tmp3 = alloca %union._ZTS2un.un, align 4
149 %agg-temp4 = alloca %union._ZTS2un.un, align 4
150 %ca = alloca %class._ZTS1A.A, align 4
151 %cb = alloca %class._ZTS1A.A, align 4
152 %agg-temp5 = alloca %class._ZTS1A.A, align 4
153 %ap = alloca i32 addrspace(4)*, align 8
154 %bp = alloca i32 addrspace(4)*, align 8
155 %0 = bitcast i32* %a to i8*
156 call void @llvm.lifetime.start.p0i8(i64 4, i8* %0) #4
157 store i32 123, i32* %a, align 4, !tbaa !9
158 %1 = bitcast i32* %myA to i8*
159 call void @llvm.lifetime.start.p0i8(i64 4, i8* %1) #4
160 store i32 321, i32* %myA, align 4, !tbaa !9
161 %2 = bitcast i32* %b to i8*
162 call void @llvm.lifetime.start.p0i8(i64 4, i8* %2) #4
163 %3 = load i32, i32* %a, align 4, !tbaa !9
164 ; CHECK-LLVM-DAG: %{{[0-9]+}} = call i32 @llvm.annotation.i32(i32 {{[%a-z0-9]+}}, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @[[STR]]
165 %4 = call i32 @llvm.annotation.i32(i32 %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i32 0, i32 0), i32 35)
166 store i32 %4, i32* %b, align 4, !tbaa !9
167 %5 = bitcast i32* %myB to i8*
168 call void @llvm.lifetime.start.p0i8(i64 4, i8* %5) #4
169 %6 = load i32, i32* %myA, align 4, !tbaa !9
170 ; CHECK-LLVM-DAG: %{{[0-9]+}} = call i32 @llvm.annotation.i32(i32 {{[%a-z0-9]+}}, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @[[STR1]]
171 %7 = call i32 @llvm.annotation.i32(i32 %6, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i32 0, i32 0), i32 39)
172 store i32 %7, i32* %myB, align 4, !tbaa !9
173 %8 = bitcast i32* %c to i8*
174 call void @llvm.lifetime.start.p0i8(i64 4, i8* %8) #4
175 ; CHECK-LLVM-DAG: %{{[0-9]+}} = call i32 @llvm.annotation.i32(i32 {{[%a-z0-9]+}}, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @[[STR2]]
176 %9 = call i32 @llvm.annotation.i32(i32 1073741824, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i32 0, i32 0), i32 43)
177 %10 = bitcast i32 %9 to float
178 %conv = fptosi float %10 to i32
179 store i32 %conv, i32* %c, align 4, !tbaa !9
180 %11 = bitcast i32* %d to i8*
181 call void @llvm.lifetime.start.p0i8(i64 4, i8* %11) #4
182 %12 = load i32, i32* %b, align 4, !tbaa !9
183 %add = add nsw i32 %12, 12
184 ; CHECK-LLVM-DAG: %{{[0-9]+}} = call i32 @llvm.annotation.i32(i32 {{[%a-z0-9]+}}, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @[[STR3]]
185 %13 = call i32 @llvm.annotation.i32(i32 %add, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i32 0, i32 0), i32 48)
186 ; CHECK-LLVM-DAG: %{{[0-9]+}} = call i32 @llvm.annotation.i32(i32 {{[%a-z0-9]+}}, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @[[STR4]]
187 %14 = call i32 @llvm.annotation.i32(i32 %13, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i32 0, i32 0), i32 48)
188 store i32 %14, i32* %d, align 4, !tbaa !9
189 %15 = bitcast i32* %e to i8*
190 call void @llvm.lifetime.start.p0i8(i64 4, i8* %15) #4
191 %16 = load i32, i32* %a, align 4, !tbaa !9
192 %17 = load i32, i32* %b, align 4, !tbaa !9
193 %add1 = add nsw i32 %16, %17
194 ; CHECK-LLVM-DAG: %{{[0-9]+}} = call i32 @llvm.annotation.i32(i32 {{[%a-z0-9]+}}, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @[[STR5]]
195 %18 = call i32 @llvm.annotation.i32(i32 %add1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i32 0, i32 0), i32 54)
196 ; CHECK-LLVM-DAG: %{{[0-9]+}} = call i32 @llvm.annotation.i32(i32 {{[%a-z0-9]+}}, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @[[STR6]]
197 %19 = call i32 @llvm.annotation.i32(i32 %18, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i32 0, i32 0), i32 54)
198 store i32 %19, i32* %e, align 4, !tbaa !9
199 %20 = bitcast i32* %f to i8*
200 call void @llvm.lifetime.start.p0i8(i64 4, i8* %20) #4
201 %21 = load i32, i32* %a, align 4, !tbaa !9
202 ; CHECK-LLVM-DAG: %{{[0-9]+}} = call i32 @llvm.annotation.i32(i32 {{[%a-z0-9]+}}, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @[[STR7]]
203 %22 = call i32 @llvm.annotation.i32(i32 %21, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i32 0, i32 0), i32 62)
204 store i32 %22, i32* %f, align 4, !tbaa !9
205 %23 = bitcast %struct._ZTS2st.st* %i to i8*
206 call void @llvm.lifetime.start.p0i8(i64 8, i8* %23) #4
207 %24 = bitcast %struct._ZTS2st.st* %i to i8*
208 call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %24, i8* align 4 bitcast (%struct._ZTS2st.st* @__const._Z3foov.i to i8*), i64 8, i1 false)
209 %25 = bitcast %struct._ZTS2st.st* %i2 to i8*
210 call void @llvm.lifetime.start.p0i8(i64 8, i8* %25) #4
211 %26 = bitcast %struct._ZTS2st.st* %i2 to i8*
212 %27 = bitcast %struct._ZTS2st.st* %i to i8*
213 call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %26, i8* align 4 %27, i64 8, i1 false), !tbaa.struct !11
214 %28 = bitcast %struct._ZTS2st.st* %ii to i8*
215 call void @llvm.lifetime.start.p0i8(i64 8, i8* %28) #4
216 %29 = bitcast %struct._ZTS2st.st* %agg-temp to i8*
217 %30 = bitcast %struct._ZTS2st.st* %i to i8*
218 call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %29, i8* align 4 %30, i64 8, i1 false), !tbaa.struct !11
219 %31 = bitcast %struct._ZTS2st.st* %agg-temp to i8*
220 ; CHECK-LLVM-DAG: %{{[0-9]+}} = call i8* @llvm.ptr.annotation.p0i8(i8* {{[%a-z0-9]+}}, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @[[STR8]]
221 ; CHECK-LLVM-DAG: %[[CAST1:[%0-9A-Za-z._]+]] = bitcast %struct._ZTS2st.st* %agg-temp to i8*
222 %32 = call i8* @llvm.ptr.annotation.p0i8(i8* %31, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i32 0, i32 0), i32 69, i8* null)
223 %33 = bitcast i8* %32 to %struct._ZTS2st.st*
224 %34 = bitcast %struct._ZTS2st.st* %ii to i8*
225 %35 = bitcast %struct._ZTS2st.st* %33 to i8*
226 call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %34, i8* align 4 %35, i64 8, i1 false)
227 %36 = bitcast %struct._ZTS2st.st* %iii to i8*
228 call void @llvm.lifetime.start.p0i8(i64 8, i8* %36) #4
229 %37 = bitcast %struct._ZTS2st.st* %ref.tmp to i8*
230 call void @llvm.lifetime.start.p0i8(i64 8, i8* %37) #4
231 %38 = bitcast %struct._ZTS2st.st* %agg-temp2 to i8*
232 %39 = bitcast %struct._ZTS2st.st* %ii to i8*
233 call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %38, i8* align 4 %39, i64 8, i1 false), !tbaa.struct !11
234 %40 = bitcast %struct._ZTS2st.st* %agg-temp2 to i8*
235 ; CHECK-LLVM-DAG: %{{[0-9]+}} = call i8* @llvm.ptr.annotation.p0i8(i8* {{[%a-z0-9]+}}, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @[[STR9]]
236 ; CHECK-LLVM-DAG: %[[CAST2:[%0-9A-Za-z._]+]] = bitcast %struct._ZTS2st.st* %agg-temp2 to i8*
237 %41 = call i8* @llvm.ptr.annotation.p0i8(i8* %40, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i32 0, i32 0), i32 80, i8* null)
238 %42 = bitcast i8* %41 to %struct._ZTS2st.st*
239 %43 = bitcast %struct._ZTS2st.st* %ref.tmp to i8*
240 %44 = bitcast %struct._ZTS2st.st* %42 to i8*
241 call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %43, i8* align 4 %44, i64 8, i1 false)
242 %45 = bitcast %struct._ZTS2st.st* %iii to i8*
243 %46 = bitcast %struct._ZTS2st.st* %ref.tmp to i8*
244 call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %45, i8* align 4 %46, i64 8, i1 false), !tbaa.struct !11
245 %47 = bitcast %struct._ZTS2st.st* %ref.tmp to i8*
246 call void @llvm.lifetime.end.p0i8(i64 8, i8* %47) #4
247 %48 = bitcast %struct._ZTS2st.st addrspace(4)** %iiii to i8*
248 call void @llvm.lifetime.start.p0i8(i64 8, i8* %48) #4
249 %49 = ptrtoint %struct._ZTS2st.st* %iii to i64
250 ; CHECK-LLVM-DAG: %{{[0-9]+}} = call i64 @llvm.annotation.i64(i64 {{[%a-z0-9]+}}, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @[[STR10]]
251 %50 = call i64 @llvm.annotation.i64(i64 %49, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i32 0, i32 0), i32 94)
252 %51 = inttoptr i64 %50 to %struct._ZTS2st.st*
253 %52 = addrspacecast %struct._ZTS2st.st* %51 to %struct._ZTS2st.st addrspace(4)*
254 store %struct._ZTS2st.st addrspace(4)* %52, %struct._ZTS2st.st addrspace(4)** %iiii, align 8, !tbaa !5
255 %53 = bitcast %union._ZTS2un.un* %u1 to i8*
256 call void @llvm.lifetime.start.p0i8(i64 4, i8* %53) #4
257 %54 = bitcast %union._ZTS2un.un* %u1 to i8*
258 call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %54, i8* align 4 bitcast (%union._ZTS2un.un* @__const._Z3foov.u1 to i8*), i64 4, i1 false)
259 %55 = bitcast %union._ZTS2un.un* %u2 to i8*
260 call void @llvm.lifetime.start.p0i8(i64 4, i8* %55) #4
261 %56 = bitcast %union._ZTS2un.un addrspace(4)** %u3 to i8*
262 call void @llvm.lifetime.start.p0i8(i64 8, i8* %56) #4
263 %57 = bitcast %union._ZTS2un.un* %ref.tmp3 to i8*
264 call void @llvm.lifetime.start.p0i8(i64 4, i8* %57) #4
265 %58 = bitcast %union._ZTS2un.un* %agg-temp4 to i8*
266 %59 = bitcast %union._ZTS2un.un* %u1 to i8*
267 call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %58, i8* align 4 %59, i64 4, i1 false), !tbaa.struct !14
268 %60 = bitcast %union._ZTS2un.un* %agg-temp4 to i8*
269 ; CHECK-LLVM-DAG: %{{[0-9]+}} = call i8* @llvm.ptr.annotation.p0i8(i8* {{[%a-z0-9]+}}, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @[[STR11]]
270 ; CHECK-LLVM-DAG: %[[CAST4:[%0-9A-Za-z._]+]] = bitcast %union._ZTS2un.un* %agg-temp4 to i8*
271 %61 = call i8* @llvm.ptr.annotation.p0i8(i8* %60, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i32 0, i32 0), i32 103, i8* null)
272 %62 = bitcast i8* %61 to %union._ZTS2un.un*
273 %63 = bitcast %union._ZTS2un.un* %ref.tmp3 to i8*
274 %64 = bitcast %union._ZTS2un.un* %62 to i8*
275 call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %63, i8* align 4 %64, i64 8, i1 false)
276 %65 = bitcast %union._ZTS2un.un* %u2 to i8*
277 %66 = bitcast %union._ZTS2un.un* %ref.tmp3 to i8*
278 call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %65, i8* align 4 %66, i64 4, i1 false), !tbaa.struct !14
279 %67 = bitcast %union._ZTS2un.un* %ref.tmp3 to i8*
280 call void @llvm.lifetime.end.p0i8(i64 4, i8* %67) #4
281 %68 = ptrtoint %union._ZTS2un.un* %u2 to i64
282 ; CHECK-LLVM-DAG: %{{[0-9]+}} = call i64 @llvm.annotation.i64(i64 {{[%a-z0-9]+}}, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @[[STR12]]
283 %69 = call i64 @llvm.annotation.i64(i64 %68, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i32 0, i32 0), i32 117)
284 %70 = inttoptr i64 %69 to %union._ZTS2un.un*
285 %71 = addrspacecast %union._ZTS2un.un* %70 to %union._ZTS2un.un addrspace(4)*
286 store %union._ZTS2un.un addrspace(4)* %71, %union._ZTS2un.un addrspace(4)** %u3, align 8, !tbaa !5
287 %72 = bitcast %class._ZTS1A.A* %ca to i8*
288 call void @llvm.lifetime.start.p0i8(i64 4, i8* %72) #4
289 %73 = addrspacecast %class._ZTS1A.A* %ca to %class._ZTS1A.A addrspace(4)*
290 call spir_func void @_ZN1AC1Ei(%class._ZTS1A.A addrspace(4)* %73, i32 213)
291 %74 = bitcast %class._ZTS1A.A* %cb to i8*
292 call void @llvm.lifetime.start.p0i8(i64 4, i8* %74) #4
293 %75 = bitcast %class._ZTS1A.A* %agg-temp5 to i8*
294 %76 = bitcast %class._ZTS1A.A* %ca to i8*
295 call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %75, i8* align 4 %76, i64 4, i1 false), !tbaa.struct !16
296 %77 = bitcast %class._ZTS1A.A* %agg-temp5 to i8*
297 ; CHECK-LLVM-DAG: %{{[0-9]+}} = call i8* @llvm.ptr.annotation.p0i8(i8* {{[%a-z0-9]+}}, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @[[STR13]]
298 ; CHECK-LLVM-DAG: %[[CAST5:[%0-9A-Za-z._]+]] = bitcast %class._ZTS1A.A* %agg-temp5 to i8*
299 %78 = call i8* @llvm.ptr.annotation.p0i8(i8* %77, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i32 0, i32 0), i32 125, i8* null)
300 %79 = bitcast i8* %78 to %class._ZTS1A.A*
301 %80 = bitcast %class._ZTS1A.A* %cb to i8*
302 %81 = bitcast %class._ZTS1A.A* %79 to i8*
303 call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %80, i8* align 4 %81, i64 8, i1 false)
304 %82 = bitcast i32 addrspace(4)** %ap to i8*
305 call void @llvm.lifetime.start.p0i8(i64 8, i8* %82) #4
306 %83 = addrspacecast i32* %a to i32 addrspace(4)*
307 store i32 addrspace(4)* %83, i32 addrspace(4)** %ap, align 8, !tbaa !5
308 %84 = bitcast i32 addrspace(4)** %bp to i8*
309 call void @llvm.lifetime.start.p0i8(i64 8, i8* %84) #4
310 %85 = load i32 addrspace(4)*, i32 addrspace(4)** %ap, align 8, !tbaa !5
311 %86 = ptrtoint i32 addrspace(4)* %85 to i64
312 ; CHECK-LLVM-DAG: %{{[0-9]+}} = call i64 @llvm.annotation.i64(i64 {{[%a-z0-9]+}}, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @[[STR14]]
313 %87 = call i64 @llvm.annotation.i64(i64 %86, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i32 0, i32 0), i32 137)
314 %88 = inttoptr i64 %87 to i32 addrspace(4)*
315 store i32 addrspace(4)* %88, i32 addrspace(4)** %bp, align 8, !tbaa !5
316 %89 = bitcast i32 addrspace(4)** %bp to i8*
317 call void @llvm.lifetime.end.p0i8(i64 8, i8* %89) #4
318 %90 = bitcast i32 addrspace(4)** %ap to i8*
319 call void @llvm.lifetime.end.p0i8(i64 8, i8* %90) #4
320 %91 = bitcast %class._ZTS1A.A* %cb to i8*
321 call void @llvm.lifetime.end.p0i8(i64 4, i8* %91) #4
322 %92 = bitcast %class._ZTS1A.A* %ca to i8*
323 call void @llvm.lifetime.end.p0i8(i64 4, i8* %92) #4
324 %93 = bitcast %union._ZTS2un.un addrspace(4)** %u3 to i8*
325 call void @llvm.lifetime.end.p0i8(i64 8, i8* %93) #4
326 %94 = bitcast %union._ZTS2un.un* %u2 to i8*
327 call void @llvm.lifetime.end.p0i8(i64 4, i8* %94) #4
328 %95 = bitcast %union._ZTS2un.un* %u1 to i8*
329 call void @llvm.lifetime.end.p0i8(i64 4, i8* %95) #4
330 %96 = bitcast %struct._ZTS2st.st addrspace(4)** %iiii to i8*
331 call void @llvm.lifetime.end.p0i8(i64 8, i8* %96) #4
332 %97 = bitcast %struct._ZTS2st.st* %iii to i8*
333 call void @llvm.lifetime.end.p0i8(i64 8, i8* %97) #4
334 %98 = bitcast %struct._ZTS2st.st* %ii to i8*
335 call void @llvm.lifetime.end.p0i8(i64 8, i8* %98) #4
336 %99 = bitcast %struct._ZTS2st.st* %i2 to i8*
337 call void @llvm.lifetime.end.p0i8(i64 8, i8* %99) #4
338 %100 = bitcast %struct._ZTS2st.st* %i to i8*
339 call void @llvm.lifetime.end.p0i8(i64 8, i8* %100) #4
340 %101 = bitcast i32* %f to i8*
341 call void @llvm.lifetime.end.p0i8(i64 4, i8* %101) #4
342 %102 = bitcast i32* %e to i8*
343 call void @llvm.lifetime.end.p0i8(i64 4, i8* %102) #4
344 %103 = bitcast i32* %d to i8*
345 call void @llvm.lifetime.end.p0i8(i64 4, i8* %103) #4
346 %104 = bitcast i32* %c to i8*
347 call void @llvm.lifetime.end.p0i8(i64 4, i8* %104) #4
348 %105 = bitcast i32* %myB to i8*
349 call void @llvm.lifetime.end.p0i8(i64 4, i8* %105) #4
350 %106 = bitcast i32* %b to i8*
351 call void @llvm.lifetime.end.p0i8(i64 4, i8* %106) #4
352 %107 = bitcast i32* %myA to i8*
353 call void @llvm.lifetime.end.p0i8(i64 4, i8* %107) #4
354 %108 = bitcast i32* %a to i8*
355 call void @llvm.lifetime.end.p0i8(i64 4, i8* %108) #4
356 ret void
357 }
358
359 ; Function Attrs: nounwind
360 declare i32 @llvm.annotation.i32(i32, i8*, i8*, i32) #4
361
362 ; Function Attrs: argmemonly nounwind
363 declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i1 immarg) #1
364
365 ; Function Attrs: nounwind
366 declare i8* @llvm.ptr.annotation.p0i8(i8*, i8*, i8*, i32, i8*) #4
367
368 ; Function Attrs: nounwind
369 declare i64 @llvm.annotation.i64(i64, i8*, i8*, i32) #4
370
371 ; Function Attrs: nounwind
372 define linkonce_odr spir_func void @_ZN1AC1Ei(%class._ZTS1A.A addrspace(4)* %this, i32 %a) unnamed_addr #3 comdat align 2 {
373 entry:
374 %this.addr = alloca %class._ZTS1A.A addrspace(4)*, align 8
375 %a.addr = alloca i32, align 4
376 store %class._ZTS1A.A addrspace(4)* %this, %class._ZTS1A.A addrspace(4)** %this.addr, align 8, !tbaa !5
377 store i32 %a, i32* %a.addr, align 4, !tbaa !9
378 %this1 = load %class._ZTS1A.A addrspace(4)*, %class._ZTS1A.A addrspace(4)** %this.addr, align 8
379 %0 = load i32, i32* %a.addr, align 4, !tbaa !9
380 call spir_func void @_ZN1AC2Ei(%class._ZTS1A.A addrspace(4)* %this1, i32 %0)
381 ret void
382 }
383
384 ; Function Attrs: nounwind
385 define linkonce_odr spir_func void @_ZN1AC2Ei(%class._ZTS1A.A addrspace(4)* %this, i32 %a) unnamed_addr #3 comdat align 2 {
386 entry:
387 %this.addr = alloca %class._ZTS1A.A addrspace(4)*, align 8
388 %a.addr = alloca i32, align 4
389 store %class._ZTS1A.A addrspace(4)* %this, %class._ZTS1A.A addrspace(4)** %this.addr, align 8, !tbaa !5
390 store i32 %a, i32* %a.addr, align 4, !tbaa !9
391 %this1 = load %class._ZTS1A.A addrspace(4)*, %class._ZTS1A.A addrspace(4)** %this.addr, align 8
392 %0 = load i32, i32* %a.addr, align 4, !tbaa !9
393 %m_val = getelementptr inbounds %class._ZTS1A.A, %class._ZTS1A.A addrspace(4)* %this1, i32 0, i32 0
394 store i32 %0, i32 addrspace(4)* %m_val, align 4, !tbaa !17
395 ret void
396 }
397
398 attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "uniform-work-group-size"="true" "unsafe-fp-math"="false" "use-soft-float"="false" }
399 attributes #1 = { argmemonly nounwind }
400 attributes #2 = { inlinehint nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
401 attributes #3 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
402 attributes #4 = { nounwind }
403
404 !llvm.module.flags = !{!0}
405 !opencl.spir.version = !{!1}
406 !spirv.Source = !{!2}
407 !llvm.ident = !{!3}
408
409 !0 = !{i32 1, !"wchar_size", i32 4}
410 !1 = !{i32 1, i32 2}
411 !2 = !{i32 4, i32 100000}
412 !3 = !{!"clang version 9.0.0"}
413 !4 = !{}
414 !5 = !{!6, !6, i64 0}
415 !6 = !{!"any pointer", !7, i64 0}
416 !7 = !{!"omnipotent char", !8, i64 0}
417 !8 = !{!"Simple C++ TBAA"}
418 !9 = !{!10, !10, i64 0}
419 !10 = !{!"int", !7, i64 0}
420 !11 = !{i64 0, i64 4, !9, i64 4, i64 4, !12}
421 !12 = !{!13, !13, i64 0}
422 !13 = !{!"float", !7, i64 0}
423 !14 = !{i64 0, i64 4, !9, i64 0, i64 4, !15}
424 !15 = !{!7, !7, i64 0}
425 !16 = !{i64 0, i64 4, !9}
426 !17 = !{!18, !10, i64 0}
427 !18 = !{!"_ZTS1A", !10, i64 0}