2017-12-06 02:23:17 +08:00
|
|
|
; RUN: llc -O0 -march=amdgcn -mtriple=amdgcn-unknown-amdhsa -verify-machineinstrs < %s | FileCheck -check-prefixes=GCN,NOOPT %s
|
|
|
|
; RUN: llc -march=amdgcn -mtriple=amdgcn-unknown-amdhsa -verify-machineinstrs < %s | FileCheck -check-prefixes=GCN,OPT %s
|
2015-08-12 17:04:44 +08:00
|
|
|
|
2017-12-06 02:23:17 +08:00
|
|
|
; GCN-LABEL: {{^}}test_debug_value:
|
|
|
|
; NOOPT: s_load_dwordx2 s[4:5]
|
2016-11-30 03:39:53 +08:00
|
|
|
|
|
|
|
; FIXME: Why is the SGPR4_SGPR5 reference being removed from DBG_VALUE?
|
2018-02-01 06:04:26 +08:00
|
|
|
; NOOPT: ; kill: def $sgpr8_sgpr9 killed $sgpr4_sgpr5
|
2017-12-06 02:23:17 +08:00
|
|
|
; NOOPT-NEXT: ;DEBUG_VALUE: test_debug_value:globalptr_arg <- undef
|
2016-11-30 03:39:53 +08:00
|
|
|
|
2017-12-06 02:23:17 +08:00
|
|
|
; GCN: flat_store_dword
|
|
|
|
; GCN: s_endpgm
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @test_debug_value(i32 addrspace(1)* nocapture %globalptr_arg) #0 !dbg !4 {
|
2015-08-12 17:04:44 +08:00
|
|
|
entry:
|
2017-12-06 02:23:17 +08:00
|
|
|
tail call void @llvm.dbg.value(metadata i32 addrspace(1)* %globalptr_arg, metadata !10, metadata !13), !dbg !14
|
2015-08-12 17:04:44 +08:00
|
|
|
store i32 123, i32 addrspace(1)* %globalptr_arg, align 4
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2017-12-06 02:23:17 +08:00
|
|
|
; Check for infinite loop in some cases with dbg_value in
|
|
|
|
; SIOptimizeExecMaskingPreRA (somehow related to undef argument).
|
|
|
|
|
|
|
|
; GCN-LABEL: {{^}}only_undef_dbg_value:
|
|
|
|
; NOOPT: ;DEBUG_VALUE: test_debug_value:globalptr_arg <- [DW_OP_constu 1, DW_OP_swap, DW_OP_xderef] undef
|
|
|
|
; NOOPT-NEXT: s_endpgm
|
|
|
|
|
|
|
|
; OPT: s_endpgm
|
|
|
|
define amdgpu_kernel void @only_undef_dbg_value() #1 {
|
|
|
|
bb:
|
|
|
|
call void @llvm.dbg.value(metadata <4 x float> undef, metadata !10, metadata !DIExpression(DW_OP_constu, 1, DW_OP_swap, DW_OP_xderef)) #2, !dbg !14
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare void @llvm.dbg.value(metadata, metadata, metadata) #1
|
2015-08-12 17:04:44 +08:00
|
|
|
|
2016-07-12 07:35:48 +08:00
|
|
|
attributes #0 = { nounwind }
|
2015-08-12 17:04:44 +08:00
|
|
|
attributes #1 = { nounwind readnone }
|
|
|
|
|
|
|
|
!llvm.dbg.cu = !{!0}
|
|
|
|
!llvm.module.flags = !{!11, !12}
|
|
|
|
|
2016-04-15 23:57:41 +08:00
|
|
|
!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)
|
2015-08-12 17:04:44 +08:00
|
|
|
!1 = !DIFile(filename: "/tmp/test_debug_value.cl", directory: "/Users/matt/src/llvm/build_debug")
|
|
|
|
!2 = !{}
|
2016-04-15 23:57:41 +08:00
|
|
|
!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, variables: !9)
|
2015-08-12 17:04:44 +08:00
|
|
|
!5 = !DISubroutineType(types: !6)
|
|
|
|
!6 = !{null, !7}
|
|
|
|
!7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !8, size: 64, align: 32)
|
|
|
|
!8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
|
|
|
|
!9 = !{!10}
|
|
|
|
!10 = !DILocalVariable(name: "globalptr_arg", arg: 1, scope: !4, file: !1, line: 1, type: !7)
|
|
|
|
!11 = !{i32 2, !"Dwarf Version", i32 4}
|
|
|
|
!12 = !{i32 2, !"Debug Info Version", i32 3}
|
|
|
|
!13 = !DIExpression()
|
2015-08-29 04:26:49 +08:00
|
|
|
!14 = !DILocation(line: 1, column: 42, scope: !4)
|