1 # RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx908 -run-pass=si-opt-vgpr-liverange %s -o - | FileCheck -check-prefix=GCN %s
3 # SIOptimizeVGPRLiveRange shouldn't try to modify use of %5 in DBG_VALUE_LIST
6 define void @dbg_instr_use(i1 %arg) #1 {
10 attributes #1 = { "amdgpu-no-completion-action" "amdgpu-no-default-queue" "amdgpu-no-dispatch-id" "amdgpu-no-dispatch-ptr" "amdgpu-no-heap-ptr" "amdgpu-no-hostcall-ptr" "amdgpu-no-implicitarg-ptr" "amdgpu-no-lds-kernel-id" "amdgpu-no-multigrid-sync-arg" "amdgpu-no-queue-ptr" "amdgpu-no-workgroup-id-x" "amdgpu-no-workgroup-id-y" "amdgpu-no-workgroup-id-z" "amdgpu-no-workitem-id-x" "amdgpu-no-workitem-id-y" "amdgpu-no-workitem-id-z" "amdgpu-waves-per-eu"="4,10" "target-cpu"="gfx908" "uniform-work-group-size"="false" }
12 !llvm.module.flags = !{!3}
14 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.0 (trunk 131941)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2)
15 !1 = !DIFile(filename: "/d/j/debug-test.c", directory: "/Volumes/Data/b")
17 !3 = !{i32 1, !"Debug Info Version", i32 3}
18 !4 = !DILocalVariable(name: "c", scope: !5, file: !1, line: 2, type: !8)
19 !5 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 1, type: !6, scopeLine: 1, virtualIndex: 6, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0)
20 !6 = !DISubroutineType(types: !7)
22 !8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
23 !9 = !DILocation(line: 0, scope: !5)
28 tracksRegLiveness: true
30 ; GCN-LABEL: name: dbg_instr_use
32 ; GCN-NEXT: successors: %bb.3(0x40000000), %bb.1(0x40000000)
33 ; GCN-NEXT: liveins: $vgpr0
35 ; GCN-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY killed $vgpr0
36 ; GCN-NEXT: [[V_AND_B32_e32_:%[0-9]+]]:vgpr_32 = V_AND_B32_e32 1, killed [[COPY]], implicit $exec
37 ; GCN-NEXT: [[V_CMP_EQ_U32_e64_:%[0-9]+]]:sreg_64 = V_CMP_EQ_U32_e64 1, killed [[V_AND_B32_e32_]], implicit $exec
38 ; GCN-NEXT: [[S_XOR_B64_:%[0-9]+]]:sreg_64 = S_XOR_B64 killed [[V_CMP_EQ_U32_e64_]], -1, implicit-def dead $scc
39 ; GCN-NEXT: [[V_MOV_B:%[0-9]+]]:vreg_64 = V_MOV_B64_PSEUDO 0, implicit $exec
40 ; GCN-NEXT: [[GLOBAL_LOAD_DWORDX2_:%[0-9]+]]:vreg_64 = GLOBAL_LOAD_DWORDX2 killed [[V_MOV_B]], 0, 0, implicit $exec
41 ; GCN-NEXT: [[SI_IF:%[0-9]+]]:sreg_64 = SI_IF killed [[S_XOR_B64_]], %bb.1, implicit-def dead $exec, implicit-def dead $scc, implicit $exec
42 ; GCN-NEXT: S_BRANCH %bb.3
45 ; GCN-NEXT: successors: %bb.2(0x40000000), %bb.4(0x40000000)
47 ; GCN-NEXT: [[PHI:%[0-9]+]]:vreg_64 = PHI [[GLOBAL_LOAD_DWORDX2_]], %bb.0, undef %13:vreg_64, %bb.3
48 ; GCN-NEXT: [[SI_ELSE:%[0-9]+]]:sreg_64 = SI_ELSE killed [[SI_IF]], %bb.4, implicit-def dead $exec, implicit-def dead $scc, implicit $exec
49 ; GCN-NEXT: S_BRANCH %bb.2
52 ; GCN-NEXT: successors: %bb.4(0x80000000)
54 ; GCN-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
55 ; GCN-NEXT: [[REG_SEQUENCE:%[0-9]+]]:vreg_64 = REG_SEQUENCE killed [[V_MOV_B32_e32_]], %subreg.sub0, [[V_MOV_B32_e32_]], %subreg.sub1
56 ; GCN-NEXT: FLAT_STORE_DWORDX2 killed [[PHI]], killed [[REG_SEQUENCE]], 0, 0, implicit $exec, implicit $flat_scr
57 ; GCN-NEXT: S_BRANCH %bb.4
60 ; GCN-NEXT: successors: %bb.1(0x80000000)
62 ; GCN-NEXT: [[V_MOV_B32_e32_1:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
63 ; GCN-NEXT: [[REG_SEQUENCE1:%[0-9]+]]:vreg_64 = REG_SEQUENCE killed [[V_MOV_B32_e32_1]], %subreg.sub0, [[V_MOV_B32_e32_1]], %subreg.sub1
64 ; GCN-NEXT: FLAT_STORE_DWORDX2 killed [[GLOBAL_LOAD_DWORDX2_]], killed [[REG_SEQUENCE1]], 0, 0, implicit $exec, implicit $flat_scr
65 ; GCN-NEXT: S_BRANCH %bb.1
68 ; GCN-NEXT: SI_END_CF killed [[SI_ELSE]], implicit-def dead $exec, implicit-def dead $scc, implicit $exec
69 ; GCN-NEXT: DBG_VALUE_LIST
73 successors: %bb.3(0x40000000), %bb.1(0x40000000)
76 %0:vgpr_32 = COPY $vgpr0
77 %1:vgpr_32 = V_AND_B32_e32 1, %0, implicit $exec
78 %2:sreg_64 = V_CMP_EQ_U32_e64 1, killed %1, implicit $exec
79 %3:sreg_64 = S_XOR_B64 killed %2, -1, implicit-def dead $scc
80 %4:vreg_64 = V_MOV_B64_PSEUDO 0, implicit $exec
81 %5:vreg_64 = GLOBAL_LOAD_DWORDX2 killed %4, 0, 0, implicit $exec
82 %6:sreg_64 = SI_IF killed %3, %bb.1, implicit-def dead $exec, implicit-def dead $scc, implicit $exec
86 successors: %bb.2(0x40000000), %bb.4(0x40000000)
88 %7:sreg_64 = SI_ELSE %6, %bb.4, implicit-def dead $exec, implicit-def dead $scc, implicit $exec
92 successors: %bb.4(0x80000000)
94 %8:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
95 %9:vreg_64 = REG_SEQUENCE %8, %subreg.sub0, %8, %subreg.sub1
96 FLAT_STORE_DWORDX2 %5, killed %9, 0, 0, implicit $exec, implicit $flat_scr
100 successors: %bb.1(0x80000000)
102 %10:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
103 %11:vreg_64 = REG_SEQUENCE %10, %subreg.sub0, %10, %subreg.sub1
104 FLAT_STORE_DWORDX2 %5, killed %11, 0, 0, implicit $exec, implicit $flat_scr
108 SI_END_CF %7, implicit-def dead $exec, implicit-def dead $scc, implicit $exec
109 DBG_VALUE_LIST !4, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 1, DW_OP_constu, 2712, DW_OP_mul, DW_OP_plus, DW_OP_plus_uconst, 2680, DW_OP_stack_value), %5, 0, debug-location !9