| # RUN: llc -mtriple=hexagon -run-pass=hexagon-nvj -verify-machineinstrs \ | |
| # RUN: -o - %s | FileCheck %s | |
| # The compare that defines the predicate is removed, so a debug value that reads | |
| # the predicate after the compare would read a stale value. It is set undef in | |
| # the compare's block, and in the block the predicate flows into, up to its | |
| # redefinition. A debug value before the compare still reads the earlier value. | |
| # CHECK: $r1 = A2_addi $r0, -1 | |
| # CHECK-NEXT: DBG_VALUE $p0, $noreg, !{{[0-9]+}} | |
| # CHECK-NEXT: DBG_VALUE $noreg, $noreg, !{{[0-9]+}} | |
| # CHECK-NEXT: $r2 = S4_subaddi $r1, 1, killed $r2 | |
| # CHECK-NEXT: $r3 = A2_tfrsi 2 | |
| # CHECK-NEXT: J4_cmpgtu_t_jumpnv_t killed $r3, killed $r1, %bb.1, implicit-def $pc | |
| # CHECK: bb.1: | |
| # CHECK: DBG_VALUE $noreg, $noreg, !{{[0-9]+}} | |
| # CHECK-NEXT: $p0 = C2_cmpeqi $r0, 3 | |
| # CHECK-NEXT: DBG_VALUE $p0, $noreg, !{{[0-9]+}} | |
| --- | | |
| define void @fred() !dbg !5 { | |
| entry: | |
| ret void, !dbg !11 | |
| } | |
| !llvm.dbg.cu = !{!0} | |
| !llvm.module.flags = !{!4} | |
| !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, | |
| producer: "llvm", isOptimized: true, runtimeVersion: 0, | |
| emissionKind: FullDebug) | |
| !1 = !DIFile(filename: "newvaluejump-debug-pred.mir", directory: "/") | |
| !4 = !{i32 2, !"Debug Info Version", i32 3} | |
| !5 = distinct !DISubprogram(name: "fred", linkageName: "fred", scope: null, | |
| file: !1, line: 1, type: !6, scopeLine: 1, | |
| spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0) | |
| !6 = !DISubroutineType(types: !7) | |
| !7 = !{} | |
| !9 = !DILocalVariable(name: "x", scope: !5, file: !1, line: 1, type: !10) | |
| !10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) | |
| !11 = !DILocation(line: 1, column: 1, scope: !5) | |
| ... | |
| --- | |
| name: fred | |
| noVRegs: true | |
| body: | | |
| bb.0: | |
| successors: %bb.1(0x80000000) | |
| liveins: $r0, $r2 | |
| $r1 = A2_addi $r0, -1 | |
| DBG_VALUE $p0, $noreg, !9, !DIExpression(), debug-location !11 | |
| $r3 = A2_tfrsi 2 | |
| $p0 = C2_cmpgtu killed $r3, $r1 | |
| DBG_VALUE $p0, $noreg, !9, !DIExpression(), debug-location !11 | |
| $r2 = S4_subaddi killed $r1, 1, killed $r2 | |
| J2_jumpt killed $p0, %bb.1, implicit-def $pc | |
| bb.1: | |
| liveins: $r0, $r31 | |
| DBG_VALUE $p0, $noreg, !9, !DIExpression(), debug-location !11 | |
| $p0 = C2_cmpeqi $r0, 3 | |
| DBG_VALUE $p0, $noreg, !9, !DIExpression(), debug-location !11 | |
| PS_jmpret $r31, implicit-def dead $pc | |
| ... |