brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.9 KiB · 885b2a6 Raw
86 lines · plain
1# Check that the backend can produce a branch-on-count instruction also in2# the presence of a DEBUG_VALUE machine instruction.3#4# RUN: llc %s -mtriple=s390x-linux-gnu -mcpu=z13 -start-before=postrapseudos \5# RUN:   -o - 2>&1 | FileCheck %s6#7# CHECK: brctg8 9--- |10  11  define dso_local void @put_charge_groups_in_box() local_unnamed_addr #0 !dbg !5 {12  bb:13    br label %bb214  15  bb2:                                              ; preds = %bb2, %bb3, %bb16    br i1 undef, label %bb2, label %bb3.preheader17  18  bb3.preheader:                                    ; preds = %bb219    br label %bb320  21  bb3:                                              ; preds = %bb3.preheader, %bb322    %tmp4 = phi i64 [ %tmp6, %bb3 ], [ 2, %bb3.preheader ]23    %tmp6 = add nsw i64 %tmp4, -124    ; 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, 027    br i1 %tmp8, label %bb2, label %bb328  }29  30  declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #131  32  declare void @llvm.stackprotector(ptr, ptr) #233  34  attributes #0 = { "target-cpu"="z13" "use-soft-float"="false" }35  attributes #1 = { nounwind readnone speculatable "target-cpu"="z13" }36  attributes #2 = { nounwind }37  38  !llvm.dbg.cu = !{!0}39  !llvm.module.flags = !{!3, !4}40  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")43  !2 = !{}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)51 52...53---54name:            put_charge_groups_in_box55alignment:       1656tracksRegLiveness: true57frameInfo:       58  maxCallFrameSize: 059body:             |60  bb.0.bb:61    renamable $r0l = LHIMux 062  63  bb.1.bb2:64    liveins: $r0l65  66    CHIMux renamable $r0l, 0, implicit-def $cc67    BRC 14, 6, %bb.1, implicit killed $cc68  69  bb.2.bb3.preheader:70    liveins: $r0l71  72    renamable $r1d = LGHI 273  74  bb.3.bb3:75    successors: %bb.1(0x04000000), %bb.3(0x7c000000)76    liveins: $r1d, $r0l77  78    renamable $r1d = nsw AGHI killed renamable $r1d, -1, implicit-def dead $cc79    DBG_VALUE $r1d, $noreg, !7, !DIExpression(), debug-location !980    CGHI renamable $r1d, 0, implicit-def $cc81    DBG_VALUE $r1d, $noreg, !7, !DIExpression(), debug-location !982    BRC 14, 6, %bb.3, implicit $cc83    J %bb.184 85...86