1 # Check that the backend can produce a branch-on-count instruction also in
2 # the presence of a DEBUG_VALUE machine instruction.
4 # RUN: llc %s -mtriple=s390x-linux-gnu -mcpu=z13 -start-before=postrapseudos \
5 # RUN: -o - 2>&1 | FileCheck %s
11 define dso_local void @put_charge_groups_in_box() local_unnamed_addr #0 !dbg !5 {
15 bb2: ; preds = %bb2, %bb3, %bb
16 br i1 undef, label %bb2, label %bb3.preheader
18 bb3.preheader: ; preds = %bb2
21 bb3: ; preds = %bb3.preheader, %bb3
22 %tmp4 = phi i64 [ %tmp6, %bb3 ], [ 2, %bb3.preheader ]
23 %tmp6 = add nsw i64 %tmp4, -1
24 ; Keep the dbg metadata live by referencing it in the IR.
25 call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !7, metadata !DIExpression())
26 %tmp8 = icmp eq i64 %tmp6, 0
27 br i1 %tmp8, label %bb2, label %bb3
30 declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1
32 declare void @llvm.stackprotector(i8*, i8**) #2
34 attributes #0 = { "target-cpu"="z13" "use-soft-float"="false" }
35 attributes #1 = { nounwind readnone speculatable "target-cpu"="z13" }
36 attributes #2 = { nounwind }
39 !llvm.module.flags = !{!3, !4}
41 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "llvm", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
42 !1 = !DIFile(filename: "test.ll", directory: "/tmp")
44 !3 = !{i32 2, !"Dwarf Version", i32 4}
45 !4 = !{i32 2, !"Debug Info Version", i32 3}
46 !5 = distinct !DISubprogram(name: "test_dbg_value", scope: !1, file: !1, line: 1, type: !6, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
47 !6 = !DISubroutineType(types: !2)
48 !7 = !DILocalVariable(name: "in", arg: 1, scope: !5, file: !1, line: 1, type: !8)
49 !8 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
50 !9 = !DILocation(line: 1, column: 1, scope: !5)
54 name: put_charge_groups_in_box
56 tracksRegLiveness: true
61 renamable $r0l = LHIMux 0
66 CHIMux renamable $r0l, 0, implicit-def $cc
67 BRC 14, 6, %bb.1, implicit killed $cc
72 renamable $r1d = LGHI 2
75 successors: %bb.1(0x04000000), %bb.3(0x7c000000)
78 renamable $r1d = nsw AGHI killed renamable $r1d, -1, implicit-def dead $cc
79 DBG_VALUE $r1d, $noreg, !7, !DIExpression(), debug-location !9
80 CGHI renamable $r1d, 0, implicit-def $cc
81 DBG_VALUE $r1d, $noreg, !7, !DIExpression(), debug-location !9
82 BRC 14, 6, %bb.3, implicit $cc