CuPBoP/examples/btree/kernel_gpu_cuda_wrapper-hos...

554 lines
69 KiB
LLVM
Raw Normal View History

2022-05-04 20:59:38 +08:00
; ModuleID = 'kernel_gpu_cuda_wrapper-host-x86_64-unknown-linux-gnu.bc'
source_filename = "kernel/kernel_gpu_cuda_wrapper.cu"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%struct.knode = type { i32, [257 x i32], [257 x i32], i8, i32 }
%struct.record = type { i32 }
%struct.dim3 = type { i32, i32, i32 }
%struct.CUstream_st = type opaque
$_ZN4dim3C2Ejjj = comdat any
@.str = private unnamed_addr constant [75 x i8] c"# of blocks = %d, # of threads/block = %d (ensure that device can handle)\0A\00", align 1
@.str.1 = private unnamed_addr constant [21 x i8] c"cudaMalloc recordsD\00", align 1
@.str.2 = private unnamed_addr constant [23 x i8] c"cudaMalloc currKnodeD\00", align 1
@.str.3 = private unnamed_addr constant [20 x i8] c"cudaMalloc offsetD\00", align 1
@.str.4 = private unnamed_addr constant [18 x i8] c"cudaMalloc keysD\00", align 1
@.str.5 = private unnamed_addr constant [16 x i8] c"cudaMalloc ansD\00", align 1
@.str.6 = private unnamed_addr constant [27 x i8] c"cudaMalloc cudaMemcpy memD\00", align 1
@.str.7 = private unnamed_addr constant [33 x i8] c"cudaMalloc cudaMemcpy currKnodeD\00", align 1
@.str.8 = private unnamed_addr constant [30 x i8] c"cudaMalloc cudaMemcpy offsetD\00", align 1
@.str.9 = private unnamed_addr constant [28 x i8] c"cudaMalloc cudaMemcpy keysD\00", align 1
@.str.10 = private unnamed_addr constant [27 x i8] c"cudaMalloc cudaMemcpy ansD\00", align 1
@.str.11 = private unnamed_addr constant [6 x i8] c"findK\00", align 1
@.str.12 = private unnamed_addr constant [16 x i8] c"cudaMemcpy ansD\00", align 1
@.str.13 = private unnamed_addr constant [52 x i8] c"Time spent in different stages of GPU_CUDA KERNEL:\0A\00", align 1
@.str.14 = private unnamed_addr constant [54 x i8] c"%15.12f s, %15.12f % : GPU: SET DEVICE / DRIVER INIT\0A\00", align 1
@.str.15 = private unnamed_addr constant [37 x i8] c"%15.12f s, %15.12f % : GPU MEM: ALO\0A\00", align 1
@.str.16 = private unnamed_addr constant [41 x i8] c"%15.12f s, %15.12f % : GPU MEM: COPY IN\0A\00", align 1
@.str.17 = private unnamed_addr constant [36 x i8] c"%15.12f s, %15.12f % : GPU: KERNEL\0A\00", align 1
@.str.18 = private unnamed_addr constant [42 x i8] c"%15.12f s, %15.12f % : GPU MEM: COPY OUT\0A\00", align 1
@.str.19 = private unnamed_addr constant [37 x i8] c"%15.12f s, %15.12f % : GPU MEM: FRE\0A\00", align 1
@.str.20 = private unnamed_addr constant [13 x i8] c"Total time:\0A\00", align 1
@.str.21 = private unnamed_addr constant [9 x i8] c"%.12f s\0A\00", align 1
@0 = private constant [15913 x i8] c"P\EDU\BA\01\00\10\00\18>\00\00\00\00\00\00\02\00\01\01@\00\00\00\A83\00\00\00\00\00\00\00\00\00\00\00\00\00\00\07\00\01\00=\00\00\00\00\00\00\00\00\00\00\00\11\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\7FELF\02\01\013\07\00\00\00\00\00\00\00\02\00\BE\00e\00\00\00\00\00\00\00\00\00\00\00\003\00\00\00\00\00\00\C00\00\00\00\00\00\00=\05=\00@\008\00\03\00@\00\09\00\01\00\00.shstrtab\00.strtab\00.symtab\00.symtab_shndx\00.nv.info\00.text.findK\00.nv.info.findK\00.nv.shared.findK\00.nv.global\00.nv.constant0.findK\00\00.shstrtab\00.strtab\00.symtab\00.symtab_shndx\00.nv.info\00findK\00.text.findK\00.nv.info.findK\00.nv.shared.findK\00.nv.global\00threadIdx\00blockIdx\00.nv.constant0.findK\00_param\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\008\00\00\00\03\00\07\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00d\00\00\00\03\00\08\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00o\00\00\00\01\00\08\00\00\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00y\00\00\00\01\00\08\00\01\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\82\00\00\00\03\00\06\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\002\00\00\00\12\10\07\00\00\00\00\00\00\00\00\00@,\00\00\00\00\00\00\04/\08\00\06\00\00\00\16\00\00\00\04#\08\00\06\00\00\00\00\00\00\00\04\12\08\00\06\00\00\00P\00\00\00\04\11\08\00\06\00\00\00P\00\00\00\010\00\00\01*\00\00\04\0A\08\00\05\00\00\00@\01@\00\03\19@\00\04\17\0C\00\00\00\00\00\07\008\00\00\F0!\00\04\17\0C\00\00\00\00\00\06\000\00\00\F0!\00\04\17\0C\00\00\00\00\00\05\00(\00\00\F0!\00\04\17\0C\00\00\00\00\00\04\00 \00\00\F0!\00\04\17\0C\00\00\00\00\00\03\00\18\00\00\F0!\00\04\17\0C\00\00\00\00\00\02\00\10\00\00\F0!\00\04\17\0C\00\00\00\00\00\01\00\08\00\00\F0!\00\04\17\0C\00\00\00\00\00\00\00\00\00\00\F0!\00\03\1B\FF\00\04\1D\04\00\F0\07\00\00\04\1C\04\00\F8+\00\00\04\1E\04\00p\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\EF\1F\E0\FD\03<d\00\01\00\87\00\80\07\98L\01\01\07\FB\FF\FF\0F\1C\00\00w\03\00\00\C8\F0\EF\1F\E0\FD\03\BC\7F\00\07\01\07\00\80\03l[\0F\00\80\00\00\00@\E2\C0\00\10\00\00\00\A0\E3\EF\1F\E0!\03\BC\7F\00\00\01\F7\0F\00\00\10\\\00\0A\07\00\00\00\E0\\\02\00\07\00\80\07\98\\\EF\1F\E0\FD\03\BC\7F\00\03\00\F7\0F\80\07\98\\\00\00'\00\80\07\98\\\03\007\00\80\07\98\\\EF\1F\E0\FD\03\BC\7F\00\02\00\07\00\80\07\98\\\03\007\00\80\07\98\\\0A\00\17\00\80\07\98L\EF\1F\E0\FD\03\BC\7F\00\00\00\17\04\80\07\98L\0A\02\A7\00\00\80\10\\\00\03\07\00\00\08\10\\\EF\1F\E0!\03\BC\7F\00\02\F0\87\17\00\00\00\01\02\02\07\00\00\00\95\EF\06\00'\00\80\07\98\\\EF\1F\E0\FD\03\BC\7F\00\07\007\00\80\07\98\\\06\00g\00\80\07\98\\\07\00w\00\80\07\98\\\EF\1F\E0!\03\BC\7F\00\02\F0\07\17\00\00\00\01\02\02\07\00\00\00\95\EF\08\00'\00\80\07\98\\\EF\1F\E0\FD\03\BC\7F\00\09\007\00\80\07\98\\\08\00\87\00\80\07\98\\\09\00\97\00\80\07\98\\\EF\1F\E0!\03\BC\7F\00\02\F0\87\16\00\00\00\01\02\02\07\00\00\00\95\EF
@__cuda_fatbin_wrapper = internal constant { i32, i32, i8*, i8* } { i32 1180844977, i32 1, i8* getelementptr inbounds ([15913 x i8], [15913 x i8]* @0, i64 0, i64 0), i8* null }, section ".nvFatBinSegment", align 8
@__cuda_gpubin_handle = internal global i8** null, align 8
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* bitcast (void (i8*)* @__cuda_module_ctor to void ()*), i8* null }]
; Function Attrs: noinline optnone uwtable
define dso_local void @findK(i64 %height, %struct.knode* %knodesD, i64 %knodes_elem, %struct.record* %recordsD, i64* %currKnodeD, i64* %offsetD, i32* %keysD, %struct.record* %ansD) #0 {
entry:
%height.addr = alloca i64, align 8
%knodesD.addr = alloca %struct.knode*, align 8
%knodes_elem.addr = alloca i64, align 8
%recordsD.addr = alloca %struct.record*, align 8
%currKnodeD.addr = alloca i64*, align 8
%offsetD.addr = alloca i64*, align 8
%keysD.addr = alloca i32*, align 8
%ansD.addr = alloca %struct.record*, align 8
%grid_dim = alloca %struct.dim3, align 8
%block_dim = alloca %struct.dim3, align 8
%shmem_size = alloca i64, align 8
%stream = alloca i8*, align 8
%grid_dim.coerce = alloca { i64, i32 }, align 8
%block_dim.coerce = alloca { i64, i32 }, align 8
store i64 %height, i64* %height.addr, align 8
store %struct.knode* %knodesD, %struct.knode** %knodesD.addr, align 8
store i64 %knodes_elem, i64* %knodes_elem.addr, align 8
store %struct.record* %recordsD, %struct.record** %recordsD.addr, align 8
store i64* %currKnodeD, i64** %currKnodeD.addr, align 8
store i64* %offsetD, i64** %offsetD.addr, align 8
store i32* %keysD, i32** %keysD.addr, align 8
store %struct.record* %ansD, %struct.record** %ansD.addr, align 8
%kernel_args = alloca i8*, i64 8, align 16
%0 = bitcast i64* %height.addr to i8*
%1 = getelementptr i8*, i8** %kernel_args, i32 0
store i8* %0, i8** %1
%2 = bitcast %struct.knode** %knodesD.addr to i8*
%3 = getelementptr i8*, i8** %kernel_args, i32 1
store i8* %2, i8** %3
%4 = bitcast i64* %knodes_elem.addr to i8*
%5 = getelementptr i8*, i8** %kernel_args, i32 2
store i8* %4, i8** %5
%6 = bitcast %struct.record** %recordsD.addr to i8*
%7 = getelementptr i8*, i8** %kernel_args, i32 3
store i8* %6, i8** %7
%8 = bitcast i64** %currKnodeD.addr to i8*
%9 = getelementptr i8*, i8** %kernel_args, i32 4
store i8* %8, i8** %9
%10 = bitcast i64** %offsetD.addr to i8*
%11 = getelementptr i8*, i8** %kernel_args, i32 5
store i8* %10, i8** %11
%12 = bitcast i32** %keysD.addr to i8*
%13 = getelementptr i8*, i8** %kernel_args, i32 6
store i8* %12, i8** %13
%14 = bitcast %struct.record** %ansD.addr to i8*
%15 = getelementptr i8*, i8** %kernel_args, i32 7
store i8* %14, i8** %15
%16 = call i32 @__cudaPopCallConfiguration(%struct.dim3* %grid_dim, %struct.dim3* %block_dim, i64* %shmem_size, i8** %stream)
%17 = load i64, i64* %shmem_size, align 8
%18 = load i8*, i8** %stream, align 8
%19 = bitcast { i64, i32 }* %grid_dim.coerce to i8*
%20 = bitcast %struct.dim3* %grid_dim to i8*
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %19, i8* align 8 %20, i64 12, i1 false)
%21 = getelementptr inbounds { i64, i32 }, { i64, i32 }* %grid_dim.coerce, i32 0, i32 0
%22 = load i64, i64* %21, align 8
%23 = getelementptr inbounds { i64, i32 }, { i64, i32 }* %grid_dim.coerce, i32 0, i32 1
%24 = load i32, i32* %23, align 8
%25 = bitcast { i64, i32 }* %block_dim.coerce to i8*
%26 = bitcast %struct.dim3* %block_dim to i8*
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %25, i8* align 8 %26, i64 12, i1 false)
%27 = getelementptr inbounds { i64, i32 }, { i64, i32 }* %block_dim.coerce, i32 0, i32 0
%28 = load i64, i64* %27, align 8
%29 = getelementptr inbounds { i64, i32 }, { i64, i32 }* %block_dim.coerce, i32 0, i32 1
%30 = load i32, i32* %29, align 8
%31 = bitcast i8* %18 to %struct.CUstream_st*
%call = call i32 @cudaLaunchKernel(i8* bitcast (void (i64, %struct.knode*, i64, %struct.record*, i64*, i64*, i32*, %struct.record*)* @findK to i8*), i64 %22, i32 %24, i64 %28, i32 %30, i8** %kernel_args, i64 %17, %struct.CUstream_st* %31)
br label %setup.end
setup.end: ; preds = %entry
ret void
}
declare dso_local i32 @__cudaPopCallConfiguration(%struct.dim3*, %struct.dim3*, i64*, i8**)
declare dso_local i32 @cudaLaunchKernel(i8*, i64, i32, i64, i32, i8**, i64, %struct.CUstream_st*)
; Function Attrs: argmemonly nounwind willreturn
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #1
; Function Attrs: noinline optnone uwtable
define dso_local void @kernel_gpu_cuda_wrapper(%struct.record* %records, i64 %records_mem, %struct.knode* %knodes, i64 %knodes_elem, i64 %knodes_mem, i32 %order, i64 %maxheight, i32 %count, i64* %currKnode, i64* %offset, i32* %keys, %struct.record* %ans) #0 {
entry:
%records.addr = alloca %struct.record*, align 8
%records_mem.addr = alloca i64, align 8
%knodes.addr = alloca %struct.knode*, align 8
%knodes_elem.addr = alloca i64, align 8
%knodes_mem.addr = alloca i64, align 8
%order.addr = alloca i32, align 4
%maxheight.addr = alloca i64, align 8
%count.addr = alloca i32, align 4
%currKnode.addr = alloca i64*, align 8
%offset.addr = alloca i64*, align 8
%keys.addr = alloca i32*, align 8
%ans.addr = alloca %struct.record*, align 8
%time0 = alloca i64, align 8
%time1 = alloca i64, align 8
%time2 = alloca i64, align 8
%time3 = alloca i64, align 8
%time4 = alloca i64, align 8
%time5 = alloca i64, align 8
%time6 = alloca i64, align 8
%numBlocks = alloca i32, align 4
%threadsPerBlock = alloca i32, align 4
%recordsD = alloca %struct.record*, align 8
%knodesD = alloca %struct.knode*, align 8
%currKnodeD = alloca i64*, align 8
%offsetD = alloca i64*, align 8
%keysD = alloca i32*, align 8
%ansD = alloca %struct.record*, align 8
%agg.tmp = alloca %struct.dim3, align 4
%agg.tmp32 = alloca %struct.dim3, align 4
%agg.tmp.coerce = alloca { i64, i32 }, align 4
%agg.tmp32.coerce = alloca { i64, i32 }, align 4
store %struct.record* %records, %struct.record** %records.addr, align 8
store i64 %records_mem, i64* %records_mem.addr, align 8
store %struct.knode* %knodes, %struct.knode** %knodes.addr, align 8
store i64 %knodes_elem, i64* %knodes_elem.addr, align 8
store i64 %knodes_mem, i64* %knodes_mem.addr, align 8
store i32 %order, i32* %order.addr, align 4
store i64 %maxheight, i64* %maxheight.addr, align 8
store i32 %count, i32* %count.addr, align 4
store i64* %currKnode, i64** %currKnode.addr, align 8
store i64* %offset, i64** %offset.addr, align 8
store i32* %keys, i32** %keys.addr, align 8
store %struct.record* %ans, %struct.record** %ans.addr, align 8
%call = call i64 @get_time()
store i64 %call, i64* %time0, align 8
%call1 = call i32 @cudaThreadSynchronize()
%0 = load i32, i32* %count.addr, align 4
store i32 %0, i32* %numBlocks, align 4
%1 = load i32, i32* %order.addr, align 4
%cmp = icmp slt i32 %1, 1024
br i1 %cmp, label %cond.true, label %cond.false
cond.true: ; preds = %entry
%2 = load i32, i32* %order.addr, align 4
br label %cond.end
cond.false: ; preds = %entry
br label %cond.end
cond.end: ; preds = %cond.false, %cond.true
%cond = phi i32 [ %2, %cond.true ], [ 1024, %cond.false ]
store i32 %cond, i32* %threadsPerBlock, align 4
%3 = load i32, i32* %numBlocks, align 4
%4 = load i32, i32* %threadsPerBlock, align 4
%call2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%call3 = call i64 @get_time()
store i64 %call3, i64* %time1, align 8
%5 = bitcast %struct.record** %recordsD to i8**
%6 = load i64, i64* %records_mem.addr, align 8
%call4 = call i32 @cudaMalloc(i8** %5, i64 %6)
call void @checkCUDAError(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%7 = bitcast %struct.knode** %knodesD to i8**
%8 = load i64, i64* %knodes_mem.addr, align 8
%call5 = call i32 @cudaMalloc(i8** %7, i64 %8)
call void @checkCUDAError(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%9 = bitcast i64** %currKnodeD to i8**
%10 = load i32, i32* %count.addr, align 4
%conv = sext i32 %10 to i64
%mul = mul i64 %conv, 8
%call6 = call i32 @cudaMalloc(i8** %9, i64 %mul)
call void @checkCUDAError(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%11 = bitcast i64** %offsetD to i8**
%12 = load i32, i32* %count.addr, align 4
%conv7 = sext i32 %12 to i64
%mul8 = mul i64 %conv7, 8
%call9 = call i32 @cudaMalloc(i8** %11, i64 %mul8)
call void @checkCUDAError(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%13 = bitcast i32** %keysD to i8**
%14 = load i32, i32* %count.addr, align 4
%conv10 = sext i32 %14 to i64
%mul11 = mul i64 %conv10, 4
%call12 = call i32 @cudaMalloc(i8** %13, i64 %mul11)
call void @checkCUDAError(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%15 = bitcast %struct.record** %ansD to i8**
%16 = load i32, i32* %count.addr, align 4
%conv13 = sext i32 %16 to i64
%mul14 = mul i64 %conv13, 4
%call15 = call i32 @cudaMalloc(i8** %15, i64 %mul14)
call void @checkCUDAError(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
%call16 = call i64 @get_time()
store i64 %call16, i64* %time2, align 8
%17 = load %struct.record*, %struct.record** %recordsD, align 8
%18 = bitcast %struct.record* %17 to i8*
%19 = load %struct.record*, %struct.record** %records.addr, align 8
%20 = bitcast %struct.record* %19 to i8*
%21 = load i64, i64* %records_mem.addr, align 8
%call17 = call i32 @cudaMemcpy(i8* %18, i8* %20, i64 %21, i32 1)
call void @checkCUDAError(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0))
%22 = load %struct.knode*, %struct.knode** %knodesD, align 8
%23 = bitcast %struct.knode* %22 to i8*
%24 = load %struct.knode*, %struct.knode** %knodes.addr, align 8
%25 = bitcast %struct.knode* %24 to i8*
%26 = load i64, i64* %knodes_mem.addr, align 8
%call18 = call i32 @cudaMemcpy(i8* %23, i8* %25, i64 %26, i32 1)
call void @checkCUDAError(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0))
%27 = load i64*, i64** %currKnodeD, align 8
%28 = bitcast i64* %27 to i8*
%29 = load i64*, i64** %currKnode.addr, align 8
%30 = bitcast i64* %29 to i8*
%31 = load i32, i32* %count.addr, align 4
%conv19 = sext i32 %31 to i64
%mul20 = mul i64 %conv19, 8
%call21 = call i32 @cudaMemcpy(i8* %28, i8* %30, i64 %mul20, i32 1)
call void @checkCUDAError(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0))
%32 = load i64*, i64** %offsetD, align 8
%33 = bitcast i64* %32 to i8*
%34 = load i64*, i64** %offset.addr, align 8
%35 = bitcast i64* %34 to i8*
%36 = load i32, i32* %count.addr, align 4
%conv22 = sext i32 %36 to i64
%mul23 = mul i64 %conv22, 8
%call24 = call i32 @cudaMemcpy(i8* %33, i8* %35, i64 %mul23, i32 1)
call void @checkCUDAError(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0))
%37 = load i32*, i32** %keysD, align 8
%38 = bitcast i32* %37 to i8*
%39 = load i32*, i32** %keys.addr, align 8
%40 = bitcast i32* %39 to i8*
%41 = load i32, i32* %count.addr, align 4
%conv25 = sext i32 %41 to i64
%mul26 = mul i64 %conv25, 4
%call27 = call i32 @cudaMemcpy(i8* %38, i8* %40, i64 %mul26, i32 1)
call void @checkCUDAError(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0))
%42 = load %struct.record*, %struct.record** %ansD, align 8
%43 = bitcast %struct.record* %42 to i8*
%44 = load %struct.record*, %struct.record** %ans.addr, align 8
%45 = bitcast %struct.record* %44 to i8*
%46 = load i32, i32* %count.addr, align 4
%conv28 = sext i32 %46 to i64
%mul29 = mul i64 %conv28, 4
%call30 = call i32 @cudaMemcpy(i8* %43, i8* %45, i64 %mul29, i32 1)
call void @checkCUDAError(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0))
%call31 = call i64 @get_time()
store i64 %call31, i64* %time3, align 8
%47 = load i32, i32* %numBlocks, align 4
call void @_ZN4dim3C2Ejjj(%struct.dim3* %agg.tmp, i32 %47, i32 1, i32 1)
%48 = load i32, i32* %threadsPerBlock, align 4
call void @_ZN4dim3C2Ejjj(%struct.dim3* %agg.tmp32, i32 %48, i32 1, i32 1)
%49 = bitcast { i64, i32 }* %agg.tmp.coerce to i8*
%50 = bitcast %struct.dim3* %agg.tmp to i8*
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %49, i8* align 4 %50, i64 12, i1 false)
%51 = getelementptr inbounds { i64, i32 }, { i64, i32 }* %agg.tmp.coerce, i32 0, i32 0
%52 = load i64, i64* %51, align 4
%53 = getelementptr inbounds { i64, i32 }, { i64, i32 }* %agg.tmp.coerce, i32 0, i32 1
%54 = load i32, i32* %53, align 4
%55 = bitcast { i64, i32 }* %agg.tmp32.coerce to i8*
%56 = bitcast %struct.dim3* %agg.tmp32 to i8*
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %55, i8* align 4 %56, i64 12, i1 false)
%57 = getelementptr inbounds { i64, i32 }, { i64, i32 }* %agg.tmp32.coerce, i32 0, i32 0
%58 = load i64, i64* %57, align 4
%59 = getelementptr inbounds { i64, i32 }, { i64, i32 }* %agg.tmp32.coerce, i32 0, i32 1
%60 = load i32, i32* %59, align 4
%call33 = call i32 @__cudaPushCallConfiguration(i64 %52, i32 %54, i64 %58, i32 %60, i64 0, i8* null)
%tobool = icmp ne i32 %call33, 0
br i1 %tobool, label %kcall.end, label %kcall.configok
kcall.configok: ; preds = %cond.end
%61 = load i64, i64* %maxheight.addr, align 8
%62 = load %struct.knode*, %struct.knode** %knodesD, align 8
%63 = load i64, i64* %knodes_elem.addr, align 8
%64 = load %struct.record*, %struct.record** %recordsD, align 8
%65 = load i64*, i64** %currKnodeD, align 8
%66 = load i64*, i64** %offsetD, align 8
%67 = load i32*, i32** %keysD, align 8
%68 = load %struct.record*, %struct.record** %ansD, align 8
call void @findK(i64 %61, %struct.knode* %62, i64 %63, %struct.record* %64, i64* %65, i64* %66, i32* %67, %struct.record* %68)
br label %kcall.end
kcall.end: ; preds = %kcall.configok, %cond.end
%call34 = call i32 @cudaThreadSynchronize()
call void @checkCUDAError(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0))
%call35 = call i64 @get_time()
store i64 %call35, i64* %time4, align 8
%69 = load %struct.record*, %struct.record** %ans.addr, align 8
%70 = bitcast %struct.record* %69 to i8*
%71 = load %struct.record*, %struct.record** %ansD, align 8
%72 = bitcast %struct.record* %71 to i8*
%73 = load i32, i32* %count.addr, align 4
%conv36 = sext i32 %73 to i64
%mul37 = mul i64 %conv36, 4
%call38 = call i32 @cudaMemcpy(i8* %70, i8* %72, i64 %mul37, i32 2)
call void @checkCUDAError(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.12, i64 0, i64 0))
%call39 = call i64 @get_time()
store i64 %call39, i64* %time5, align 8
%74 = load %struct.record*, %struct.record** %recordsD, align 8
%75 = bitcast %struct.record* %74 to i8*
%call40 = call i32 @cudaFree(i8* %75)
%76 = load %struct.knode*, %struct.knode** %knodesD, align 8
%77 = bitcast %struct.knode* %76 to i8*
%call41 = call i32 @cudaFree(i8* %77)
%78 = load i64*, i64** %currKnodeD, align 8
%79 = bitcast i64* %78 to i8*
%call42 = call i32 @cudaFree(i8* %79)
%80 = load i64*, i64** %offsetD, align 8
%81 = bitcast i64* %80 to i8*
%call43 = call i32 @cudaFree(i8* %81)
%82 = load i32*, i32** %keysD, align 8
%83 = bitcast i32* %82 to i8*
%call44 = call i32 @cudaFree(i8* %83)
%84 = load %struct.record*, %struct.record** %ansD, align 8
%85 = bitcast %struct.record* %84 to i8*
%call45 = call i32 @cudaFree(i8* %85)
%call46 = call i64 @get_time()
store i64 %call46, i64* %time6, align 8
%call47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.13, i64 0, i64 0))
%86 = load i64, i64* %time1, align 8
%87 = load i64, i64* %time0, align 8
%sub = sub nsw i64 %86, %87
%conv48 = sitofp i64 %sub to float
%div = fdiv float %conv48, 1.000000e+06
%conv49 = fpext float %div to double
%88 = load i64, i64* %time1, align 8
%89 = load i64, i64* %time0, align 8
%sub50 = sub nsw i64 %88, %89
%conv51 = sitofp i64 %sub50 to float
%90 = load i64, i64* %time6, align 8
%91 = load i64, i64* %time0, align 8
%sub52 = sub nsw i64 %90, %91
%conv53 = sitofp i64 %sub52 to float
%div54 = fdiv float %conv51, %conv53
%mul55 = fmul contract float %div54, 1.000000e+02
%conv56 = fpext float %mul55 to double
%call57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.14, i64 0, i64 0), double %conv49, double %conv56)
%92 = load i64, i64* %time2, align 8
%93 = load i64, i64* %time1, align 8
%sub58 = sub nsw i64 %92, %93
%conv59 = sitofp i64 %sub58 to float
%div60 = fdiv float %conv59, 1.000000e+06
%conv61 = fpext float %div60 to double
%94 = load i64, i64* %time2, align 8
%95 = load i64, i64* %time1, align 8
%sub62 = sub nsw i64 %94, %95
%conv63 = sitofp i64 %sub62 to float
%96 = load i64, i64* %time6, align 8
%97 = load i64, i64* %time0, align 8
%sub64 = sub nsw i64 %96, %97
%conv65 = sitofp i64 %sub64 to float
%div66 = fdiv float %conv63, %conv65
%mul67 = fmul contract float %div66, 1.000000e+02
%conv68 = fpext float %mul67 to double
%call69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.15, i64 0, i64 0), double %conv61, double %conv68)
%98 = load i64, i64* %time3, align 8
%99 = load i64, i64* %time2, align 8
%sub70 = sub nsw i64 %98, %99
%conv71 = sitofp i64 %sub70 to float
%div72 = fdiv float %conv71, 1.000000e+06
%conv73 = fpext float %div72 to double
%100 = load i64, i64* %time3, align 8
%101 = load i64, i64* %time2, align 8
%sub74 = sub nsw i64 %100, %101
%conv75 = sitofp i64 %sub74 to float
%102 = load i64, i64* %time6, align 8
%103 = load i64, i64* %time0, align 8
%sub76 = sub nsw i64 %102, %103
%conv77 = sitofp i64 %sub76 to float
%div78 = fdiv float %conv75, %conv77
%mul79 = fmul contract float %div78, 1.000000e+02
%conv80 = fpext float %mul79 to double
%call81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.16, i64 0, i64 0), double %conv73, double %conv80)
%104 = load i64, i64* %time4, align 8
%105 = load i64, i64* %time3, align 8
%sub82 = sub nsw i64 %104, %105
%conv83 = sitofp i64 %sub82 to float
%div84 = fdiv float %conv83, 1.000000e+06
%conv85 = fpext float %div84 to double
%106 = load i64, i64* %time4, align 8
%107 = load i64, i64* %time3, align 8
%sub86 = sub nsw i64 %106, %107
%conv87 = sitofp i64 %sub86 to float
%108 = load i64, i64* %time6, align 8
%109 = load i64, i64* %time0, align 8
%sub88 = sub nsw i64 %108, %109
%conv89 = sitofp i64 %sub88 to float
%div90 = fdiv float %conv87, %conv89
%mul91 = fmul contract float %div90, 1.000000e+02
%conv92 = fpext float %mul91 to double
%call93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.17, i64 0, i64 0), double %conv85, double %conv92)
%110 = load i64, i64* %time5, align 8
%111 = load i64, i64* %time4, align 8
%sub94 = sub nsw i64 %110, %111
%conv95 = sitofp i64 %sub94 to float
%div96 = fdiv float %conv95, 1.000000e+06
%conv97 = fpext float %div96 to double
%112 = load i64, i64* %time5, align 8
%113 = load i64, i64* %time4, align 8
%sub98 = sub nsw i64 %112, %113
%conv99 = sitofp i64 %sub98 to float
%114 = load i64, i64* %time6, align 8
%115 = load i64, i64* %time0, align 8
%sub100 = sub nsw i64 %114, %115
%conv101 = sitofp i64 %sub100 to float
%div102 = fdiv float %conv99, %conv101
%mul103 = fmul contract float %div102, 1.000000e+02
%conv104 = fpext float %mul103 to double
%call105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.18, i64 0, i64 0), double %conv97, double %conv104)
%116 = load i64, i64* %time6, align 8
%117 = load i64, i64* %time5, align 8
%sub106 = sub nsw i64 %116, %117
%conv107 = sitofp i64 %sub106 to float
%div108 = fdiv float %conv107, 1.000000e+06
%conv109 = fpext float %div108 to double
%118 = load i64, i64* %time6, align 8
%119 = load i64, i64* %time5, align 8
%sub110 = sub nsw i64 %118, %119
%conv111 = sitofp i64 %sub110 to float
%120 = load i64, i64* %time6, align 8
%121 = load i64, i64* %time0, align 8
%sub112 = sub nsw i64 %120, %121
%conv113 = sitofp i64 %sub112 to float
%div114 = fdiv float %conv111, %conv113
%mul115 = fmul contract float %div114, 1.000000e+02
%conv116 = fpext float %mul115 to double
%call117 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.19, i64 0, i64 0), double %conv109, double %conv116)
%call118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.20, i64 0, i64 0))
%122 = load i64, i64* %time6, align 8
%123 = load i64, i64* %time0, align 8
%sub119 = sub nsw i64 %122, %123
%conv120 = sitofp i64 %sub119 to float
%div121 = fdiv float %conv120, 1.000000e+06
%conv122 = fpext float %div121 to double
%call123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.21, i64 0, i64 0), double %conv122)
ret void
}
declare dso_local i64 @get_time() #2
declare dso_local i32 @cudaThreadSynchronize() #2
declare dso_local i32 @printf(i8*, ...) #2
declare dso_local i32 @cudaMalloc(i8**, i64) #2
declare dso_local void @checkCUDAError(i8*) #2
declare dso_local i32 @cudaMemcpy(i8*, i8*, i64, i32) #2
declare dso_local i32 @__cudaPushCallConfiguration(i64, i32, i64, i32, i64, i8*) #2
; Function Attrs: noinline nounwind optnone uwtable
define linkonce_odr dso_local void @_ZN4dim3C2Ejjj(%struct.dim3* %this, i32 %vx, i32 %vy, i32 %vz) unnamed_addr #3 comdat align 2 {
entry:
%this.addr = alloca %struct.dim3*, align 8
%vx.addr = alloca i32, align 4
%vy.addr = alloca i32, align 4
%vz.addr = alloca i32, align 4
store %struct.dim3* %this, %struct.dim3** %this.addr, align 8
store i32 %vx, i32* %vx.addr, align 4
store i32 %vy, i32* %vy.addr, align 4
store i32 %vz, i32* %vz.addr, align 4
%this1 = load %struct.dim3*, %struct.dim3** %this.addr, align 8
%x = getelementptr inbounds %struct.dim3, %struct.dim3* %this1, i32 0, i32 0
%0 = load i32, i32* %vx.addr, align 4
store i32 %0, i32* %x, align 4
%y = getelementptr inbounds %struct.dim3, %struct.dim3* %this1, i32 0, i32 1
%1 = load i32, i32* %vy.addr, align 4
store i32 %1, i32* %y, align 4
%z = getelementptr inbounds %struct.dim3, %struct.dim3* %this1, i32 0, i32 2
%2 = load i32, i32* %vz.addr, align 4
store i32 %2, i32* %z, align 4
ret void
}
declare dso_local i32 @cudaFree(i8*) #2
define internal void @__cuda_register_globals(i8** %0) {
entry:
%1 = call i32 @__cudaRegisterFunction(i8** %0, i8* bitcast (void (i64, %struct.knode*, i64, %struct.record*, i64*, i64*, i32*, %struct.record*)* @findK to i8*), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i32 -1, i8* null, i8* null, i8* null, i8* null, i32* null)
ret void
}
declare dso_local i32 @__cudaRegisterFunction(i8**, i8*, i8*, i8*, i32, i8*, i8*, i8*, i8*, i32*)
declare dso_local i32 @__cudaRegisterVar(i8**, i8*, i8*, i8*, i32, i32, i32, i32)
declare dso_local i8** @__cudaRegisterFatBinary(i8*)
define internal void @__cuda_module_ctor(i8* %0) {
entry:
%1 = call i8** @__cudaRegisterFatBinary(i8* bitcast ({ i32, i32, i8*, i8* }* @__cuda_fatbin_wrapper to i8*))
store i8** %1, i8*** @__cuda_gpubin_handle, align 8
call void @__cuda_register_globals(i8** %1)
call void @__cudaRegisterFatBinaryEnd(i8** %1)
%2 = call i32 @atexit(void (i8*)* @__cuda_module_dtor)
ret void
}
declare dso_local void @__cudaRegisterFatBinaryEnd(i8**)
declare dso_local void @__cudaUnregisterFatBinary(i8**)
define internal void @__cuda_module_dtor(i8* %0) {
entry:
%1 = load i8**, i8*** @__cuda_gpubin_handle, align 8
call void @__cudaUnregisterFatBinary(i8** %1)
ret void
}
declare dso_local i32 @atexit(void (i8*)*)
attributes #0 = { noinline optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "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" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { argmemonly nounwind willreturn }
attributes #2 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #3 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "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" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
!llvm.module.flags = !{!0, !1}
!llvm.ident = !{!2}
!0 = !{i32 2, !"SDK Version", [2 x i32] [i32 10, i32 1]}
!1 = !{i32 1, !"wchar_size", i32 4}
!2 = !{!"clang version 10.0.1 (https://github.com/llvm/llvm-project.git ef32c611aa214dea855364efd7ba451ec5ec3f74)"}