150
150
; s.field = 0;
151
151
; }
152
152
;
153
+ ; void force_pow2_depth_attr() {
154
+ ; [[intelfpga::force_pow2_depth(0)]] int fp2d_var;
155
+ ;
156
+ ; [[intelfpga::force_pow2_depth(1)]] struct fp2d_st {
157
+ ; int field;
158
+ ; } s;
159
+ ; s.field = 0;
160
+ ; }
161
+ ;
162
+ ; template <int A>
163
+ ; void templ_force_pow2_depth_attr() {
164
+ ; [[intelfpga::force_pow2_depth(A)]] int templ_fp2d_var;
165
+ ;
166
+ ; [[intelfpga::force_pow2_depth(A)]] struct templ_fp2d_st {
167
+ ; int field;
168
+ ; } s;
169
+ ; s.field = 0;
170
+ ; }
171
+ ;
153
172
; template <typename name, typename Func>
154
173
; __attribute__((sycl_kernel)) void kernel_single_task(Func kernelFunc) {
155
174
; kernelFunc();
173
192
; simple_dual_port_attr();
174
193
; bank_bits_attr();
175
194
; templ_bank_bits_attr<4, 5>();
195
+ ; force_pow2_depth_attr();
196
+ ; templ_force_pow2_depth_attr<1>();
176
197
; });
177
198
; return 0;
178
199
; }
205
226
; CHECK-SPIRV: Decorate {{[0-9]+}} DoublepumpINTEL
206
227
; CHECK-SPIRV: Decorate {{[0-9]+}} MaxReplicatesINTEL 8
207
228
; CHECK-SPIRV: Decorate {{[0-9]+}} SimpleDualPortINTEL
229
+ ; CHECK-SPIRV: Decorate {{[0-9]+}} ForcePow2DepthINTEL 1
208
230
; CHECK-SPIRV: Decorate {{[0-9]+}} MemoryINTEL "MLAB"
209
231
; CHECK-SPIRV: Decorate {{[0-9]+}} MemoryINTEL "BLOCK_RAM"
210
232
; CHECK-SPIRV: Decorate {{[0-9]+}} NumbanksINTEL 8
221
243
; CHECK-SPIRV: Decorate {{[0-9]+}} BankBitsINTEL 5
222
244
; CHECK-SPIRV: Decorate {{[0-9]+}} BankBitsINTEL 4 5
223
245
; CHECK-SPIRV: Decorate {{[0-9]+}} BankBitsINTEL 2 1 0
246
+ ; CHECK-SPIRV: Decorate {{[0-9]+}} ForcePow2DepthINTEL 0
224
247
225
248
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"
226
249
target triple = "spir"
@@ -242,6 +265,8 @@ target triple = "spir"
242
265
%struct.simple_dual_port_st = type { i32 }
243
266
%struct.bank_bits_st = type { i32 }
244
267
%struct.templ_bank_bits_st = type { i32 }
268
+ %struct.fp2d_st = type { i32 }
269
+ %struct.templ_fp2d_st = type { i32 }
245
270
246
271
; CHECK-LLVM: [[STR_NMB_VAR:@[0-9_.]+]] = {{.*}}{memory:DEFAULT}{numbanks:16}
247
272
; CHECK-LLVM: [[STR_NMB_SCT:@[0-9_.]+]] = {{.*}}{memory:DEFAULT}{numbanks:2}
@@ -275,6 +300,10 @@ target triple = "spir"
275
300
; CHECK-LLVM: [[STR_BBT_SCT:@[0-9_.]+]] = {{.*}}{memory:DEFAULT}{numbanks:2}{bank_bits:2}
276
301
; CHECK-LLVM: [[STR_BBT_TE1:@[0-9_.]+]] = {{.*}}{memory:DEFAULT}{numbanks:4}{bank_bits:4,5}
277
302
; CHECK-LLVM: [[STR_BBT_TE2:@[0-9_.]+]] = {{.*}}{memory:DEFAULT}{numbanks:2}{bank_bits:5}
303
+ ; CHECK-LLVM: [[STR_FP2_VAR:@[0-9_.]+]] = {{.*}}{memory:DEFAULT}{force_pow2_depth:0}
304
+ ; CHECK-LLVM: [[STR_FP2_SCT:@[0-9_.]+]] = {{.*}}{memory:DEFAULT}{force_pow2_depth:1}
305
+ ; CHECK-LLVM: [[STR_FP2_TE1:@[0-9_.]+]] = {{.*}}{memory:DEFAULT}{force_pow2_depth:1}
306
+ ; CHECK-LLVM: [[STR_FP2_TE2:@[0-9_.]+]] = {{.*}}{memory:DEFAULT}{force_pow2_depth:1}
278
307
@.str = private unnamed_addr constant [42 x i8 ] c "{memory:DEFAULT}{sizeinfo:4}{numbanks:16}\00 " , section "llvm.metadata"
279
308
@.str.1 = private unnamed_addr constant [25 x i8 ] c "intel-fpga-local-var.cpp\00 " , section "llvm.metadata"
280
309
@.str.2 = private unnamed_addr constant [41 x i8 ] c "{memory:DEFAULT}{sizeinfo:4}{numbanks:2}\00 " , section "llvm.metadata"
@@ -300,6 +329,8 @@ target triple = "spir"
300
329
@.str.22 = private unnamed_addr constant [54 x i8 ] c "{memory:DEFAULT}{sizeinfo:4}{numbanks:2}{bank_bits:2}\00 " , section "llvm.metadata"
301
330
@.str.23 = private unnamed_addr constant [56 x i8 ] c "{memory:DEFAULT}{sizeinfo:4}{numbanks:4}{bank_bits:4,5}\00 " , section "llvm.metadata"
302
331
@.str.24 = private unnamed_addr constant [54 x i8 ] c "{memory:DEFAULT}{sizeinfo:4}{numbanks:2}{bank_bits:5}\00 " , section "llvm.metadata"
332
+ @.str.25 = private unnamed_addr constant [49 x i8 ] c "{memory:DEFAULT}{sizeinfo:4}{force_pow2_depth:0}\00 " , section "llvm.metadata"
333
+ @.str.26 = private unnamed_addr constant [49 x i8 ] c "{memory:DEFAULT}{sizeinfo:4}{force_pow2_depth:1}\00 " , section "llvm.metadata"
303
334
304
335
; Function Attrs: norecurse nounwind
305
336
define spir_kernel void @_ZTSZ4mainE15kernel_function () #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 {
@@ -338,6 +369,8 @@ entry:
338
369
call spir_func void @_Z21simple_dual_port_attrv ()
339
370
call spir_func void @_Z14bank_bits_attrv ()
340
371
call spir_func void @_Z20templ_bank_bits_attrILi4ELi5EEvv ()
372
+ call spir_func void @_Z21force_pow2_depth_attrv ()
373
+ call spir_func void @_Z27templ_force_pow2_depth_attrILi1EEvv ()
341
374
ret void
342
375
}
343
376
@@ -733,6 +766,54 @@ entry:
733
766
ret void
734
767
}
735
768
769
+ ; Function Attrs: norecurse nounwind
770
+ define spir_func void @_Z21force_pow2_depth_attrv () #3 {
771
+ entry:
772
+ %fp2d_var = alloca i32 , align 4
773
+ %s = alloca %struct.fp2d_st , align 4
774
+ %0 = bitcast i32* %fp2d_var to i8*
775
+ call void @llvm.lifetime.start.p0i8 (i64 4 , i8* %0 ) #5
776
+ %fp2d_var1 = bitcast i32* %fp2d_var to i8*
777
+ ; CHECK-LLVM: call void @llvm.var.annotation(i8* %{{[a-zA-Z0-9_]+}}, i8* getelementptr inbounds ([{{[0-9]+}} x i8], [{{[0-9]+}} x i8]* [[STR_FP2_VAR]], i32 0, i32 0), i8* undef, i32 undef)
778
+ call void @llvm.var.annotation (i8* %fp2d_var1 , i8* getelementptr inbounds ([49 x i8 ], [49 x i8 ]* @.str.25 , i32 0 , i32 0 ), i8* getelementptr inbounds ([25 x i8 ], [25 x i8 ]* @.str.1 , i32 0 , i32 0 ), i32 151 )
779
+ %1 = bitcast %struct.fp2d_st* %s to i8*
780
+ call void @llvm.lifetime.start.p0i8 (i64 4 , i8* %1 ) #5
781
+ %s2 = bitcast %struct.fp2d_st* %s to i8*
782
+ ; CHECK-LLVM: call void @llvm.var.annotation(i8* %{{[a-zA-Z0-9_]+}}, i8* getelementptr inbounds ([{{[0-9]+}} x i8], [{{[0-9]+}} x i8]* [[STR_FP2_SCT]], i32 0, i32 0), i8* undef, i32 undef)
783
+ call void @llvm.var.annotation (i8* %s2 , i8* getelementptr inbounds ([49 x i8 ], [49 x i8 ]* @.str.26 , i32 0 , i32 0 ), i8* getelementptr inbounds ([25 x i8 ], [25 x i8 ]* @.str.1 , i32 0 , i32 0 ), i32 155 )
784
+ %field = getelementptr inbounds %struct.fp2d_st , %struct.fp2d_st* %s , i32 0 , i32 0
785
+ store i32 0 , i32* %field , align 4 , !tbaa !41
786
+ %2 = bitcast %struct.fp2d_st* %s to i8*
787
+ call void @llvm.lifetime.end.p0i8 (i64 4 , i8* %2 ) #5
788
+ %3 = bitcast i32* %fp2d_var to i8*
789
+ call void @llvm.lifetime.end.p0i8 (i64 4 , i8* %3 ) #5
790
+ ret void
791
+ }
792
+
793
+ ; Function Attrs: norecurse nounwind
794
+ define linkonce_odr spir_func void @_Z27templ_force_pow2_depth_attrILi1EEvv () #3 {
795
+ entry:
796
+ %templ_fp2d_var = alloca i32 , align 4
797
+ %s = alloca %struct.templ_fp2d_st , align 4
798
+ %0 = bitcast i32* %templ_fp2d_var to i8*
799
+ call void @llvm.lifetime.start.p0i8 (i64 4 , i8* %0 ) #5
800
+ %templ_fp2d_var1 = bitcast i32* %templ_fp2d_var to i8*
801
+ ; CHECK-LLVM: call void @llvm.var.annotation(i8* %{{[a-zA-Z0-9_]+}}, i8* getelementptr inbounds ([{{[0-9]+}} x i8], [{{[0-9]+}} x i8]* [[STR_FP2_TE1]], i32 0, i32 0), i8* undef, i32 undef)
802
+ call void @llvm.var.annotation (i8* %templ_fp2d_var1 , i8* getelementptr inbounds ([49 x i8 ], [49 x i8 ]* @.str.26 , i32 0 , i32 0 ), i8* getelementptr inbounds ([25 x i8 ], [25 x i8 ]* @.str.1 , i32 0 , i32 0 ), i32 161 )
803
+ %1 = bitcast %struct.templ_fp2d_st* %s to i8*
804
+ call void @llvm.lifetime.start.p0i8 (i64 4 , i8* %1 ) #5
805
+ %s2 = bitcast %struct.templ_fp2d_st* %s to i8*
806
+ ; CHECK-LLVM: call void @llvm.var.annotation(i8* %{{[a-zA-Z0-9_]+}}, i8* getelementptr inbounds ([{{[0-9]+}} x i8], [{{[0-9]+}} x i8]* [[STR_FP2_TE2]], i32 0, i32 0), i8* undef, i32 undef)
807
+ call void @llvm.var.annotation (i8* %s2 , i8* getelementptr inbounds ([49 x i8 ], [49 x i8 ]* @.str.26 , i32 0 , i32 0 ), i8* getelementptr inbounds ([25 x i8 ], [25 x i8 ]* @.str.1 , i32 0 , i32 0 ), i32 165 )
808
+ %field = getelementptr inbounds %struct.templ_fp2d_st , %struct.templ_fp2d_st* %s , i32 0 , i32 0
809
+ store i32 0 , i32* %field , align 4 , !tbaa !43
810
+ %2 = bitcast %struct.templ_fp2d_st* %s to i8*
811
+ call void @llvm.lifetime.end.p0i8 (i64 4 , i8* %2 ) #5
812
+ %3 = bitcast i32* %templ_fp2d_var to i8*
813
+ call void @llvm.lifetime.end.p0i8 (i64 4 , i8* %3 ) #5
814
+ ret void
815
+ }
816
+
736
817
attributes #0 = { norecurse nounwind "correctly-rounded-divide-sqrt-fp-math" ="false" "disable-tail-calls" ="false" "frame-pointer" ="none" "less-precise-fpmad" ="false" "min-legal-vector-width" ="0" "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" "sycl-module-id" ="intel-fpga-local-var.cpp" "uniform-work-group-size" ="true" "unsafe-fp-math" ="false" "use-soft-float" ="false" }
737
818
attributes #1 = { argmemonly nounwind willreturn }
738
819
attributes #2 = { inlinehint norecurse nounwind "correctly-rounded-divide-sqrt-fp-math" ="false" "disable-tail-calls" ="false" "frame-pointer" ="none" "less-precise-fpmad" ="false" "min-legal-vector-width" ="0" "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" }
@@ -786,3 +867,7 @@ attributes #5 = { nounwind }
786
867
!38 = !{!"_ZTSZ14bank_bits_attrvE12bank_bits_st" , !11 , i64 0 }
787
868
!39 = !{!40 , !11 , i64 0 }
788
869
!40 = !{!"_ZTSZ20templ_bank_bits_attrILi4ELi5EEvvE18templ_bank_bits_st" , !11 , i64 0 }
870
+ !41 = !{!42 , !11 , i64 0 }
871
+ !42 = !{!"_ZTSZ21force_pow2_depth_attrvE7fp2d_st" , !11 , i64 0 }
872
+ !43 = !{!44 , !11 , i64 0 }
873
+ !44 = !{!"_ZTSZ27templ_force_pow2_depth_attrILi1EEvvE13templ_fp2d_st" , !11 , i64 0 }
0 commit comments