blob: 7eacdc1cdaba0068e473c1dc2e5da7f9b07aff17 [file] [log] [blame]
Konstantin Zhuravlyova25e0522018-11-15 02:32:43 +00001; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx700 -mattr=-code-object-v3,+amdgpu-debugger-emit-prologue,+amdgpu-debugger-insert-nops -filetype=obj -o - < %s | llvm-readobj -elf-output-style=GNU -notes | FileCheck --check-prefix=CHECK --check-prefix=GFX700 --check-prefix=NOTES %s
2; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx802 -mattr=-code-object-v3,+amdgpu-debugger-emit-prologue,+amdgpu-debugger-insert-nops -filetype=obj -o - < %s | llvm-readobj -elf-output-style=GNU -notes | FileCheck --check-prefix=CHECK --check-prefix=GFX802 --check-prefix=NOTES %s
3; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -mattr=-code-object-v3,+amdgpu-debugger-emit-prologue,+amdgpu-debugger-insert-nops -filetype=obj -o - < %s | llvm-readobj -elf-output-style=GNU -notes | FileCheck --check-prefix=CHECK --check-prefix=GFX900 --check-prefix=NOTES %s
Yaxun Liu4d9a4d72017-11-16 02:54:49 +00004target datalayout = "A5"
Konstantin Zhuravlyova780ffa2017-03-22 23:10:46 +00005
6declare void @llvm.dbg.declare(metadata, metadata, metadata)
7
8; CHECK: ---
9; CHECK: Version: [ 1, 0 ]
10
11; CHECK: Kernels:
Konstantin Zhuravlyova01d8b02017-10-14 19:03:51 +000012; CHECK: - Name: test
13; CHECK: SymbolName: 'test@kd'
Konstantin Zhuravlyova780ffa2017-03-22 23:10:46 +000014; CHECK: DebugProps:
15; CHECK: DebuggerABIVersion: [ 1, 0 ]
Konstantin Zhuravlyova780ffa2017-03-22 23:10:46 +000016; CHECK: PrivateSegmentBufferSGPR: 0
17; CHECK: WavefrontPrivateSegmentOffsetSGPR: 11
18define amdgpu_kernel void @test(i32 addrspace(1)* %A) #0 !dbg !7 !kernel_arg_addr_space !12 !kernel_arg_access_qual !13 !kernel_arg_type !14 !kernel_arg_base_type !14 !kernel_arg_type_qual !15 {
19entry:
Yaxun Liu4d9a4d72017-11-16 02:54:49 +000020 %A.addr = alloca i32 addrspace(1)*, align 4, addrspace(5)
21 store i32 addrspace(1)* %A, i32 addrspace(1)* addrspace(5)* %A.addr, align 4
22 call void @llvm.dbg.declare(metadata i32 addrspace(1)* addrspace(5)* %A.addr, metadata !16, metadata !17), !dbg !18
23 %0 = load i32 addrspace(1)*, i32 addrspace(1)* addrspace(5)* %A.addr, align 4, !dbg !19
Konstantin Zhuravlyova780ffa2017-03-22 23:10:46 +000024 %arrayidx = getelementptr inbounds i32, i32 addrspace(1)* %0, i64 0, !dbg !19
25 store i32 777, i32 addrspace(1)* %arrayidx, align 4, !dbg !20
Yaxun Liu4d9a4d72017-11-16 02:54:49 +000026 %1 = load i32 addrspace(1)*, i32 addrspace(1)* addrspace(5)* %A.addr, align 4, !dbg !21
Konstantin Zhuravlyova780ffa2017-03-22 23:10:46 +000027 %arrayidx1 = getelementptr inbounds i32, i32 addrspace(1)* %1, i64 1, !dbg !21
28 store i32 888, i32 addrspace(1)* %arrayidx1, align 4, !dbg !22
Yaxun Liu4d9a4d72017-11-16 02:54:49 +000029 %2 = load i32 addrspace(1)*, i32 addrspace(1)* addrspace(5)* %A.addr, align 4, !dbg !23
Konstantin Zhuravlyova780ffa2017-03-22 23:10:46 +000030 %arrayidx2 = getelementptr inbounds i32, i32 addrspace(1)* %2, i64 2, !dbg !23
31 store i32 999, i32 addrspace(1)* %arrayidx2, align 4, !dbg !24
32 ret void, !dbg !25
33}
34
Konstantin Zhuravlyova25e0522018-11-15 02:32:43 +000035attributes #0 = { noinline nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "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" "target-cpu"="gfx800" "target-features"="+16-bit-insts,-code-object-v3,+amdgpu-debugger-emit-prologue,+amdgpu-debugger-insert-nops,+amdgpu-debugger-reserve-regs,+dpp,+fp64-fp16-denormals,+s-memrealtime,-fp32-denormals" "unsafe-fp-math"="false" "use-soft-float"="false" }
Konstantin Zhuravlyova780ffa2017-03-22 23:10:46 +000036
37!llvm.dbg.cu = !{!0}
38!opencl.ocl.version = !{!3}
39!llvm.module.flags = !{!4, !5}
40!llvm.ident = !{!6}
41
42!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 5.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
43!1 = !DIFile(filename: "code-object-metadata-kernel-debug-props.cl", directory: "/some/random/directory")
44!2 = !{}
45!3 = !{i32 1, i32 0}
46!4 = !{i32 2, !"Dwarf Version", i32 2}
47!5 = !{i32 2, !"Debug Info Version", i32 3}
48!6 = !{!"clang version 5.0.0"}
Shiva Chen2c864552018-05-09 02:40:45 +000049!7 = distinct !DISubprogram(name: "test", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
Konstantin Zhuravlyova780ffa2017-03-22 23:10:46 +000050!8 = !DISubroutineType(types: !9)
51!9 = !{null, !10}
52!10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !11, size: 64)
53!11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
54!12 = !{i32 1}
55!13 = !{!"none"}
Yaxun Liu4d9a4d72017-11-16 02:54:49 +000056!14 = !{!"int addrspace(5)*"}
Konstantin Zhuravlyova780ffa2017-03-22 23:10:46 +000057!15 = !{!""}
58!16 = !DILocalVariable(name: "A", arg: 1, scope: !7, file: !1, line: 1, type: !10)
59!17 = !DIExpression(DW_OP_constu, 1, DW_OP_swap, DW_OP_xderef)
60!18 = !DILocation(line: 1, column: 30, scope: !7)
61!19 = !DILocation(line: 2, column: 3, scope: !7)
62!20 = !DILocation(line: 2, column: 8, scope: !7)
63!21 = !DILocation(line: 3, column: 3, scope: !7)
64!22 = !DILocation(line: 3, column: 8, scope: !7)
65!23 = !DILocation(line: 4, column: 3, scope: !7)
66!24 = !DILocation(line: 4, column: 8, scope: !7)
67!25 = !DILocation(line: 5, column: 1, scope: !7)