blob: d30bb20bb03a97e5c435eb24a991ef8bdbe8aa34 [file] [log] [blame]
Konstantin Zhuravlyov29ddd2b2016-05-24 18:37:18 +00001; RUN: llc -O0 -mtriple=amdgcn--amdhsa -mcpu=fiji -mattr=+amdgpu-debugger-reserve-regs -verify-machineinstrs < %s | FileCheck %s
Konstantin Zhuravlyove34ead82016-05-09 18:05:42 +00002; CHECK: reserved_vgpr_first = {{[0-9]+}}
3; CHECK-NEXT: reserved_vgpr_count = 4
Konstantin Zhuravlyove34ead82016-05-09 18:05:42 +00004; CHECK: ReservedVGPRFirst: {{[0-9]+}}
5; CHECK-NEXT: ReservedVGPRCount: 4
Konstantin Zhuravlyov8c273ad2016-04-18 16:28:23 +00006
7; Function Attrs: nounwind
Konstantin Zhuravlyove34ead82016-05-09 18:05:42 +00008define void @test(i32 addrspace(1)* %A) #0 !dbg !12 {
Konstantin Zhuravlyov8c273ad2016-04-18 16:28:23 +00009entry:
10 %A.addr = alloca i32 addrspace(1)*, align 4
11 store i32 addrspace(1)* %A, i32 addrspace(1)** %A.addr, align 4
12 call void @llvm.dbg.declare(metadata i32 addrspace(1)** %A.addr, metadata !17, metadata !18), !dbg !19
13 %0 = load i32 addrspace(1)*, i32 addrspace(1)** %A.addr, align 4, !dbg !20
14 %arrayidx = getelementptr inbounds i32, i32 addrspace(1)* %0, i32 0, !dbg !20
15 store i32 1, i32 addrspace(1)* %arrayidx, align 4, !dbg !21
16 %1 = load i32 addrspace(1)*, i32 addrspace(1)** %A.addr, align 4, !dbg !22
17 %arrayidx1 = getelementptr inbounds i32, i32 addrspace(1)* %1, i32 1, !dbg !22
18 store i32 2, i32 addrspace(1)* %arrayidx1, align 4, !dbg !23
19 %2 = load i32 addrspace(1)*, i32 addrspace(1)** %A.addr, align 4, !dbg !24
20 %arrayidx2 = getelementptr inbounds i32, i32 addrspace(1)* %2, i32 2, !dbg !24
21 store i32 3, i32 addrspace(1)* %arrayidx2, align 4, !dbg !25
Konstantin Zhuravlyove34ead82016-05-09 18:05:42 +000022 ret void, !dbg !26
Konstantin Zhuravlyov8c273ad2016-04-18 16:28:23 +000023}
24
25; Function Attrs: nounwind readnone
26declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
27
Matt Arsenault45f82162016-07-11 23:35:48 +000028attributes #0 = { nounwind }
Konstantin Zhuravlyov8c273ad2016-04-18 16:28:23 +000029attributes #1 = { nounwind readnone }
30
31!llvm.dbg.cu = !{!0}
32!opencl.kernels = !{!3}
33!llvm.module.flags = !{!9, !10}
34!llvm.ident = !{!11}
35
Konstantin Zhuravlyove34ead82016-05-09 18:05:42 +000036!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 (trunk 268929)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
37!1 = !DIFile(filename: "test01.cl", directory: "/home/kzhuravl/Lightning/testing")
Konstantin Zhuravlyov8c273ad2016-04-18 16:28:23 +000038!2 = !{}
Konstantin Zhuravlyove34ead82016-05-09 18:05:42 +000039!3 = !{void (i32 addrspace(1)*)* @test, !4, !5, !6, !7, !8}
Konstantin Zhuravlyov8c273ad2016-04-18 16:28:23 +000040!4 = !{!"kernel_arg_addr_space", i32 1}
41!5 = !{!"kernel_arg_access_qual", !"none"}
42!6 = !{!"kernel_arg_type", !"int*"}
43!7 = !{!"kernel_arg_base_type", !"int*"}
44!8 = !{!"kernel_arg_type_qual", !""}
Konstantin Zhuravlyove34ead82016-05-09 18:05:42 +000045!9 = !{i32 2, !"Dwarf Version", i32 2}
Konstantin Zhuravlyov8c273ad2016-04-18 16:28:23 +000046!10 = !{i32 2, !"Debug Info Version", i32 3}
Konstantin Zhuravlyove34ead82016-05-09 18:05:42 +000047!11 = !{!"clang version 3.9.0 (trunk 268929)"}
48!12 = distinct !DISubprogram(name: "test", scope: !1, file: !1, line: 1, type: !13, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
Konstantin Zhuravlyov8c273ad2016-04-18 16:28:23 +000049!13 = !DISubroutineType(types: !14)
50!14 = !{null, !15}
51!15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !16, size: 64, align: 32)
52!16 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
53!17 = !DILocalVariable(name: "A", arg: 1, scope: !12, file: !1, line: 1, type: !15)
54!18 = !DIExpression()
Konstantin Zhuravlyove34ead82016-05-09 18:05:42 +000055!19 = !DILocation(line: 1, column: 30, scope: !12)
Konstantin Zhuravlyov8c273ad2016-04-18 16:28:23 +000056!20 = !DILocation(line: 2, column: 3, scope: !12)
57!21 = !DILocation(line: 2, column: 8, scope: !12)
58!22 = !DILocation(line: 3, column: 3, scope: !12)
59!23 = !DILocation(line: 3, column: 8, scope: !12)
60!24 = !DILocation(line: 4, column: 3, scope: !12)
61!25 = !DILocation(line: 4, column: 8, scope: !12)
Konstantin Zhuravlyove34ead82016-05-09 18:05:42 +000062!26 = !DILocation(line: 5, column: 1, scope: !12)