113 lines · plain
1# RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx908 -run-pass=si-opt-vgpr-liverange %s -o - | FileCheck -check-prefix=GCN %s2# RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx908 -passes=si-opt-vgpr-liverange %s -o - | FileCheck -check-prefix=GCN %s3 4# SIOptimizeVGPRLiveRange shouldn't try to modify use of %5 in DBG_VALUE_LIST5 6--- |7 define void @dbg_instr_use(i1 %arg) #1 {8 ret void9 }10 11 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.dbg.cu = !{!0}13 !llvm.module.flags = !{!3}14 15 !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)16 !1 = !DIFile(filename: "/d/j/debug-test.c", directory: "/Volumes/Data/b")17 !2 = !{}18 !3 = !{i32 1, !"Debug Info Version", i32 3}19 !4 = !DILocalVariable(name: "c", scope: !5, file: !1, line: 2, type: !8)20 !5 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 1, type: !6, scopeLine: 1, virtualIndex: 6, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0)21 !6 = !DISubroutineType(types: !7)22 !7 = !{!8}23 !8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)24 !9 = !DILocation(line: 0, scope: !5)25...26 27---28name: dbg_instr_use29tracksRegLiveness: true30body: |31 ; GCN-LABEL: name: dbg_instr_use32 ; GCN: bb.0:33 ; GCN-NEXT: successors: %bb.3(0x40000000), %bb.1(0x40000000)34 ; GCN-NEXT: liveins: $vgpr035 ; GCN-NEXT: {{ $}}36 ; GCN-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY killed $vgpr037 ; GCN-NEXT: [[V_AND_B32_e32_:%[0-9]+]]:vgpr_32 = V_AND_B32_e32 1, killed [[COPY]], implicit $exec38 ; GCN-NEXT: [[V_CMP_EQ_U32_e64_:%[0-9]+]]:sreg_64 = V_CMP_EQ_U32_e64 1, killed [[V_AND_B32_e32_]], implicit $exec39 ; GCN-NEXT: [[S_XOR_B64_:%[0-9]+]]:sreg_64 = S_XOR_B64 killed [[V_CMP_EQ_U32_e64_]], -1, implicit-def dead $scc40 ; GCN-NEXT: [[V_MOV_B:%[0-9]+]]:vreg_64 = V_MOV_B64_PSEUDO 0, implicit $exec41 ; GCN-NEXT: [[GLOBAL_LOAD_DWORDX2_:%[0-9]+]]:vreg_64 = GLOBAL_LOAD_DWORDX2 killed [[V_MOV_B]], 0, 0, implicit $exec42 ; 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 $exec43 ; GCN-NEXT: S_BRANCH %bb.344 ; GCN-NEXT: {{ $}}45 ; GCN-NEXT: bb.1:46 ; GCN-NEXT: successors: %bb.2(0x40000000), %bb.4(0x40000000)47 ; GCN-NEXT: {{ $}}48 ; GCN-NEXT: [[PHI:%[0-9]+]]:vreg_64 = PHI [[GLOBAL_LOAD_DWORDX2_]], %bb.0, undef %13:vreg_64, %bb.349 ; GCN-NEXT: [[SI_ELSE:%[0-9]+]]:sreg_64 = SI_ELSE killed [[SI_IF]], %bb.4, implicit-def dead $exec, implicit-def dead $scc, implicit $exec50 ; GCN-NEXT: S_BRANCH %bb.251 ; GCN-NEXT: {{ $}}52 ; GCN-NEXT: bb.2:53 ; GCN-NEXT: successors: %bb.4(0x80000000)54 ; GCN-NEXT: {{ $}}55 ; GCN-NEXT: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 0, implicit $exec56 ; GCN-NEXT: [[REG_SEQUENCE:%[0-9]+]]:vreg_64 = REG_SEQUENCE killed [[V_MOV_B32_e32_]], %subreg.sub0, [[V_MOV_B32_e32_]], %subreg.sub157 ; GCN-NEXT: FLAT_STORE_DWORDX2 killed [[PHI]], killed [[REG_SEQUENCE]], 0, 0, implicit $exec, implicit $flat_scr58 ; GCN-NEXT: S_BRANCH %bb.459 ; GCN-NEXT: {{ $}}60 ; GCN-NEXT: bb.3:61 ; GCN-NEXT: successors: %bb.1(0x80000000)62 ; GCN-NEXT: {{ $}}63 ; GCN-NEXT: [[V_MOV_B32_e32_1:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 0, implicit $exec64 ; GCN-NEXT: [[REG_SEQUENCE1:%[0-9]+]]:vreg_64 = REG_SEQUENCE killed [[V_MOV_B32_e32_1]], %subreg.sub0, [[V_MOV_B32_e32_1]], %subreg.sub165 ; GCN-NEXT: FLAT_STORE_DWORDX2 killed [[GLOBAL_LOAD_DWORDX2_]], killed [[REG_SEQUENCE1]], 0, 0, implicit $exec, implicit $flat_scr66 ; GCN-NEXT: S_BRANCH %bb.167 ; GCN-NEXT: {{ $}}68 ; GCN-NEXT: bb.4:69 ; GCN-NEXT: SI_END_CF killed [[SI_ELSE]], implicit-def dead $exec, implicit-def dead $scc, implicit $exec70 ; GCN-NEXT: DBG_VALUE_LIST71 ; GCN-NEXT-SAME: %972 ; GCN-NEXT: SI_RETURN73 bb.0:74 successors: %bb.3(0x40000000), %bb.1(0x40000000)75 liveins: $vgpr076 77 %0:vgpr_32 = COPY $vgpr078 %1:vgpr_32 = V_AND_B32_e32 1, %0, implicit $exec79 %2:sreg_64 = V_CMP_EQ_U32_e64 1, killed %1, implicit $exec80 %3:sreg_64 = S_XOR_B64 killed %2, -1, implicit-def dead $scc81 %4:vreg_64 = V_MOV_B64_PSEUDO 0, implicit $exec82 %5:vreg_64 = GLOBAL_LOAD_DWORDX2 killed %4, 0, 0, implicit $exec83 %6:sreg_64 = SI_IF killed %3, %bb.1, implicit-def dead $exec, implicit-def dead $scc, implicit $exec84 S_BRANCH %bb.385 86 bb.1:87 successors: %bb.2(0x40000000), %bb.4(0x40000000)88 89 %7:sreg_64 = SI_ELSE %6, %bb.4, implicit-def dead $exec, implicit-def dead $scc, implicit $exec90 S_BRANCH %bb.291 92 bb.2:93 successors: %bb.4(0x80000000)94 95 %8:vgpr_32 = V_MOV_B32_e32 0, implicit $exec96 %9:vreg_64 = REG_SEQUENCE %8, %subreg.sub0, %8, %subreg.sub197 FLAT_STORE_DWORDX2 %5, killed %9, 0, 0, implicit $exec, implicit $flat_scr98 S_BRANCH %bb.499 100 bb.3:101 successors: %bb.1(0x80000000)102 103 %10:vgpr_32 = V_MOV_B32_e32 0, implicit $exec104 %11:vreg_64 = REG_SEQUENCE %10, %subreg.sub0, %10, %subreg.sub1105 FLAT_STORE_DWORDX2 %5, killed %11, 0, 0, implicit $exec, implicit $flat_scr106 S_BRANCH %bb.1107 108 bb.4:109 SI_END_CF %7, implicit-def dead $exec, implicit-def dead $scc, implicit $exec110 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 !9111 SI_RETURN112...113