57 lines · plain
1; RUN: llc -O0 -mtriple=amdgcn-unknown-amdhsa < %s | FileCheck -check-prefixes=GCN,NOOPT %s2; RUN: llc -mtriple=amdgcn-unknown-amdhsa < %s | FileCheck -check-prefixes=GCN,OPT %s3 4 5; GCN-LABEL: {{^}}test_debug_value:6; NOOPT: .loc 1 1 42 prologue_end ; /tmp/test_debug_value.cl:1:427; NOOPT-NEXT: s_load_dwordx2 s[4:5], s[8:9], 0x08; NOOPT-NEXT: .Ltmp9; NOOPT-NEXT: ;DEBUG_VALUE: test_debug_value:globalptr_arg <- $sgpr4_sgpr510 11; GCN: flat_store_dword12; GCN: s_endpgm13define amdgpu_kernel void @test_debug_value(ptr addrspace(1) nocapture %globalptr_arg) #0 !dbg !4 {14entry:15 tail call void @llvm.dbg.value(metadata ptr addrspace(1) %globalptr_arg, metadata !10, metadata !13), !dbg !1416 store i32 123, ptr addrspace(1) %globalptr_arg, align 4, !dbg !1417 ret void, !dbg !1418}19 20; Check for infinite loop in some cases with dbg_value in21; SIOptimizeExecMaskingPreRA (somehow related to undef argument).22 23; GCN-LABEL: {{^}}only_undef_dbg_value:24; NOOPT: ;DEBUG_VALUE: test_debug_value:globalptr_arg <- undef25; NOOPT-NEXT: s_endpgm26 27; OPT: s_endpgm28define amdgpu_kernel void @only_undef_dbg_value() #1 {29bb:30 call void @llvm.dbg.value(metadata <4 x float> poison, metadata !10, metadata !DIExpression(DW_OP_constu, 1, DW_OP_swap, DW_OP_xderef)) #2, !dbg !1431 ret void, !dbg !1432}33 34declare void @llvm.dbg.value(metadata, metadata, metadata) #135 36attributes #0 = { nounwind }37attributes #1 = { nounwind readnone }38 39!llvm.dbg.cu = !{!0}40!llvm.module.flags = !{!11, !12, !15}41 42!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0 (trunk 244715) (llvm/trunk 244718)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)43!1 = !DIFile(filename: "/tmp/test_debug_value.cl", directory: "/Users/matt/src/llvm/build_debug")44!2 = !{}45!4 = distinct !DISubprogram(name: "test_debug_value", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !9)46!5 = !DISubroutineType(types: !6)47!6 = !{null, !7}48!7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !8, size: 64, align: 32)49!8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)50!9 = !{!10}51!10 = !DILocalVariable(name: "globalptr_arg", arg: 1, scope: !4, file: !1, line: 1, type: !7)52!11 = !{i32 2, !"Dwarf Version", i32 4}53!12 = !{i32 2, !"Debug Info Version", i32 3}54!13 = !DIExpression()55!14 = !DILocation(line: 1, column: 42, scope: !4)56!15 = !{i32 1, !"amdhsa_code_object_version", i32 500}57