| 1 |
; RUN: llvm-as %s -o %t.bc |
| 2 |
; RUN: llvm-spirv %t.bc -o %t.spv |
| 3 |
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o %t.rev.bc |
| 4 |
; RUN: llvm-dis %t.rev.bc -o - | FileCheck %s |
| 5 |
|
| 6 |
; ModuleID = 'sycl_array_zero_init.cpp' |
| 7 |
source_filename = "sycl_array_zero_init.cpp" |
| 8 |
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024" |
| 9 |
target triple = "spir64-unknown-linux" |
| 10 |
|
| 11 |
%array = type { [3 x i64] } |
| 12 |
|
| 13 |
$main = comdat any |
| 14 |
|
| 15 |
@constinit = private addrspace(4) global [3 x i64] zeroinitializer, align 8 |
| 16 |
|
| 17 |
define weak_odr dso_local spir_kernel void @main() #0 comdat !kernel_arg_addr_space !4 !kernel_arg_access_qual !4 !kernel_arg_type !4 !kernel_arg_base_type !4 !kernel_arg_type_qual !4 { |
| 18 |
%1 = alloca %array, align 8 |
| 19 |
%2 = bitcast %array* %1 to i8* |
| 20 |
call void @llvm.lifetime.start.p0i8(i64 24, i8* %2) #2 |
| 21 |
%3 = addrspacecast %array* %1 to %array addrspace(4)* |
| 22 |
%4 = getelementptr inbounds %array, %array addrspace(4)* %3, i32 0, i32 0 |
| 23 |
%5 = bitcast [3 x i64] addrspace(4)* %4 to i8 addrspace(4)* |
| 24 |
; CHECK: %[[V_ARR:[0-9]+]] = bitcast ptr addrspace(4) %{{[0-9]+}} to ptr addrspace(4) |
| 25 |
%6 = bitcast [3 x i64] addrspace(4)* @constinit to i8 addrspace(4)* |
| 26 |
; CHECK: %[[#CONST_INIT:]] = bitcast ptr addrspace(4) @constinit to ptr addrspace(4) |
| 27 |
call void @llvm.memcpy.p4i8.p4i8.i64(i8 addrspace(4)* align 8 %5, i8 addrspace(4)* align 8 %6, i64 24, i1 false), !tbaa.struct !7 |
| 28 |
; CHECK: call void @llvm.memcpy.p4.p4.i64(ptr addrspace(4) align 8 %[[V_ARR]], ptr addrspace(4) align 8 %[[#CONST_INIT]], i64 24, i1 false) |
| 29 |
%7 = bitcast %array* %1 to i8* |
| 30 |
call void @llvm.lifetime.end.p0i8(i64 24, i8* %7) #2 |
| 31 |
ret void |
| 32 |
} |
| 33 |
|
| 34 |
; Function Attrs: argmemonly nounwind |
| 35 |
declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1 |
| 36 |
|
| 37 |
; Function Attrs: argmemonly nounwind |
| 38 |
declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1 |
| 39 |
|
| 40 |
; Function Attrs: argmemonly nounwind |
| 41 |
declare void @llvm.memcpy.p4i8.p4i8.i64(i8 addrspace(4)* nocapture writeonly, i8 addrspace(4)* nocapture readonly, i64, i1 immarg) #1 |
| 42 |
|
| 43 |
attributes #0 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "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" } |
| 44 |
attributes #1 = { argmemonly nounwind } |
| 45 |
attributes #2 = { nounwind } |
| 46 |
|
| 47 |
!llvm.module.flags = !{!0} |
| 48 |
!opencl.spir.version = !{!1} |
| 49 |
!spirv.Source = !{!2} |
| 50 |
!llvm.ident = !{!3} |
| 51 |
|
| 52 |
!0 = !{i32 1, !"wchar_size", i32 4} |
| 53 |
!1 = !{i32 1, i32 2} |
| 54 |
!2 = !{i32 4, i32 100000} |
| 55 |
!3 = !{!"clang version 9.0.0"} |
| 56 |
!4 = !{} |
| 57 |
!5 = !{!"omnipotent char", !6, i64 0} |
| 58 |
!6 = !{!"Simple C++ TBAA"} |
| 59 |
!7 = !{i64 0, i64 24, !8} |
| 60 |
!8 = !{!5, !5, i64 0} |