brintos

brintos / llvm-project-archived public Read only

0
0
Text · 6.8 KiB · e29f09d Raw
135 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx908 < %s | FileCheck %s3 4%struct.A = type { [100 x i32] }5 6; The 64-bit pointer argument %arg1 will be split into two registers7; and for its llvm.dbg.declare, DAG should emit two DBG_VALUE instructions8; with the fragment expressions.9define hidden void @ptr_arg_split_subregs(ptr %arg1) #0 !dbg !9 {10; CHECK-LABEL: ptr_arg_split_subregs:11; CHECK:       .Lfunc_begin0:12; CHECK-NEXT:    .file 1 "temp" "example.cpp"13; CHECK-NEXT:    .loc 1 5 0 ; example.cpp:5:014; CHECK-NEXT:    .cfi_sections .debug_frame15; CHECK-NEXT:    .cfi_startproc16; CHECK-NEXT:  ; %bb.0:17; CHECK-NEXT:    ;DEBUG_VALUE: ptr_arg_split_subregs:a <- [DW_OP_LLVM_fragment 32 32] [$vgpr1+0]18; CHECK-NEXT:    ;DEBUG_VALUE: ptr_arg_split_subregs:a <- [DW_OP_LLVM_fragment 0 32] [$vgpr0+0]19; CHECK-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)20; CHECK-NEXT:    v_mov_b32_e32 v2, 121; CHECK-NEXT:  .Ltmp0:22; CHECK-NEXT:    .loc 1 7 13 prologue_end ; example.cpp:7:1323; CHECK-NEXT:    flat_store_dword v[0:1], v2 offset:39624; CHECK-NEXT:    .loc 1 8 5 ; example.cpp:8:525; CHECK-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)26; CHECK-NEXT:    s_setpc_b64 s[30:31]27; CHECK-NEXT:  .Ltmp1:28  call void @llvm.dbg.declare(metadata ptr %arg1, metadata !20, metadata !DIExpression()), !dbg !2129  %gep1 = getelementptr inbounds %struct.A, ptr %arg1, i32 0, i32 0, i32 99, !dbg !2230  store i32 1, ptr %gep1, align 4, !dbg !2331  ret void, !dbg !2432}33 34; FIXME: The 64-bit pointer argument %arg2 will be split between a register and35; the stack memory. The SelectionDAG though failed to emit the DBG_VALUE for the36; split part in memory. The two DBG_VALUE instructions emitted in the output pattern37; are totally misleading. The former represent part of the incoming argument in register38; while the latter was emitted for the parameter copy to a virtual register inserted39; at the function entry by DAGBuilder.40define hidden void @ptr_arg_split_reg_mem(<30 x i32>, ptr %arg2) #0 !dbg !25 {41; CHECK-LABEL: ptr_arg_split_reg_mem:42; CHECK:       .Lfunc_begin1:43; CHECK-NEXT:    .loc 1 10 0 ; example.cpp:10:044; CHECK-NEXT:    .cfi_startproc45; CHECK-NEXT:  ; %bb.0:46; CHECK-NEXT:    ;DEBUG_VALUE: ptr_arg_split_reg_mem:b <- [$vgpr30+0]47; CHECK-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)48; CHECK-NEXT:    buffer_load_dword v31, off, s[0:3], s3249; CHECK-NEXT:    v_mov_b32_e32 v0, 150; CHECK-NEXT:  .Ltmp2:51; CHECK-NEXT:    .loc 1 12 13 prologue_end ; example.cpp:12:1352; CHECK-NEXT:    s_waitcnt vmcnt(0)53; CHECK-NEXT:    flat_store_dword v[30:31], v0 offset:39654; CHECK-NEXT:    .loc 1 13 5 ; example.cpp:13:555; CHECK-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)56; CHECK-NEXT:    s_setpc_b64 s[30:31]57; CHECK-NEXT:  .Ltmp3:58  call void @llvm.dbg.declare(metadata ptr %arg2, metadata !26, metadata !DIExpression()), !dbg !2759  %gep2 = getelementptr inbounds %struct.A, ptr %arg2, i32 0, i32 0, i32 99, !dbg !2860  store i32 1, ptr %gep2, align 4, !dbg !2961  ret void, !dbg !3062}63 64; FIXME: The 64-bit pointer argument %arg3 will be entirely in the stack memory.65; No DBG_VALUE emitted for the incoming argument in this case and it should be fixed.66define hidden void @ptr_arg_in_memory(<32 x i32>, ptr %arg3) #0 !dbg !31 {67; CHECK-LABEL: ptr_arg_in_memory:68; CHECK:       .Lfunc_begin2:69; CHECK-NEXT:    .loc 1 15 0 ; example.cpp:15:070; CHECK-NEXT:    .cfi_startproc71; CHECK-NEXT:  ; %bb.0:72; CHECK-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)73; CHECK-NEXT:    buffer_load_dword v1, off, s[0:3], s32 offset:874; CHECK-NEXT:    buffer_load_dword v0, off, s[0:3], s32 offset:475; CHECK-NEXT:    v_mov_b32_e32 v2, 176; CHECK-NEXT:  .Ltmp4:77; CHECK-NEXT:    .loc 1 17 13 prologue_end ; example.cpp:17:1378; CHECK-NEXT:    s_waitcnt vmcnt(0)79; CHECK-NEXT:    flat_store_dword v[0:1], v2 offset:39680; CHECK-NEXT:    .loc 1 18 5 ; example.cpp:18:581; CHECK-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)82; CHECK-NEXT:    s_setpc_b64 s[30:31]83; CHECK-NEXT:  .Ltmp5:84  call void @llvm.dbg.declare(metadata ptr %arg3, metadata !32, metadata !DIExpression()), !dbg !3385  %gep3 = getelementptr inbounds %struct.A, ptr %arg3, i32 0, i32 0, i32 99, !dbg !3486  store i32 1, ptr %gep3, align 4, !dbg !3587  ret void, !dbg !3688}89 90declare void @llvm.dbg.declare(metadata, metadata, metadata) #091 92attributes #0 = { nounwind }93 94!llvm.dbg.cu = !{!0}95!llvm.module.flags = !{!3, !4, !5, !6, !7}96!llvm.ident = !{!8}97 98!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 13.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None)99!1 = !DIFile(filename: "example.cpp", directory: "temp")100!2 = !{}101!3 = !{i32 7, !"Dwarf Version", i32 4}102!4 = !{i32 2, !"Debug Info Version", i32 3}103!5 = !{i32 1, !"wchar_size", i32 4}104!6 = !{i32 7, !"uwtable", i32 1}105!7 = !{i32 7, !"frame-pointer", i32 2}106!8 = !{!"clang version 13.0.0"}107!9 = distinct !DISubprogram(name: "ptr_arg_split_subregs", scope: !10, file: !10, line: 5, type: !11, scopeLine: 5, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)108!10 = !DIFile(filename: "example.cpp", directory: "temp")109!11 = !DISubroutineType(types: !12)110!12 = !{!13}111!13 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !10, line: 1, size: 3200, flags: DIFlagTypePassByValue, elements: !14, identifier: "_ZTS1A")112!14 = !{!15}113!15 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !13, file: !10, line: 2, baseType: !16, size: 3200)114!16 = !DICompositeType(tag: DW_TAG_array_type, baseType: !17, size: 3200, elements: !18)115!17 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)116!18 = !{!19}117!19 = !DISubrange(count: 100)118!20 = !DILocalVariable(name: "a", scope: !9, file: !10, line: 6, type: !13)119!21 = !DILocation(line: 6, column: 7, scope: !9)120!22 = !DILocation(line: 7, column: 7, scope: !9)121!23 = !DILocation(line: 7, column: 13, scope: !9)122!24 = !DILocation(line: 8, column: 5, scope: !9)123!25 = distinct !DISubprogram(name: "ptr_arg_split_reg_mem", scope: !10, file: !10, line: 10, type: !11, scopeLine: 10, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)124!26 = !DILocalVariable(name: "b", scope: !25, file: !10, line: 11, type: !13)125!27 = !DILocation(line: 11, column: 7, scope: !25)126!28 = !DILocation(line: 12, column: 7, scope: !25)127!29 = !DILocation(line: 12, column: 13, scope: !25)128!30 = !DILocation(line: 13, column: 5, scope: !25)129!31 = distinct !DISubprogram(name: "ptr_arg_in_memory", scope: !10, file: !10, line: 15, type: !11, scopeLine: 15, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)130!32 = !DILocalVariable(name: "c", scope: !31, file: !10, line: 16, type: !13)131!33 = !DILocation(line: 16, column: 7, scope: !31)132!34 = !DILocation(line: 17, column: 7, scope: !31)133!35 = !DILocation(line: 17, column: 13, scope: !31)134!36 = !DILocation(line: 18, column: 5, scope: !31)135