brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 0f9a08a Raw
34 lines · plain
1; RUN: opt -mtriple=amdgcn-amd-amdhsa -mcpu=gfx942 -passes='amdgpu-attributor,amdgpu-preload-kernel-arguments,function(amdgpu-lower-kernel-arguments)' -amdgpu-kernarg-preload-count=16 -S < %s 2>&1 \2; RUN: | FileCheck --match-full-lines --implicit-check-not='declare' %s3 4; Confirms we do not leave behind a declaration which references the same5; DISubprogram metadata.6 7; CHECK: define amdgpu_kernel void @preload_block_count_x{{.*}} !dbg ![[#]] !max_work_group_size ![[#]] {8; CHECK-NOT: declare void @0{{.*}} #[[#]]9; CHECK: declare noundef align 4 ptr addrspace(4) @llvm.amdgcn.implicitarg.ptr() #[[#]]10; CHECK: declare noundef align 4 ptr addrspace(4) @llvm.amdgcn.kernarg.segment.ptr() #[[#]]11 12define amdgpu_kernel void @preload_block_count_x(ptr addrspace(1) %out) !dbg !4 !max_work_group_size !7 {13  %imp_arg_ptr = call ptr addrspace(4) @llvm.amdgcn.implicitarg.ptr()14  %load = load i32, ptr addrspace(4) %imp_arg_ptr, align 415  store i32 %load, ptr addrspace(1) %out, align 416  ret void17}18 19declare noundef align 4 ptr addrspace(4) @llvm.amdgcn.implicitarg.ptr() #020 21attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }22 23!llvm.dbg.cu = !{!0}24!llvm.module.flags = !{!2, !3}25 26!0 = distinct !DICompileUnit(language: DW_LANG_OpenCL, file: !1, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)27!1 = !DIFile(filename: "<stdin>", directory: "/")28!2 = !{i32 7, !"Dwarf Version", i32 5}29!3 = !{i32 2, !"Debug Info Version", i32 3}30!4 = distinct !DISubprogram(name: "test", scope: !1, file: !1, line: 1, type: !5, scopeLine: 1, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0)31!5 = !DISubroutineType(cc: DW_CC_LLVM_DeviceKernel, types: !6)32!6 = !{null}33!7 = !{i32 1024, i32 1, i32 1}34