81 lines · plain
1# Check that the backend can produce a load-and-trap instruction also in2# the presence of a DEBUG_VALUE machine instruction.3#4# RUN: llc %s -mtriple=s390x-linux-gnu -mcpu=zEC12 -start-before=postrapseudos \5# RUN: -o - 2>&1 | FileCheck %s6#7# CHECK: lat8 9--- |10 11 define i32 @f1(ptr %ptr) #1 {12 entry:13 %val = load i32, ptr %ptr14 ; Keep the dbg metadata live by referencing it in the IR.15 call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !7, metadata !DIExpression()), !dbg !916 %cmp = icmp eq i32 %val, 017 br i1 %cmp, label %if.then, label %if.end18 19 if.then: ; preds = %entry20 tail call void @llvm.trap()21 unreachable22 23 if.end: ; preds = %entry24 ret i32 %val25 }26 27 declare void @llvm.trap() #028 declare void @llvm.dbg.value(metadata, i64, metadata, metadata)29 30 declare void @llvm.stackprotector(ptr, ptr) #231 32 attributes #0 = { cold noreturn nounwind "target-cpu"="zEC12" }33 attributes #1 = { "target-cpu"="zEC12" }34 attributes #2 = { nounwind }35 36 !llvm.dbg.cu = !{!0}37 !llvm.module.flags = !{!3, !4}38 39 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "llvm", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)40 !1 = !DIFile(filename: "test.ll", directory: "/tmp")41 !2 = !{}42 !3 = !{i32 2, !"Dwarf Version", i32 4}43 !4 = !{i32 2, !"Debug Info Version", i32 3}44 !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)45 !6 = !DISubroutineType(types: !2)46 !7 = !DILocalVariable(name: "in", arg: 1, scope: !5, file: !1, line: 1, type: !8)47 !8 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)48 !9 = !DILocation(line: 1, column: 1, scope: !5)49 50...51---52name: f153alignment: 1654tracksRegLiveness: true55liveins: 56 - { reg: '$r2d' }57frameInfo: 58 maxCallFrameSize: 059body: |60 bb.0.entry:61 successors: %bb.1(0x00000001), %bb.2(0x7fffffff)62 liveins: $r2d63 64 renamable $r2l = LMux killed renamable $r2d, 0, $noreg :: (load (s32) from %ir.ptr)65 DBG_VALUE $noreg, $r2l, !7, !DIExpression(), debug-location !966 CHIMux renamable $r2l, 0, implicit-def $cc67 DBG_VALUE $noreg, $r2l, !7, !DIExpression(), debug-location !968 BRC 14, 6, %bb.2, implicit killed $cc69 70 bb.1.if.then:71 successors: 72 73 Trap74 75 bb.2.if.end:76 liveins: $r2l77 78 Return implicit $r2l79 80...81