1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx906 -verify-machineinstrs -run-pass=machine-scheduler -o - %s | FileCheck %s
3 # The DBG_VALUE in bb.5 ends a scheduling region, and its uses should
4 # not be tracked like a normal instruction.
7 define void @dbg_value_ends_sched_region() {
12 !llvm.module.flags = !{!3, !4}
14 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 12.0.0 (/src/external/llvm-project/clang ff12a3768d17240b01cbe9957e3c9e8f8ffe9854)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !2, splitDebugInlining: false, nameTableKind: None)
15 !1 = !DIFile(filename: "/tmp/comgr-054202/input/CompileSource", directory: "/home/matt/bugs/SWDEV-253507")
17 !3 = !{i32 2, !"Debug Info Version", i32 3}
18 !4 = !{i32 7, !"PIC Level", i32 1}
19 !5 = !{!6, !9, i64 68}
20 !6 = !{!"ShaderData", !7, i64 0, !7, i64 16, !7, i64 32, !7, i64 48, !9, i64 64, !9, i64 68, !9, i64 72, !9, i64 76, !9, i64 80, !10, i64 84, !10, i64 88, !9, i64 92, !9, i64 96, !10, i64 100, !10, i64 104, !11, i64 112, !11, i64 144, !12, i64 176, !12, i64 184, !7, i64 192, !7, i64 208, !7, i64 224, !11, i64 240, !9, i64 272, !9, i64 276, !9, i64 280, !10, i64 284, !7, i64 288, !7, i64 304, !7, i64 320, !7, i64 336}
21 !7 = !{!"omnipotent char", !8, i64 0}
22 !8 = !{!"Simple C/C++ TBAA"}
23 !9 = !{!"int", !7, i64 0}
24 !10 = !{!"float", !7, i64 0}
25 !11 = !{!"differential3", !7, i64 0, !7, i64 16}
26 !12 = !{!"differential", !10, i64 0, !10, i64 4}
27 !13 = !{!6, !9, i64 280}
28 !16 = !DILocalVariable(name: "data", scope: !17, file: !18, line: 24)
29 !17 = distinct !DISubprogram(name: "svm_node_geometry", scope: !18, file: !18, line: 21, type: !19, scopeLine: 23, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2)
30 !18 = !DIFile(filename: "source/kernel/svm/svm_geometry.h", directory: "/home/matt/bugs/SWDEV-253507")
31 !19 = !DISubroutineType(types: !20)
33 !21 = !DILocation(line: 0, scope: !17)
37 name: dbg_value_ends_sched_region
38 tracksRegLiveness: true
40 scratchRSrcReg: '$sgpr0_sgpr1_sgpr2_sgpr3'
41 frameOffsetReg: '$sgpr33'
42 stackPtrOffsetReg: '$sgpr32'
44 ; CHECK-LABEL: name: dbg_value_ends_sched_region
46 ; CHECK-NEXT: successors: %bb.1(0x80000000)
47 ; CHECK-NEXT: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
49 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
50 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vreg_64 = COPY $vgpr2_vgpr3
51 ; CHECK-NEXT: [[DEF:%[0-9]+]]:vreg_64 = IMPLICIT_DEF
52 ; CHECK-NEXT: [[DEF1:%[0-9]+]]:vreg_64 = IMPLICIT_DEF
53 ; CHECK-NEXT: [[DEF2:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
54 ; CHECK-NEXT: [[DEF3:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
55 ; CHECK-NEXT: [[DEF4:%[0-9]+]]:vreg_64 = IMPLICIT_DEF
56 ; CHECK-NEXT: [[DEF5:%[0-9]+]]:vreg_64 = IMPLICIT_DEF
57 ; CHECK-NEXT: [[DEF6:%[0-9]+]]:vreg_64 = IMPLICIT_DEF
58 ; CHECK-NEXT: [[DEF7:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
59 ; CHECK-NEXT: [[DEF8:%[0-9]+]]:vreg_64 = IMPLICIT_DEF
60 ; CHECK-NEXT: undef %11.sub0:vreg_64 = V_MOV_B32_e32 0, implicit $exec
63 ; CHECK-NEXT: successors: %bb.2(0x80000000)
65 ; CHECK-NEXT: undef %17.sub0:vreg_64, %18:sreg_64_xexec = V_ADD_CO_U32_e64 [[DEF4]].sub0, [[DEF6]].sub0, 0, implicit $exec
66 ; CHECK-NEXT: dead undef %17.sub1:vreg_64, dead %19:sreg_64_xexec = V_ADDC_U32_e64 [[DEF4]].sub1, [[DEF6]].sub1, %18, 0, implicit $exec
67 ; CHECK-NEXT: [[GLOBAL_LOAD_DWORDX2_:%[0-9]+]]:vreg_64 = GLOBAL_LOAD_DWORDX2 [[DEF1]], 0, 0, implicit $exec :: (load (s64), addrspace 1)
68 ; CHECK-NEXT: dead [[COPY2:%[0-9]+]]:vreg_64 = COPY [[DEF]]
69 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:vgpr_32 = COPY [[DEF3]]
70 ; CHECK-NEXT: dead [[COPY4:%[0-9]+]]:vgpr_32 = COPY [[DEF2]]
71 ; CHECK-NEXT: [[COPY5:%[0-9]+]]:vgpr_32 = COPY [[DEF5]].sub1
72 ; CHECK-NEXT: dead [[COPY6:%[0-9]+]]:vgpr_32 = COPY %11.sub0
73 ; CHECK-NEXT: dead [[V_CMP_GT_I32_e64_:%[0-9]+]]:sreg_64 = V_CMP_GT_I32_e64 4, [[DEF7]], implicit $exec
74 ; CHECK-NEXT: GLOBAL_STORE_DWORDX2 [[COPY]], [[DEF8]], 288, 0, implicit $exec :: (store (s64), addrspace 1)
77 ; CHECK-NEXT: successors: %bb.3(0x80000000)
79 ; CHECK-NEXT: [[COPY7:%[0-9]+]]:vgpr_32 = COPY [[COPY3]]
82 ; CHECK-NEXT: successors: %bb.2(0x40000000), %bb.4(0x40000000)
84 ; CHECK-NEXT: undef [[DEF5]].sub1:vreg_64 = COPY [[COPY5]]
85 ; CHECK-NEXT: S_CBRANCH_EXECZ %bb.2, implicit $exec
88 ; CHECK-NEXT: successors: %bb.5(0x80000000)
90 ; CHECK-NEXT: dead [[COPY8:%[0-9]+]]:sreg_64 = COPY $exec
91 ; CHECK-NEXT: dead [[GLOBAL_LOAD_DWORDX4_:%[0-9]+]]:vreg_128 = GLOBAL_LOAD_DWORDX4 [[COPY1]], 0, 0, implicit $exec :: (load (s128), addrspace 1)
92 ; CHECK-NEXT: DBG_VALUE [[GLOBAL_LOAD_DWORDX4_]], $noreg, <0x{{[0-9a-f]+}}>, !DIExpression(DW_OP_constu, 1, DW_OP_swap, DW_OP_xderef), debug-location !DILocation(line: 0, scope: <0x{{[0-9a-f]+}}>)
95 ; CHECK-NEXT: successors: %bb.3(0x40000000), %bb.1(0x40000000)
97 ; CHECK-NEXT: S_CBRANCH_EXECZ %bb.3, implicit $exec
98 ; CHECK-NEXT: S_BRANCH %bb.1
100 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
102 %0:vreg_64 = COPY $vgpr0_vgpr1
103 %1:vreg_64 = COPY $vgpr2_vgpr3
104 %2:vreg_64 = IMPLICIT_DEF
105 %3:vreg_64 = IMPLICIT_DEF
106 %4:vgpr_32 = IMPLICIT_DEF
107 %5:vgpr_32 = IMPLICIT_DEF
108 %6:vreg_64 = IMPLICIT_DEF
109 %7:vreg_64 = IMPLICIT_DEF
110 %8:vreg_64 = IMPLICIT_DEF
111 %9:vgpr_32 = IMPLICIT_DEF
112 %10:vreg_64 = IMPLICIT_DEF
113 undef %11.sub0:vreg_64 = V_MOV_B32_e32 0, implicit $exec
116 %12:vreg_64 = COPY %2
117 %13:vgpr_32 = COPY %5
118 dead %14:vgpr_32 = COPY %4
119 %15:vgpr_32 = COPY %7.sub1
120 dead %16:vgpr_32 = COPY %11.sub0
121 undef %17.sub0:vreg_64, %18:sreg_64_xexec = V_ADD_CO_U32_e64 %6.sub0, %8.sub0, 0, implicit $exec
122 dead %17.sub1:vreg_64, dead %19:sreg_64_xexec = V_ADDC_U32_e64 %6.sub1, %8.sub1, %18, 0, implicit $exec
123 %6:vreg_64 = GLOBAL_LOAD_DWORDX2 %3, 0, 0, implicit $exec :: (load (s64), addrspace 1)
124 dead %20:sreg_64 = V_CMP_GT_I32_e64 4, %9, implicit $exec
125 GLOBAL_STORE_DWORDX2 %0, %10, 288, 0, implicit $exec :: (store (s64), addrspace 1)
128 %5:vgpr_32 = COPY %13
131 undef %7.sub1:vreg_64 = COPY %15
132 S_CBRANCH_EXECZ %bb.2, implicit $exec
135 dead %21:sreg_64 = COPY $exec
136 %22:vreg_128 = GLOBAL_LOAD_DWORDX4 %1, 0, 0, implicit $exec :: (load (s128), addrspace 1)
137 DBG_VALUE %22, $noreg, !16, !DIExpression(DW_OP_constu, 1, DW_OP_swap, DW_OP_xderef), debug-location !21
140 S_CBRANCH_EXECZ %bb.3, implicit $exec