Imported Upstream version 5.18.0.207

Former-commit-id: 3b152f462918d427ce18620a2cbe4f8b79650449
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-11-17 08:23:10 +00:00
parent 8e12397d70
commit eb85e2fc17
28480 changed files with 72 additions and 3866936 deletions

View File

@ -1,173 +0,0 @@
# RUN: llc -start-after=livedebugvalues -filetype=obj -o - %s \
# RUN: | llvm-dwarfdump - | FileCheck %s
# CHECK: .debug_info contents:
# CHECK: DW_TAG_formal_parameter
# CHECK: DW_TAG_formal_parameter
# CHECK-NEXT: DW_AT_location
# CHECK-NEXT: 0x0000000000000000 - 0x0000000000000014: DW_OP_reg1 W1
# CHECK-NEXT: 0x0000000000000014 - 0x0000000000000038: DW_OP_breg31 WSP+8
# CHECK-NEXT: DW_AT_name {{.*}}"y"
--- |
; Generated at -Os from:
; struct Rect {
; double x, y, w, h;
; };
; void g(struct Rect);
; void h(int *);
; int f(int x, int y, struct Rect s) {
; g(s);
; if (y)
; h(&x);
; return 0;
; }
source_filename = "/tmp/clobber.c"
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
target triple = "arm64-apple-ios"
%struct.Rect = type { double, double, double, double }
; Function Attrs: nounwind optsize ssp
define i32 @f(i32 %x, i32 %y, [4 x double] %s.coerce) local_unnamed_addr #0 !dbg !7 {
entry:
%x.addr = alloca i32, align 4
tail call void @llvm.dbg.value(metadata i32 %x, i64 0, metadata !19, metadata !22), !dbg !23
store i32 %x, i32* %x.addr, align 4, !tbaa !24
tail call void @llvm.dbg.value(metadata i32 %y, i64 0, metadata !20, metadata !22), !dbg !28
tail call void @llvm.dbg.declare(metadata %struct.Rect* undef, metadata !21, metadata !22), !dbg !29
tail call void @g([4 x double] %s.coerce) #4, !dbg !30
%tobool = icmp eq i32 %y, 0, !dbg !31
br i1 %tobool, label %if.end, label %if.then, !dbg !33
if.then: ; preds = %entry
tail call void @llvm.dbg.value(metadata i32* %x.addr, i64 0, metadata !19, metadata !22), !dbg !23
call void @h(i32* nonnull %x.addr) #4, !dbg !34
br label %if.end, !dbg !34
if.end: ; preds = %if.then, %entry
ret i32 0, !dbg !35
}
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
declare void @g([4 x double]) local_unnamed_addr #2
declare void @h(i32*) local_unnamed_addr #2
declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1
declare void @llvm.stackprotector(i8*, i8**) #3
attributes #0 = { nounwind optsize ssp }
attributes #1 = { nounwind readnone speculatable }
attributes #2 = { optsize }
attributes #3 = { nounwind }
attributes #4 = { nounwind optsize }
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4, !5}
!llvm.ident = !{!6}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 5.0.0 (trunk 302682) (llvm/trunk 302683)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
!1 = !DIFile(filename: "/tmp/clobber.c", directory: "/Volumes/Data/apple-internal/swift")
!2 = !{}
!3 = !{i32 2, !"Dwarf Version", i32 2}
!4 = !{i32 2, !"Debug Info Version", i32 3}
!5 = !{i32 1, !"PIC Level", i32 2}
!6 = !{!"clang version 5.0.0 (trunk 302682) (llvm/trunk 302683)"}
!7 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 7, type: !8, isLocal: false, isDefinition: true, scopeLine: 7, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !18)
!8 = !DISubroutineType(types: !9)
!9 = !{!10, !10, !10, !11}
!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!11 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Rect", file: !1, line: 1, size: 256, elements: !12)
!12 = !{!13, !15, !16, !17}
!13 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !11, file: !1, line: 2, baseType: !14, size: 64)
!14 = !DIBasicType(name: "double", size: 64, encoding: DW_ATE_float)
!15 = !DIDerivedType(tag: DW_TAG_member, name: "y", scope: !11, file: !1, line: 2, baseType: !14, size: 64, offset: 64)
!16 = !DIDerivedType(tag: DW_TAG_member, name: "w", scope: !11, file: !1, line: 2, baseType: !14, size: 64, offset: 128)
!17 = !DIDerivedType(tag: DW_TAG_member, name: "h", scope: !11, file: !1, line: 2, baseType: !14, size: 64, offset: 192)
!18 = !{!19, !20, !21}
!19 = !DILocalVariable(name: "x", arg: 1, scope: !7, file: !1, line: 7, type: !10)
!20 = !DILocalVariable(name: "y", arg: 2, scope: !7, file: !1, line: 7, type: !10)
!21 = !DILocalVariable(name: "s", arg: 3, scope: !7, file: !1, line: 7, type: !11)
!22 = !DIExpression()
!23 = !DILocation(line: 7, column: 11, scope: !7)
!24 = !{!25, !25, i64 0}
!25 = !{!"int", !26, i64 0}
!26 = !{!"omnipotent char", !27, i64 0}
!27 = !{!"Simple C/C++ TBAA"}
!28 = !DILocation(line: 7, column: 18, scope: !7)
!29 = !DILocation(line: 7, column: 33, scope: !7)
!30 = !DILocation(line: 8, column: 3, scope: !7)
!31 = !DILocation(line: 9, column: 7, scope: !32)
!32 = distinct !DILexicalBlock(scope: !7, file: !1, line: 9, column: 7)
!33 = !DILocation(line: 9, column: 7, scope: !7)
!34 = !DILocation(line: 10, column: 5, scope: !32)
!35 = !DILocation(line: 12, column: 3, scope: !7)
!36 = !DIExpression(DW_OP_constu, 8, DW_OP_plus)
...
---
name: f
alignment: 2
exposesReturnsTwice: false
legalized: false
regBankSelected: false
selected: false
tracksRegLiveness: true
liveins:
- { reg: '%w0' }
- { reg: '%w1' }
- { reg: '%d0' }
- { reg: '%d1' }
- { reg: '%d2' }
- { reg: '%d3' }
frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
hasPatchPoint: false
stackSize: 32
offsetAdjustment: 0
maxAlignment: 8
adjustsStack: true
hasCalls: true
maxCallFrameSize: 0
hasOpaqueSPAdjustment: false
hasVAStart: false
hasMustTailInVarArgFunc: false
stack:
- { id: 0, name: x.addr, offset: -20, size: 4, alignment: 4, local-offset: -4 }
- { id: 1, type: spill-slot, offset: -24, size: 4, alignment: 4 }
- { id: 2, type: spill-slot, offset: -8, size: 8, alignment: 8, callee-saved-register: '%lr' }
- { id: 3, type: spill-slot, offset: -16, size: 8, alignment: 8, callee-saved-register: '%fp' }
body: |
bb.0.entry:
successors: %bb.2.if.end(0x40000000), %bb.1.if.then(0x40000000)
liveins: %w0, %w1, %d0, %d1, %d2, %d3, %lr
%sp = frame-setup SUBXri %sp, 32, 0
frame-setup STPXi killed %fp, killed %lr, %sp, 2 :: (store 8 into %stack.3), (store 8 into %stack.2)
%fp = frame-setup ADDXri %sp, 16, 0
DBG_VALUE debug-use %w0, debug-use _, !19, !22, debug-location !23
STURWi killed %w0, %fp, -4 :: (store 4 into %stack.0.x.addr)
DBG_VALUE debug-use %w1, debug-use _, !20, !22, debug-location !28
STRWui killed %w1, %sp, 2, debug-location !30 :: (store 4 into %stack.1)
DBG_VALUE %sp, 0, !20, !36, debug-location !28
BL @g, csr_aarch64_aapcs, implicit-def dead %lr, implicit %sp, implicit killed %d0, implicit killed %d1, implicit killed %d2, implicit killed %d3, implicit-def %sp, debug-location !30
%w0 = LDRWui %sp, 2, debug-location !33 :: (load 4 from %stack.1)
CBZW killed %w0, %bb.2.if.end, debug-location !33
bb.1.if.then:
successors: %bb.2.if.end(0x80000000)
DBG_VALUE debug-use %sp, 0, !20, !36, debug-location !28
%x0 = SUBXri %fp, 4, 0
DBG_VALUE debug-use %x0, debug-use _, !19, !22, debug-location !23
BL @h, csr_aarch64_aapcs, implicit-def dead %lr, implicit %sp, implicit killed %x0, debug-location !34
bb.2.if.end:
DBG_VALUE debug-use %sp, 0, !20, !36, debug-location !28
%w8 = MOVZWi 0, 0
%x0 = ORRXrs %xzr, undef %x8, 0, implicit killed %w8, debug-location !35
%fp, %lr = LDPXi %sp, 2, debug-location !35 :: (load 8 from %stack.3), (load 8 from %stack.2)
%sp = ADDXri %sp, 32, 0, debug-location !35
RET undef %lr, implicit killed %w0, debug-location !35
...

View File

@ -1,249 +0,0 @@
# RUN: llc -start-after=livedebugvalues -filetype=obj -o - %s \
# RUN: | llvm-dwarfdump -v - | FileCheck %s
# This tests for a crash in DwarfDebug's singular DBG_VALUE range promotion when
# encountering an IMPLICIT_DEF in its own lexical scope.
# CHECK: .debug_info contents:
# CHECK: DW_TAG_formal_parameter
# CHECK: DW_AT_const_value [DW_FORM_udata] (0)
--- |
; ModuleID = 't.ll'
source_filename = "t.ll"
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
target triple = "aarch64--linux-gnu"
%class.v = type <{ i32, i8, i8, [2 x i8] }>
%class.j = type <{ %"class.j<6, a::f>::D", i32, [4 x i8] }>
%"class.j<6, a::f>::D" = type { %"class.j<6, a::f>::p" }
%"class.j<6, a::f>::p" = type { i64 }
@bt = global i32 0, align 4
define void @_ZN1v2bvEv(%class.v* nocapture readonly %this) local_unnamed_addr align 2 !dbg !14 {
entry:
%bz = alloca %class.j, align 8
%att = alloca %class.j, align 8
%ap = getelementptr inbounds %class.v, %class.v* %this, i64 0, i32 1
%0 = load i8, i8* %ap, align 4
%conv = sext i8 %0 to i32
switch i32 %conv, label %sw.epilog [
i32 1, label %_ZN1jILi6EN1a1fEE1mEj.exit
i32 0, label %sw.bb2
]
_ZN1jILi6EN1a1fEE1mEj.exit: ; preds = %entry
%1 = bitcast %class.j* %att to i64*
%2 = bitcast %class.j* %bz to i64*
store i64 1, i64* %2, align 8
call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !18, metadata !23), !dbg !24
store i64 1, i64* %1, align 8, !dbg !27
br label %sw.epilog
sw.bb2: ; preds = %entry
%3 = bitcast %class.j* %att to i64*
%4 = bitcast %class.j* %bz to i64*
%.pre = load i64, i64* %3, align 8
%agg.tmp.sroa.2.0..sroa_idx1.i.i.i.i.i.i13.phi.trans.insert = getelementptr inbounds %class.j, %class.j* %bz, i64 0, i32 1
%.phi.trans.insert = bitcast i32* %agg.tmp.sroa.2.0..sroa_idx1.i.i.i.i.i.i13.phi.trans.insert to i64*
%agg.tmp.sroa.2.0.copyload2.i.i6.i.i.i.i14.pre = load i64, i64* %.phi.trans.insert, align 8
%.pre25 = load i64, i64* %4, align 8
%agg.tmp.sroa.2.0..sroa_idx1.i.i.i.i.i.i.phi.trans.insert = getelementptr inbounds %class.j, %class.j* %att, i64 0, i32 1
%.phi.trans.insert26 = bitcast i32* %agg.tmp.sroa.2.0..sroa_idx1.i.i.i.i.i.i.phi.trans.insert to i64*
%agg.tmp.sroa.2.0.copyload2.i.i6.i.i.i.i.pre = load i64, i64* %.phi.trans.insert26, align 8
br label %sw.epilog
sw.epilog: ; preds = %sw.bb2, %_ZN1jILi6EN1a1fEE1mEj.exit, %entry
%agg.tmp.sroa.2.0.copyload2.i.i6.i.i.i.i = phi i64 [ %agg.tmp.sroa.2.0.copyload2.i.i6.i.i.i.i.pre, %sw.bb2 ], [ undef, %entry ], [ undef, %_ZN1jILi6EN1a1fEE1mEj.exit ], !dbg !32
%5 = phi i64 [ %.pre25, %sw.bb2 ], [ 0, %entry ], [ 1, %_ZN1jILi6EN1a1fEE1mEj.exit ]
%agg.tmp.sroa.2.0.copyload2.i.i6.i.i.i.i14 = phi i64 [ %agg.tmp.sroa.2.0.copyload2.i.i6.i.i.i.i14.pre, %sw.bb2 ], [ undef, %entry ], [ undef, %_ZN1jILi6EN1a1fEE1mEj.exit ]
%6 = phi i64 [ %.pre, %sw.bb2 ], [ 0, %entry ], [ 1, %_ZN1jILi6EN1a1fEE1mEj.exit ]
%bw1 = bitcast %class.v* %this to i32*
%7 = load i32, i32* %bw1, align 4
%bx = getelementptr inbounds %class.v, %class.v* %this, i64 0, i32 2
%8 = load i8, i8* %bx, align 1
%tobool = icmp ne i8 %8, 0
%.fca.0.insert9 = insertvalue [2 x i64] undef, i64 %agg.tmp.sroa.2.0.copyload2.i.i6.i.i.i.i14, 0
%.fca.1.insert12 = insertvalue [2 x i64] %.fca.0.insert9, i64 %5, 1
%.fca.0.insert = insertvalue [2 x i64] undef, i64 %agg.tmp.sroa.2.0.copyload2.i.i6.i.i.i.i, 0
%.fca.1.insert = insertvalue [2 x i64] %.fca.0.insert, i64 %6, 1
call void @_Z2byi1LS_bbPi(i32 %7, [2 x i64] %.fca.1.insert12, [2 x i64] %.fca.1.insert, i1 %tobool, i1 false, i32* nonnull @bt)
ret void
}
declare void @_Z2byi1LS_bbPi(i32, [2 x i64], [2 x i64], i1, i1, i32*) local_unnamed_addr
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #0
; Function Attrs: nounwind
declare void @llvm.stackprotector(i8*, i8**) #1
attributes #0 = { nounwind readnone speculatable }
attributes #1 = { nounwind }
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!12, !13}
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 5.0.0 (trunk 305696) (llvm/trunk 305708)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3, globals: !2)
!1 = !DIFile(filename: "/<stdin>", directory: "/")
!2 = !{}
!3 = !{!4, !10}
!4 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "r", file: !5, line: 50, size: 8, elements: !6, identifier: "_ZTS1r")
!5 = !DIFile(filename: "current.ii", directory: "/")
!6 = !{!7}
!7 = !DISubprogram(name: "r", scope: !4, file: !5, line: 52, type: !8, isLocal: false, isDefinition: false, scopeLine: 52, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: true)
!8 = !DISubroutineType(types: !9)
!9 = !{null}
!10 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "q", scope: !11, file: !5, line: 39, size: 64, elements: !2, identifier: "_ZTSN1jILi6EN1a1fEE1qE")
!11 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "j<6, a::f>", file: !5, line: 7, size: 128, elements: !2, templateParams: !2, identifier: "_ZTS1jILi6EN1a1fEE")
!12 = !{i32 2, !"Debug Info Version", i32 3}
!13 = !{i32 1, !"wchar_size", i32 4}
!14 = distinct !DISubprogram(name: "bv", linkageName: "_ZN1v2bvEv", scope: !15, file: !5, line: 104, type: !16, isLocal: false, isDefinition: true, scopeLine: 104, flags: DIFlagPrototyped, isOptimized: true, unit: !0, declaration: !17, variables: !2)
!15 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "v", file: !5, line: 97, size: 64, elements: !2, identifier: "_ZTS1v")
!16 = !DISubroutineType(types: !2)
!17 = !DISubprogram(name: "bv", linkageName: "_ZN1v2bvEv", scope: !15, file: !5, line: 98, type: !16, isLocal: false, isDefinition: false, scopeLine: 98, flags: DIFlagPrototyped, isOptimized: true)
!18 = !DILocalVariable(arg: 2, scope: !19, file: !5, line: 22, type: !21)
!19 = distinct !DISubprogram(name: "m", linkageName: "_ZN1jILi6EN1a1fEE1mEj", scope: !11, file: !5, line: 22, type: !16, isLocal: false, isDefinition: true, scopeLine: 22, flags: DIFlagPrototyped, isOptimized: true, unit: !0, declaration: !20, variables: !2)
!20 = !DISubprogram(name: "m", linkageName: "_ZN1jILi6EN1a1fEE1mEj", scope: !11, file: !5, line: 22, type: !16, isLocal: false, isDefinition: false, scopeLine: 22, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: true)
!21 = !DIDerivedType(tag: DW_TAG_typedef, name: "h", file: !5, line: 10, baseType: !22)
!22 = !DIBasicType(name: "unsigned int", size: 32, encoding: DW_ATE_unsigned)
!23 = !DIExpression()
!24 = !DILocation(line: 22, scope: !19, inlinedAt: !25)
!25 = distinct !DILocation(line: 109, scope: !26)
!26 = distinct !DILexicalBlock(scope: !14, file: !5, line: 106)
!27 = !DILocation(line: 29, scope: !28, inlinedAt: !31)
!28 = distinct !DISubprogram(name: "n", linkageName: "_ZN1jILi6EN1a1fEE1p1nEl", scope: !29, file: !5, line: 29, type: !8, isLocal: false, isDefinition: true, scopeLine: 29, flags: DIFlagPrototyped, isOptimized: true, unit: !0, declaration: !30, variables: !2)
!29 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "p", scope: !11, file: !5, line: 26, size: 64, elements: !2, identifier: "_ZTSN1jILi6EN1a1fEE1pE")
!30 = !DISubprogram(name: "n", linkageName: "_ZN1jILi6EN1a1fEE1p1nEl", scope: !29, file: !5, line: 29, type: !8, isLocal: false, isDefinition: false, scopeLine: 29, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: true)
!31 = distinct !DILocation(line: 24, scope: !19, inlinedAt: !25)
!32 = !DILocation(line: 61, scope: !33, inlinedAt: !38)
!33 = distinct !DISubprogram(name: "bc<j<6, a::f> >", linkageName: "_ZN1s2bcI1jILi6EN1a1fEEEEDTcl2badeclsr1aE2aaIPT_EEEES6_", scope: !34, file: !5, line: 60, type: !16, isLocal: false, isDefinition: true, scopeLine: 60, flags: DIFlagPrototyped, isOptimized: true, unit: !0, templateParams: !36, declaration: !35, variables: !2)
!34 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "s", file: !5, line: 59, size: 8, elements: !2, identifier: "_ZTS1s")
!35 = !DISubprogram(name: "bc<j<6, a::f> >", linkageName: "_ZN1s2bcI1jILi6EN1a1fEEEEDTcl2badeclsr1aE2aaIPT_EEEES6_", scope: !34, file: !5, line: 60, type: !16, isLocal: false, isDefinition: false, scopeLine: 60, flags: DIFlagPrototyped, isOptimized: true, templateParams: !36)
!36 = !{!37}
!37 = !DITemplateTypeParameter(name: "ay", type: !11)
!38 = distinct !DILocation(line: 70, scope: !39, inlinedAt: !42)
!39 = distinct !DISubprogram(name: "bc", linkageName: "_ZN1JI1s1jILi6EN1a1fEEE2bcEPS4_", scope: !40, file: !5, line: 70, type: !16, isLocal: false, isDefinition: true, scopeLine: 70, flags: DIFlagPrototyped, isOptimized: true, unit: !0, declaration: !41, variables: !2)
!40 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "J<s, j<6, a::f> >", file: !5, line: 69, size: 8, elements: !2, templateParams: !2, identifier: "_ZTS1JI1s1jILi6EN1a1fEEE")
!41 = !DISubprogram(name: "bc", linkageName: "_ZN1JI1s1jILi6EN1a1fEEE2bcEPS4_", scope: !40, file: !5, line: 70, type: !16, isLocal: false, isDefinition: false, scopeLine: 70, flags: DIFlagPrototyped, isOptimized: true)
!42 = distinct !DILocation(line: 85, scope: !43, inlinedAt: !46)
!43 = distinct !DISubprogram(name: "u<j<6, a::f> >", linkageName: "_ZN1uC2I1jILi6EN1a1fEEEERT_", scope: !44, file: !5, line: 85, type: !16, isLocal: false, isDefinition: true, scopeLine: 85, flags: DIFlagPrototyped, isOptimized: true, unit: !0, templateParams: !36, declaration: !45, variables: !2)
!44 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "u", file: !5, line: 82, size: 128, elements: !2, identifier: "_ZTS1u")
!45 = !DISubprogram(name: "u<j<6, a::f> >", scope: !44, file: !5, line: 85, type: !16, isLocal: false, isDefinition: false, scopeLine: 85, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: true, templateParams: !36)
!46 = distinct !DILocation(line: 85, scope: !47, inlinedAt: !48)
!47 = distinct !DISubprogram(name: "u<j<6, a::f> >", linkageName: "_ZN1uC1I1jILi6EN1a1fEEEERT_", scope: !44, file: !5, line: 85, type: !16, isLocal: false, isDefinition: true, scopeLine: 85, flags: DIFlagPrototyped, isOptimized: true, unit: !0, templateParams: !36, declaration: !45, variables: !2)
!48 = distinct !DILocation(line: 92, scope: !49, inlinedAt: !52)
!49 = distinct !DISubprogram(name: "L<j<6, a::f> >", linkageName: "_ZN1LC2I1jILi6EN1a1fEEEERT_", scope: !50, file: !5, line: 92, type: !16, isLocal: false, isDefinition: true, scopeLine: 92, flags: DIFlagPrototyped, isOptimized: true, unit: !0, templateParams: !2, declaration: !51, variables: !2)
!50 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "L", file: !5, line: 88, size: 128, elements: !2, identifier: "_ZTS1L")
!51 = !DISubprogram(name: "L<j<6, a::f> >", scope: !50, file: !5, line: 92, type: !16, isLocal: false, isDefinition: false, scopeLine: 92, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: true, templateParams: !2)
!52 = distinct !DILocation(line: 92, scope: !53, inlinedAt: !54)
!53 = distinct !DISubprogram(name: "L<j<6, a::f> >", linkageName: "_ZN1LC1I1jILi6EN1a1fEEEERT_", scope: !50, file: !5, line: 92, type: !16, isLocal: false, isDefinition: true, scopeLine: 92, flags: DIFlagPrototyped, isOptimized: true, unit: !0, templateParams: !2, declaration: !51, variables: !2)
!54 = distinct !DILocation(line: 114, scope: !14)
...
---
name: _ZN1v2bvEv
alignment: 2
exposesReturnsTwice: false
legalized: false
regBankSelected: false
selected: false
tracksRegLiveness: true
registers:
liveins:
- { reg: '%x0', virtual-reg: '' }
frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
hasPatchPoint: false
stackSize: 48
offsetAdjustment: 0
maxAlignment: 16
adjustsStack: true
hasCalls: true
stackProtector: ''
maxCallFrameSize: 0
hasOpaqueSPAdjustment: false
hasVAStart: false
hasMustTailInVarArgFunc: false
savePoint: ''
restorePoint: ''
fixedStack:
stack:
- { id: 0, name: bz, type: default, offset: -32, size: 16, alignment: 8,
callee-saved-register: '', local-offset: -16, di-variable: '', di-expression: '',
di-location: '' }
- { id: 1, name: att, type: default, offset: -48, size: 16, alignment: 8,
callee-saved-register: '', local-offset: -32, di-variable: '', di-expression: '',
di-location: '' }
- { id: 2, name: '', type: spill-slot, offset: -16, size: 8, alignment: 16,
callee-saved-register: '%lr', di-variable: '', di-expression: '',
di-location: '' }
constants:
body: |
bb.0.entry:
successors: %bb.3.sw.bb2(0x2aaaaaab), %bb.1.entry(0x55555555)
liveins: %x0, %lr
%sp = frame-setup SUBXri %sp, 48, 0
frame-setup STRXui killed %lr, %sp, 4 :: (store 8 into %stack.2)
frame-setup CFI_INSTRUCTION def_cfa_offset 48
frame-setup CFI_INSTRUCTION offset %w30, -16
%w8 = LDRSBWui %x0, 4 :: (load 1 from %ir.ap, align 4)
CBZW %w8, %bb.3.sw.bb2
bb.1.entry:
successors: %bb.2._ZN1jILi6EN1a1fEE1mEj.exit(0x40000001), %bb.4(0x3fffffff)
liveins: %w8, %x0
dead %wzr = SUBSWri killed %w8, 1, 0, implicit-def %nzcv
Bcc 1, %bb.4, implicit %nzcv
bb.2._ZN1jILi6EN1a1fEE1mEj.exit:
successors: %bb.5.sw.epilog(0x80000000)
liveins: %x0
%w2 = ORRWri %wzr, 0, implicit-def %x2
%x3 = IMPLICIT_DEF debug-location !32
%x1 = IMPLICIT_DEF
STRXui %x2, %sp, 2 :: (store 8 into %ir.2)
DBG_VALUE 0, 0, !18, !23, debug-location !24
STRXui %x2, %sp, 0, debug-location !27 :: (store 8 into %ir.1)
%w4 = ORRWri %wzr, 0, implicit-def %x4
B %bb.5.sw.epilog
bb.3.sw.bb2:
successors: %bb.5.sw.epilog(0x80000000)
liveins: %x0
%x4, %x3 = LDPXi %sp, 0 :: (dereferenceable load 8 from %ir.3), (dereferenceable load 8 from %ir..phi.trans.insert26)
%x2, %x1 = LDPXi %sp, 2 :: (dereferenceable load 8 from %ir..phi.trans.insert), (dereferenceable load 8 from %ir.4)
B %bb.5.sw.epilog
bb.4:
successors: %bb.5.sw.epilog(0x80000000)
liveins: %x0
%x2 = ORRXrs %xzr, %xzr, 0
%x4 = ORRXrs %xzr, %xzr, 0
%x3 = IMPLICIT_DEF debug-location !32
%x1 = IMPLICIT_DEF
bb.5.sw.epilog:
liveins: %x0, %x1, %x2, %x3, %x4
%w8 = LDRBBui %x0, 5 :: (load 1 from %ir.bx)
%w0 = LDRWui killed %x0, 0 :: (load 4 from %ir.bw1)
%x7 = ADRP target-flags(aarch64-page) @bt
%x7 = ADDXri killed %x7, target-flags(aarch64-pageoff, aarch64-nc) @bt, 0
dead %wzr = SUBSWri killed %w8, 0, 0, implicit-def %nzcv
%w5 = CSINCWr %wzr, %wzr, 0, implicit killed %nzcv
%w6 = ORRWrs %wzr, %wzr, 0
BL @_Z2byi1LS_bbPi, csr_aarch64_aapcs, implicit-def dead %lr, implicit %sp, implicit killed %w0, implicit killed %x1, implicit killed %x2, implicit killed %x3, implicit killed %x4, implicit killed %w5, implicit killed %w6, implicit killed %x7, implicit-def %sp
%lr = LDRXui %sp, 4 :: (load 8 from %stack.2)
%sp = ADDXri %sp, 48, 0
RET undef %lr
...

View File

@ -1,3 +0,0 @@
if not 'AArch64' in config.root.targets:
config.unsupported = True

View File

@ -1,3 +0,0 @@
if not 'ARM' in config.root.targets:
config.unsupported = True

View File

@ -1,123 +0,0 @@
# RUN: llc -start-before=livedebugvalues -filetype=obj -o - %s | \
# RUN: llvm-dwarfdump - | FileCheck %s
#
# This is an artificial example of a debug value residing in a composite
# location with a complex expression. Because the semantics of applying a DWARF
# expression to a composite location are ill-defined, the compiler should bail
# out of emitting a location.
#
# CHECK: .debug_info contents:
# CHECK: DW_TAG_variable
# CHECK-NOT: DW_AT_location
# CHECK: DW_TAG
--- |
; Generated from:
; typedef float vec2 __attribute__((vector_size(16)));
; vec2 v();
; float f() {
; vec2 vec = v();
; return vec[0] + vec[1];
; }
target datalayout = "e-m:o-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32"
target triple = "thumbv7s-apple-ios5.0.0"
define float @f() local_unnamed_addr #0 !dbg !9 {
entry:
%call = tail call <4 x float> bitcast (<4 x float> (...)* @v to <4 x float> ()*)() #0, !dbg !19
tail call void @llvm.dbg.value(metadata <4 x float> %call, i64 0, metadata !14, metadata !20), !dbg !21
%vecext = extractelement <4 x float> %call, i32 0, !dbg !22
%vecext1 = extractelement <4 x float> %call, i32 1, !dbg !23
%add = fadd float %vecext, %vecext1, !dbg !24
ret float %add, !dbg !25
}
declare arm_aapcs_vfpcc <4 x float> @v(...) local_unnamed_addr #0
declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #0
attributes #0 = { nounwind readnone }
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4}
!llvm.ident = !{!8}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 4.0.0 (trunk 286322) (llvm/trunk 286305)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
!1 = !DIFile(filename: "v.c", directory: "/")
!2 = !{}
!3 = !{i32 2, !"Dwarf Version", i32 2}
!4 = !{i32 2, !"Debug Info Version", i32 3}
!8 = !{!"clang version 4.0.0 (trunk 286322) (llvm/trunk 286305)"}
!9 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 3, type: !10, isLocal: false, isDefinition: true, scopeLine: 3, isOptimized: true, unit: !0, variables: !13)
!10 = !DISubroutineType(types: !11)
!11 = !{!12}
!12 = !DIBasicType(name: "float", size: 32, encoding: DW_ATE_float)
!13 = !{!14}
!14 = !DILocalVariable(name: "vec", scope: !9, file: !1, line: 4, type: !15)
!15 = !DIDerivedType(tag: DW_TAG_typedef, name: "vec2", file: !1, line: 1, baseType: !16)
!16 = !DICompositeType(tag: DW_TAG_array_type, baseType: !12, size: 128, flags: DIFlagVector, elements: !17)
!17 = !{!18}
!18 = !DISubrange(count: 4)
!19 = !DILocation(line: 4, column: 13, scope: !9)
!20 = !DIExpression(DW_OP_plus_uconst, 1, DW_OP_constu, 1, DW_OP_minus)
!21 = !DILocation(line: 4, column: 7, scope: !9)
!22 = !DILocation(line: 5, column: 9, scope: !9)
!23 = !DILocation(line: 5, column: 18, scope: !9)
!24 = !DILocation(line: 5, column: 16, scope: !9)
!25 = !DILocation(line: 5, column: 2, scope: !9)
...
---
name: f
alignment: 1
exposesReturnsTwice: false
legalized: false
regBankSelected: false
selected: false
tracksRegLiveness: true
calleeSavedRegisters: [ '%lr', '%d8', '%d9', '%d10', '%d11', '%d12', '%d13',
'%d14', '%d15', '%q4', '%q5', '%q6', '%q7', '%r4',
'%r5', '%r6', '%r7', '%r8', '%r10', '%r11', '%s16',
'%s17', '%s18', '%s19', '%s20', '%s21', '%s22',
'%s23', '%s24', '%s25', '%s26', '%s27', '%s28',
'%s29', '%s30', '%s31', '%d8_d10', '%d9_d11', '%d10_d12',
'%d11_d13', '%d12_d14', '%d13_d15', '%q4_q5', '%q5_q6',
'%q6_q7', '%q4_q5_q6_q7', '%r4_r5', '%r6_r7', '%r10_r11',
'%d8_d9_d10', '%d9_d10_d11', '%d10_d11_d12', '%d11_d12_d13',
'%d12_d13_d14', '%d13_d14_d15', '%d8_d10_d12',
'%d9_d11_d13', '%d10_d12_d14', '%d11_d13_d15',
'%d8_d10_d12_d14', '%d9_d11_d13_d15', '%d9_d10',
'%d11_d12', '%d13_d14', '%d9_d10_d11_d12', '%d11_d12_d13_d14' ]
frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
hasPatchPoint: false
stackSize: 4
offsetAdjustment: 0
maxAlignment: 4
adjustsStack: true
hasCalls: true
maxCallFrameSize: 0
hasOpaqueSPAdjustment: false
hasVAStart: false
hasMustTailInVarArgFunc: false
stack:
- { id: 0, type: spill-slot, offset: -4, size: 4, alignment: 4, callee-saved-register: '%lr' }
body: |
bb.0.entry:
liveins: %lr
early-clobber %sp = frame-setup t2STR_PRE killed undef %lr, %sp, -4, 14, _
frame-setup CFI_INSTRUCTION def_cfa_offset 4
frame-setup CFI_INSTRUCTION offset %lr, -4
tBL 14, _, @v, csr_ios, implicit-def dead %lr, implicit %sp, implicit-def %sp, implicit-def %r0, implicit-def %r1, implicit-def %r2, implicit-def %r3, debug-location !19
%d1 = VMOVDRR killed %r2, killed %r3, 14, _, implicit-def %q0, debug-location !19
%d0 = VMOVDRR killed %r0, killed %r1, 14, _, implicit killed %q0, implicit-def %q0, debug-location !19
DBG_VALUE debug-use %q0, debug-use _, !14, !20, debug-location !21
%s4 = VMOVS %s1, 14, _, implicit-def %d2, debug-location !24
%d0 = VADDfd %d0, killed %d2, 14, _, implicit killed %q0, debug-location !24
%r0 = VMOVRS %s0, 14, _, implicit killed %d0, debug-location !25
%lr, %sp = t2LDR_POST %sp, 4, 14, _, debug-location !25
tBX_RET 14, _, implicit %r0, debug-location !25
...

View File

@ -1,123 +0,0 @@
# RUN: llc -start-before=livedebugvalues -filetype=obj -o - %s | \
# RUN: llvm-dwarfdump -debug-info - | FileCheck %s
# CHECK: .debug_info contents:
# CHECK: DW_TAG_variable
# CHECK-NEXT: DW_AT_location
# CHECK-NEXT: 0x0000000000000010 - 0x0000000000000018: DW_OP_piece 0x10, DW_OP_regx D0, DW_OP_piece 0x8, DW_OP_regx D1, DW_OP_piece 0x8)
# CHECK-NEXT: DW_AT_name {{.*}}"vec"
--- |
; Generate from (and then manually modified to incorporate a DW_OP_LLVM_fragment):
; typedef float vec2 __attribute__((vector_size(16)));
; vec2 v();
; float f() {
; vec2 vec = v();
; return vec[0] + vec[1];
; }
target datalayout = "e-m:o-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32"
target triple = "thumbv7s-apple-ios5.0.0"
define float @f() local_unnamed_addr #0 !dbg !9 {
entry:
%call = tail call <4 x float> bitcast (<4 x float> (...)* @v to <4 x float> ()*)() #0, !dbg !19
tail call void @llvm.dbg.value(metadata <4 x float> %call, i64 0, metadata !14, metadata !20), !dbg !21
%vecext = extractelement <4 x float> %call, i32 0, !dbg !22
%vecext1 = extractelement <4 x float> %call, i32 1, !dbg !23
%add = fadd float %vecext, %vecext1, !dbg !24
ret float %add, !dbg !25
}
declare arm_aapcs_vfpcc <4 x float> @v(...) local_unnamed_addr #0
declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #0
attributes #0 = { nounwind readnone }
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4, !5, !6, !7}
!llvm.ident = !{!8}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 4.0.0 (trunk 286322) (llvm/trunk 286305)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
!1 = !DIFile(filename: "v.c", directory: "/")
!2 = !{}
!3 = !{i32 2, !"Dwarf Version", i32 2}
!4 = !{i32 2, !"Debug Info Version", i32 3}
!5 = !{i32 1, !"wchar_size", i32 4}
!6 = !{i32 1, !"min_enum_size", i32 4}
!7 = !{i32 1, !"PIC Level", i32 2}
!8 = !{!"clang version 4.0.0 (trunk 286322) (llvm/trunk 286305)"}
!9 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 3, type: !10, isLocal: false, isDefinition: true, scopeLine: 3, isOptimized: true, unit: !0, variables: !13)
!10 = !DISubroutineType(types: !11)
!11 = !{!12}
!12 = !DIBasicType(name: "float", size: 32, encoding: DW_ATE_float)
!13 = !{!14}
!14 = !DILocalVariable(name: "vec", scope: !9, file: !1, line: 4, type: !15)
!15 = !DIDerivedType(tag: DW_TAG_typedef, name: "vec2", file: !1, line: 1, baseType: !16)
!16 = !DICompositeType(tag: DW_TAG_array_type, baseType: !12, size: 256, flags: DIFlagVector, elements: !17)
!17 = !{!18}
!18 = !DISubrange(count: 8)
!19 = !DILocation(line: 4, column: 13, scope: !9)
!20 = !DIExpression(DW_OP_LLVM_fragment, 128, 128)
!21 = !DILocation(line: 4, column: 7, scope: !9)
!22 = !DILocation(line: 5, column: 9, scope: !9)
!23 = !DILocation(line: 5, column: 18, scope: !9)
!24 = !DILocation(line: 5, column: 16, scope: !9)
!25 = !DILocation(line: 5, column: 2, scope: !9)
...
---
name: f
alignment: 1
exposesReturnsTwice: false
legalized: false
regBankSelected: false
selected: false
tracksRegLiveness: true
calleeSavedRegisters: [ '%lr', '%d8', '%d9', '%d10', '%d11', '%d12', '%d13',
'%d14', '%d15', '%q4', '%q5', '%q6', '%q7', '%r4',
'%r5', '%r6', '%r7', '%r8', '%r10', '%r11', '%s16',
'%s17', '%s18', '%s19', '%s20', '%s21', '%s22',
'%s23', '%s24', '%s25', '%s26', '%s27', '%s28',
'%s29', '%s30', '%s31', '%d8_d10', '%d9_d11', '%d10_d12',
'%d11_d13', '%d12_d14', '%d13_d15', '%q4_q5', '%q5_q6',
'%q6_q7', '%q4_q5_q6_q7', '%r4_r5', '%r6_r7', '%r10_r11',
'%d8_d9_d10', '%d9_d10_d11', '%d10_d11_d12', '%d11_d12_d13',
'%d12_d13_d14', '%d13_d14_d15', '%d8_d10_d12',
'%d9_d11_d13', '%d10_d12_d14', '%d11_d13_d15',
'%d8_d10_d12_d14', '%d9_d11_d13_d15', '%d9_d10',
'%d11_d12', '%d13_d14', '%d9_d10_d11_d12', '%d11_d12_d13_d14' ]
frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
hasPatchPoint: false
stackSize: 4
offsetAdjustment: 0
maxAlignment: 4
adjustsStack: true
hasCalls: true
maxCallFrameSize: 0
hasOpaqueSPAdjustment: false
hasVAStart: false
hasMustTailInVarArgFunc: false
stack:
- { id: 0, type: spill-slot, offset: -4, size: 4, alignment: 4, callee-saved-register: '%lr' }
body: |
bb.0.entry:
liveins: %lr
early-clobber %sp = frame-setup t2STR_PRE killed undef %lr, %sp, -4, 14, _
frame-setup CFI_INSTRUCTION def_cfa_offset 4
frame-setup CFI_INSTRUCTION offset %lr, -4
tBL 14, _, @v, csr_ios, implicit-def dead %lr, implicit %sp, implicit-def %sp, implicit-def %r0, implicit-def %r1, implicit-def %r2, implicit-def %r3, debug-location !19
%d1 = VMOVDRR killed %r2, killed %r3, 14, _, implicit-def %q0, debug-location !19
%d0 = VMOVDRR killed %r0, killed %r1, 14, _, implicit killed %q0, implicit-def %q0, debug-location !19
DBG_VALUE debug-use %q0, debug-use _, !14, !20, debug-location !21
%s4 = VMOVS %s1, 14, _, implicit-def %d2, debug-location !24
%d0 = VADDfd %d0, killed %d2, 14, _, implicit killed %q0, debug-location !24
%r0 = VMOVRS %s0, 14, _, implicit killed %d0, debug-location !25
%lr, %sp = t2LDR_POST %sp, 4, 14, _, debug-location !25
tBX_RET 14, _, implicit %r0, debug-location !25
...

View File

@ -1,123 +0,0 @@
# RUN: llc -start-before=livedebugvalues -filetype=obj -o - %s | \
# RUN: llvm-dwarfdump - | FileCheck %s
# CHECK: .debug_info contents:
# CHECK: DW_TAG_variable
# CHECK-NEXT: DW_AT_location
# CHECK-NEXT: 0x0000000000000010 - 0x0000000000000018: DW_OP_regx D0, DW_OP_piece 0x8, DW_OP_regx D1, DW_OP_piece 0x8)
# CHECK-NEXT: DW_AT_name {{.*}}"vec"
--- |
; Generated from:
; typedef float vec2 __attribute__((vector_size(16)));
; vec2 v();
; float f() {
; vec2 vec = v();
; return vec[0] + vec[1];
; }
target datalayout = "e-m:o-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32"
target triple = "thumbv7s-apple-ios5.0.0"
define float @f() local_unnamed_addr #0 !dbg !9 {
entry:
%call = tail call <4 x float> bitcast (<4 x float> (...)* @v to <4 x float> ()*)() #0, !dbg !19
tail call void @llvm.dbg.value(metadata <4 x float> %call, i64 0, metadata !14, metadata !20), !dbg !21
%vecext = extractelement <4 x float> %call, i32 0, !dbg !22
%vecext1 = extractelement <4 x float> %call, i32 1, !dbg !23
%add = fadd float %vecext, %vecext1, !dbg !24
ret float %add, !dbg !25
}
declare arm_aapcs_vfpcc <4 x float> @v(...) local_unnamed_addr #0
declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #0
attributes #0 = { nounwind readnone }
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4, !5, !6, !7}
!llvm.ident = !{!8}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 4.0.0 (trunk 286322) (llvm/trunk 286305)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
!1 = !DIFile(filename: "v.c", directory: "/")
!2 = !{}
!3 = !{i32 2, !"Dwarf Version", i32 2}
!4 = !{i32 2, !"Debug Info Version", i32 3}
!5 = !{i32 1, !"wchar_size", i32 4}
!6 = !{i32 1, !"min_enum_size", i32 4}
!7 = !{i32 1, !"PIC Level", i32 2}
!8 = !{!"clang version 4.0.0 (trunk 286322) (llvm/trunk 286305)"}
!9 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 3, type: !10, isLocal: false, isDefinition: true, scopeLine: 3, isOptimized: true, unit: !0, variables: !13)
!10 = !DISubroutineType(types: !11)
!11 = !{!12}
!12 = !DIBasicType(name: "float", size: 32, encoding: DW_ATE_float)
!13 = !{!14}
!14 = !DILocalVariable(name: "vec", scope: !9, file: !1, line: 4, type: !15)
!15 = !DIDerivedType(tag: DW_TAG_typedef, name: "vec2", file: !1, line: 1, baseType: !16)
!16 = !DICompositeType(tag: DW_TAG_array_type, baseType: !12, size: 128, flags: DIFlagVector, elements: !17)
!17 = !{!18}
!18 = !DISubrange(count: 4)
!19 = !DILocation(line: 4, column: 13, scope: !9)
!20 = !DIExpression()
!21 = !DILocation(line: 4, column: 7, scope: !9)
!22 = !DILocation(line: 5, column: 9, scope: !9)
!23 = !DILocation(line: 5, column: 18, scope: !9)
!24 = !DILocation(line: 5, column: 16, scope: !9)
!25 = !DILocation(line: 5, column: 2, scope: !9)
...
---
name: f
alignment: 1
exposesReturnsTwice: false
legalized: false
regBankSelected: false
selected: false
tracksRegLiveness: true
calleeSavedRegisters: [ '%lr', '%d8', '%d9', '%d10', '%d11', '%d12', '%d13',
'%d14', '%d15', '%q4', '%q5', '%q6', '%q7', '%r4',
'%r5', '%r6', '%r7', '%r8', '%r10', '%r11', '%s16',
'%s17', '%s18', '%s19', '%s20', '%s21', '%s22',
'%s23', '%s24', '%s25', '%s26', '%s27', '%s28',
'%s29', '%s30', '%s31', '%d8_d10', '%d9_d11', '%d10_d12',
'%d11_d13', '%d12_d14', '%d13_d15', '%q4_q5', '%q5_q6',
'%q6_q7', '%q4_q5_q6_q7', '%r4_r5', '%r6_r7', '%r10_r11',
'%d8_d9_d10', '%d9_d10_d11', '%d10_d11_d12', '%d11_d12_d13',
'%d12_d13_d14', '%d13_d14_d15', '%d8_d10_d12',
'%d9_d11_d13', '%d10_d12_d14', '%d11_d13_d15',
'%d8_d10_d12_d14', '%d9_d11_d13_d15', '%d9_d10',
'%d11_d12', '%d13_d14', '%d9_d10_d11_d12', '%d11_d12_d13_d14' ]
frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
hasPatchPoint: false
stackSize: 4
offsetAdjustment: 0
maxAlignment: 4
adjustsStack: true
hasCalls: true
maxCallFrameSize: 0
hasOpaqueSPAdjustment: false
hasVAStart: false
hasMustTailInVarArgFunc: false
stack:
- { id: 0, type: spill-slot, offset: -4, size: 4, alignment: 4, callee-saved-register: '%lr' }
body: |
bb.0.entry:
liveins: %lr
early-clobber %sp = frame-setup t2STR_PRE killed undef %lr, %sp, -4, 14, _
frame-setup CFI_INSTRUCTION def_cfa_offset 4
frame-setup CFI_INSTRUCTION offset %lr, -4
tBL 14, _, @v, csr_ios, implicit-def dead %lr, implicit %sp, implicit-def %sp, implicit-def %r0, implicit-def %r1, implicit-def %r2, implicit-def %r3, debug-location !19
%d1 = VMOVDRR killed %r2, killed %r3, 14, _, implicit-def %q0, debug-location !19
%d0 = VMOVDRR killed %r0, killed %r1, 14, _, implicit killed %q0, implicit-def %q0, debug-location !19
DBG_VALUE debug-use %q0, debug-use _, !14, !20, debug-location !21
%s4 = VMOVS %s1, 14, _, implicit-def %d2, debug-location !24
%d0 = VADDfd %d0, killed %d2, 14, _, implicit killed %q0, debug-location !24
%r0 = VMOVRS %s0, 14, _, implicit killed %d0, debug-location !25
%lr, %sp = t2LDR_POST %sp, 4, 14, _, debug-location !25
tBX_RET 14, _, implicit %r0, debug-location !25
...

View File

@ -1,97 +0,0 @@
# RUN: llc -filetype=obj -o - %s | llvm-dwarfdump -v --debug-info - | FileCheck %s
# CHECK: .debug_info contents:
# CHECK: DW_TAG_variable
# CHECK-NEXT: DW_AT_location {{.*}} (DW_OP_reg1 RDX, DW_OP_bit_piece 0x8 0x8)
# CHECK-NEXT: DW_AT_name {{.*}}"dh"
--- |
; Manually created after:
; char f(int i) {
; char dh = i>>8;
; return dh;
; }
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.12.0"
define signext i8 @f(i32 %i) local_unnamed_addr #0 !dbg !7 {
entry:
tail call void @llvm.dbg.value(metadata i32 %i, i64 0, metadata !13, metadata !15), !dbg !16
%shr1 = lshr i32 %i, 8, !dbg !17
%conv = trunc i32 %shr1 to i8, !dbg !18
tail call void @llvm.dbg.value(metadata i8 %conv, i64 0, metadata !14, metadata !15), !dbg !19
ret i8 %conv, !dbg !20
}
declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #0
attributes #0 = { nounwind readnone }
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4, !5}
!llvm.ident = !{!6}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 4.0.0 (trunk 288677) (llvm/trunk 288679)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
!1 = !DIFile(filename: "t.c", directory: "/")
!2 = !{}
!3 = !{i32 2, !"Dwarf Version", i32 4}
!4 = !{i32 2, !"Debug Info Version", i32 3}
!5 = !{i32 1, !"PIC Level", i32 2}
!6 = !{!"clang version 4.0.0 (trunk 288677) (llvm/trunk 288679)"}
!7 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !12)
!8 = !DISubroutineType(types: !9)
!9 = !{!10, !11}
!10 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
!11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!12 = !{!13, !14}
!13 = !DILocalVariable(name: "i", arg: 1, scope: !7, file: !1, line: 1, type: !11)
!14 = !DILocalVariable(name: "dh", scope: !7, file: !1, line: 2, type: !10)
!15 = !DIExpression()
!16 = !DILocation(line: 1, column: 12, scope: !7)
!17 = !DILocation(line: 2, column: 14, scope: !7)
!18 = !DILocation(line: 2, column: 13, scope: !7)
!19 = !DILocation(line: 2, column: 8, scope: !7)
!20 = !DILocation(line: 3, column: 3, scope: !7)
...
---
name: f
alignment: 4
exposesReturnsTwice: false
legalized: false
regBankSelected: false
selected: false
tracksRegLiveness: true
liveins:
- { reg: '%edi' }
frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
hasPatchPoint: false
stackSize: 8
offsetAdjustment: 0
maxAlignment: 0
adjustsStack: false
hasCalls: false
maxCallFrameSize: 0
hasOpaqueSPAdjustment: false
hasVAStart: false
hasMustTailInVarArgFunc: false
fixedStack:
- { id: 0, type: spill-slot, offset: -16, size: 8, alignment: 16 }
body: |
bb.0.entry:
liveins: %edi, %rbp
frame-setup PUSH64r killed %rbp, implicit-def %rsp, implicit %rsp
CFI_INSTRUCTION def_cfa_offset 16
CFI_INSTRUCTION offset %rbp, -16
%rbp = frame-setup MOV64rr %rsp
CFI_INSTRUCTION def_cfa_register %rbp
DBG_VALUE debug-use %dh, debug-use _, !14, !15, debug-location !16
%edi = SHR32ri killed %edi, 8, implicit-def dead %eflags, debug-location !17
%eax = MOVSX32rr8 %dil, implicit killed %edi, debug-location !20
%rbp = POP64r implicit-def %rsp, implicit %rsp, debug-location !20
RETQ %eax, debug-location !20
...

View File

@ -1,121 +0,0 @@
# RUN: llc -filetype=obj -o - %s | llvm-dwarfdump -a - | FileCheck %s
#
# This testcase has an implicit def pseudo-iunstruction with a debug location.
#
# CHECK: .debug_info contents:
# CHECK: DW_TAG_subprogram
# CHECK: DW_AT_low_pc (0x0000000000000000)
# CHECK-NOT: DW_TAG
# CHECK: DW_AT_specification {{.*}} "_ZN1C5m_fn3Ev"
# CHECK-NOT: DW_TAG
# Here should not be an inlined subroutine with 0 length.
# CHECK: NULL
#
# CHECK: Address Line Column File ISA Discriminator Flags
# CHECK-NEXT: ---
# CHECK-NEXT: 25 0 1 0 0 is_stmt
# CHECK-NEXT: 29 28 1 0 0 is_stmt prologue_end
# CHECK-NEXT: 29 28 1 0 0 is_stmt end_sequence
--- |
source_filename = "t.ll"
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx"
%class.E = type { %class.D }
%class.D = type { %class.B }
%class.B = type { %class.A, %class.A }
%class.A = type { i8 }
%class.C = type <{ %class.E*, %class.B, [2 x i8] }>
@a = local_unnamed_addr global %class.E* null, align 4
define i32 @_ZN1C5m_fn3Ev(%class.C* nocapture) local_unnamed_addr align 2 !dbg !6 {
%2 = alloca %class.B, align 1
%3 = load %class.E*, %class.E** @a, align 4
%4 = icmp eq %class.E* %3, null
br i1 %4, label %10, label %5
; <label>:5: ; preds = %1
%6 = bitcast %class.C* %0 to %class.D**
%7 = load %class.D*, %class.D** %6, align 4
%8 = bitcast %class.D* %7 to i8*
%9 = load i8, i8* %8, align 1
br label %10
; <label>:10: ; preds = %5, %1
%11 = phi i8 [ %9, %5 ], [ undef, %1 ], !dbg !10
%12 = getelementptr inbounds %class.C, %class.C* %0, i32 0, i32 1, i32 0, i32 0
store i8 %11, i8* %12, align 1, !dbg !14
ret i32 undef
}
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4, !5}
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "Apple LLVM version 8.1.0 (clang-802.0.30.3)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !2)
!1 = !DIFile(filename: "test.ii", directory: "/")
!2 = !{}
!3 = !{i32 2, !"Dwarf Version", i32 4}
!4 = !{i32 2, !"Debug Info Version", i32 3}
!5 = !{i32 1, !"PIC Level", i32 2}
!6 = distinct !DISubprogram(name: "m_fn3", linkageName: "_ZN1C5m_fn3Ev", scope: !7, file: !1, line: 25, type: !8, isLocal: false, isDefinition: true, scopeLine: 25, flags: DIFlagPrototyped, isOptimized: true, unit: !0, declaration: !9, variables: !2)
!7 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "C", file: !1, line: 14, size: 64, align: 32, elements: !2, identifier: "_ZTS1C")
!8 = !DISubroutineType(types: !2)
!9 = !DISubprogram(name: "m_fn3", linkageName: "_ZN1C5m_fn3Ev", scope: !7, file: !1, line: 15, type: !8, isLocal: false, isDefinition: false, scopeLine: 15, flags: DIFlagPrototyped, isOptimized: true)
!10 = !DILocation(line: 99, column: 9, scope: !11, inlinedAt: !14)
!11 = distinct !DISubprogram(name: "m_fn1", linkageName: "_ZN1A5m_fn1Ev", scope: !12, file: !1, line: 5, type: !8, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: true, unit: !0, declaration: !13, variables: !2)
!12 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "A", file: !1, line: 1, size: 8, align: 8, elements: !2, identifier: "_ZTS1A")
!13 = !DISubprogram(name: "m_fn1", linkageName: "_ZN1A5m_fn1Ev", scope: !12, file: !1, line: 5, type: !8, isLocal: false, isDefinition: false, scopeLine: 5, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: true)
!14 = !DILocation(line: 29, column: 28, scope: !6)
...
---
name: _ZN1C5m_fn3Ev
alignment: 4
exposesReturnsTwice: false
legalized: false
regBankSelected: false
selected: false
tracksRegLiveness: true
liveins:
- { reg: '%rdi' }
frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
hasPatchPoint: false
stackSize: 0
offsetAdjustment: 0
maxAlignment: 8
adjustsStack: false
hasCalls: false
maxCallFrameSize: 0
hasOpaqueSPAdjustment: false
hasVAStart: false
hasMustTailInVarArgFunc: false
#stack:
# - { id: 0, name: '<unnamed alloca>', offset: -16, size: 2, alignment: 8 }
body: |
bb.0 (%ir-block.1):
successors: %bb.1(0x30000000), %bb.2(0x50000000)
liveins: %rdi
CMP64mi8 %rip, 1, _, @a, _, 0, implicit-def %eflags :: (dereferenceable load 8 from @a, align 4)
JE_1 %bb.1, implicit %eflags
bb.2 (%ir-block.5):
liveins: %rdi
%rax = MOV64rm %rdi, 1, _, 0, _ :: (load 8 from %ir.6, align 4)
%al = MOV8rm killed %rax, 1, _, 0, _ :: (load 1 from %ir.8)
MOV8mr killed %rdi, 1, _, 8, _, killed %al, debug-location !14 :: (store 1 into %ir.12)
RETQ undef %eax
bb.1:
liveins: %rdi
%al = IMPLICIT_DEF debug-location !10
MOV8mr killed %rdi, 1, _, 8, _, killed %al, debug-location !14 :: (store 1 into %ir.12)
RETQ undef %eax
...

View File

@ -1,2 +0,0 @@
if not 'X86' in config.root.targets:
config.unsupported = True

View File

@ -1,299 +0,0 @@
# RUN: llc -run-pass=livedebugvalues -march=x86-64 -o - %s | FileCheck %s
# Test the extension of debug ranges from 3 predecessors.
# Generated from the source file LiveDebugValues-3preds.c:
# #include <stdio.h>
# int add(int x, int y, int z, int a) {
# int i;
# for (i = 0; i < x * y; i++) {
# if (i < x) {
# a = a * x;
# break;
# }
# if (i < y) {
# a = a * y;
# break;
# }
# if (i < z) {
# a = a * z;
# break;
# }
# }
# return a;
# }
# with clang -g -O1 -c -emit-llvm LiveDebugValues-3preds.c -S -o live-debug-values-3preds.ll
# then llc -stop-after stackmap-liveness live-debug-values-3preds.ll -o /dev/null > live-debug-values-3preds.mir
# CHECK: ![[X_VAR:[0-9]+]] = !DILocalVariable(name: "x", {{.*}})
# CHECK: ![[Y_VAR:[0-9]+]] = !DILocalVariable(name: "y", {{.*}})
# CHECK: ![[Z_VAR:[0-9]+]] = !DILocalVariable(name: "z", {{.*}})
# DBG_VALUE for variables "x", "y" and "z" are extended into %bb.9 from its
# predecessors %bb.0, %bb.2 and %bb.8.
# CHECK: bb.9.for.end:
# CHECK-DAG: DBG_VALUE debug-use %edi, debug-use %noreg, ![[X_VAR]], !DIExpression(), debug-location !{{[0-9]+}}
# CHECK-DAG: DBG_VALUE debug-use %esi, debug-use %noreg, ![[Y_VAR]], !DIExpression(), debug-location !{{[0-9]+}}
# CHECK-DAG: DBG_VALUE debug-use %edx, debug-use %noreg, ![[Z_VAR]], !DIExpression(), debug-location !{{[0-9]+}}
# CHECK: RET
--- |
; ModuleID = 'live-debug-values-3preds.ll'
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
; Function Attrs: norecurse nounwind readnone uwtable
define i32 @add(i32 %x, i32 %y, i32 %z, i32 %a) #0 !dbg !4 {
entry:
tail call void @llvm.dbg.value(metadata i32 %x, i64 0, metadata !9, metadata !17), !dbg !18
tail call void @llvm.dbg.value(metadata i32 %y, i64 0, metadata !10, metadata !17), !dbg !19
tail call void @llvm.dbg.value(metadata i32 %z, i64 0, metadata !11, metadata !17), !dbg !21
tail call void @llvm.dbg.value(metadata i32 %a, i64 0, metadata !12, metadata !17), !dbg !23
tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !13, metadata !17), !dbg !25
%mul = mul nsw i32 %y, %x, !dbg !26
%cmp.24 = icmp sgt i32 %mul, 0, !dbg !30
br i1 %cmp.24, label %for.body.preheader, label %for.end, !dbg !31
for.body.preheader: ; preds = %entry
br label %for.body, !dbg !32
for.cond: ; preds = %if.end.6
%cmp = icmp slt i32 %inc, %mul, !dbg !30
br i1 %cmp, label %for.body, label %for.end, !dbg !31
for.body: ; preds = %for.cond, %for.body.preheader
%i.025 = phi i32 [ %inc, %for.cond ], [ 0, %for.body.preheader ]
%0 = icmp sgt i32 %x, 0
br i1 %0, label %if.then, label %if.end, !dbg !35
if.then: ; preds = %for.body
%mul2 = mul nsw i32 %a, %x, !dbg !36
tail call void @llvm.dbg.value(metadata i32 %mul2, i64 0, metadata !12, metadata !17), !dbg !23
br label %for.end, !dbg !38
if.end: ; preds = %for.body
%1 = icmp sgt i32 %y, 0
br i1 %1, label %if.then.4, label %if.end.6, !dbg !39
if.then.4: ; preds = %if.end
%mul5 = mul nsw i32 %a, %y, !dbg !40
tail call void @llvm.dbg.value(metadata i32 %mul5, i64 0, metadata !12, metadata !17), !dbg !23
br label %for.end, !dbg !43
if.end.6: ; preds = %if.end
%2 = icmp sgt i32 %z, 0
%inc = add nuw nsw i32 %i.025, 1, !dbg !44
tail call void @llvm.dbg.value(metadata i32 %inc, i64 0, metadata !13, metadata !17), !dbg !25
br i1 %2, label %if.then.8, label %for.cond, !dbg !45
if.then.8: ; preds = %if.end.6
%mul9 = mul nsw i32 %a, %z, !dbg !46
tail call void @llvm.dbg.value(metadata i32 %mul9, i64 0, metadata !12, metadata !17), !dbg !23
br label %for.end, !dbg !49
for.end: ; preds = %for.cond, %if.then.8, %if.then.4, %if.then, %entry
%a.addr.0 = phi i32 [ %mul2, %if.then ], [ %mul5, %if.then.4 ], [ %mul9, %if.then.8 ], [ %a, %entry ], [ %a, %for.cond ]
ret i32 %a.addr.0, !dbg !50
}
; Function Attrs: nounwind readnone
declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1
attributes #0 = { norecurse nounwind readnone uwtable }
attributes #1 = { nounwind readnone }
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!14, !15}
!llvm.ident = !{!16}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0 (trunk 253049) ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
!1 = !DIFile(filename: "LiveDebugValues-3preds.c", directory: "/home/vt/julia/test/tvvikram")
!2 = !{}
!4 = distinct !DISubprogram(name: "add", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !8)
!5 = !DISubroutineType(types: !6)
!6 = !{!7, !7, !7, !7, !7}
!7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
!8 = !{!9, !10, !11, !12, !13}
!9 = !DILocalVariable(name: "x", arg: 1, scope: !4, file: !1, line: 1, type: !7)
!10 = !DILocalVariable(name: "y", arg: 2, scope: !4, file: !1, line: 1, type: !7)
!11 = !DILocalVariable(name: "z", arg: 3, scope: !4, file: !1, line: 1, type: !7)
!12 = !DILocalVariable(name: "a", arg: 4, scope: !4, file: !1, line: 1, type: !7)
!13 = !DILocalVariable(name: "i", scope: !4, file: !1, line: 2, type: !7)
!14 = !{i32 2, !"Dwarf Version", i32 4}
!15 = !{i32 2, !"Debug Info Version", i32 3}
!16 = !{!"clang version 3.8.0 (trunk 253049) "}
!17 = !DIExpression()
!18 = !DILocation(line: 1, column: 13, scope: !4)
!19 = !DILocation(line: 1, column: 20, scope: !20)
!20 = !DILexicalBlockFile(scope: !4, file: !1, discriminator: 1)
!21 = !DILocation(line: 1, column: 27, scope: !22)
!22 = !DILexicalBlockFile(scope: !4, file: !1, discriminator: 2)
!23 = !DILocation(line: 1, column: 34, scope: !24)
!24 = !DILexicalBlockFile(scope: !4, file: !1, discriminator: 3)
!25 = !DILocation(line: 2, column: 7, scope: !20)
!26 = !DILocation(line: 3, column: 21, scope: !27)
!27 = !DILexicalBlockFile(scope: !28, file: !1, discriminator: 1)
!28 = distinct !DILexicalBlock(scope: !29, file: !1, line: 3, column: 3)
!29 = distinct !DILexicalBlock(scope: !4, file: !1, line: 3, column: 3)
!30 = !DILocation(line: 3, column: 17, scope: !27)
!31 = !DILocation(line: 3, column: 3, scope: !27)
!32 = !DILocation(line: 4, column: 11, scope: !33)
!33 = distinct !DILexicalBlock(scope: !34, file: !1, line: 4, column: 9)
!34 = distinct !DILexicalBlock(scope: !28, file: !1, line: 3, column: 31)
!35 = !DILocation(line: 4, column: 9, scope: !34)
!36 = !DILocation(line: 5, column: 13, scope: !37)
!37 = distinct !DILexicalBlock(scope: !33, file: !1, line: 4, column: 16)
!38 = !DILocation(line: 6, column: 7, scope: !37)
!39 = !DILocation(line: 8, column: 9, scope: !34)
!40 = !DILocation(line: 9, column: 13, scope: !41)
!41 = distinct !DILexicalBlock(scope: !42, file: !1, line: 8, column: 16)
!42 = distinct !DILexicalBlock(scope: !34, file: !1, line: 8, column: 9)
!43 = !DILocation(line: 10, column: 7, scope: !41)
!44 = !DILocation(line: 3, column: 27, scope: !28)
!45 = !DILocation(line: 12, column: 9, scope: !34)
!46 = !DILocation(line: 13, column: 13, scope: !47)
!47 = distinct !DILexicalBlock(scope: !48, file: !1, line: 12, column: 16)
!48 = distinct !DILexicalBlock(scope: !34, file: !1, line: 12, column: 9)
!49 = !DILocation(line: 14, column: 7, scope: !47)
!50 = !DILocation(line: 17, column: 3, scope: !4)
...
---
name: add
alignment: 4
exposesReturnsTwice: false
tracksRegLiveness: true
liveins:
- { reg: '%edi' }
- { reg: '%esi' }
- { reg: '%edx' }
- { reg: '%ecx' }
frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
hasPatchPoint: false
stackSize: 0
offsetAdjustment: 0
maxAlignment: 0
adjustsStack: false
hasCalls: false
maxCallFrameSize: 0
hasOpaqueSPAdjustment: false
hasVAStart: false
hasMustTailInVarArgFunc: false
body: |
bb.0.entry:
successors: %bb.1.for.body.preheader(20), %bb.9.for.end(12)
liveins: %ecx, %edi, %edx, %esi
DBG_VALUE debug-use %edi, debug-use _, !9, !17, debug-location !18
DBG_VALUE debug-use %esi, debug-use _, !10, !17, debug-location !19
DBG_VALUE debug-use %edx, debug-use _, !11, !17, debug-location !21
DBG_VALUE debug-use %ecx, debug-use _, !12, !17, debug-location !23
DBG_VALUE 0, 0, !13, !17, debug-location !25
%r8d = MOV32rr %esi, debug-location !26
%r8d = IMUL32rr killed %r8d, %edi, implicit-def dead %eflags, debug-location !26
TEST32rr %r8d, %r8d, implicit-def %eflags, debug-location !31
JLE_1 %bb.9.for.end, implicit %eflags
bb.1.for.body.preheader:
successors: %bb.3.for.body(0)
liveins: %ecx, %edi, %edx, %esi, %r8d
DBG_VALUE debug-use %edi, debug-use _, !9, !17, debug-location !18
DBG_VALUE debug-use %esi, debug-use _, !10, !17, debug-location !19
DBG_VALUE debug-use %edx, debug-use _, !11, !17, debug-location !21
DBG_VALUE debug-use %ecx, debug-use _, !12, !17, debug-location !23
DBG_VALUE 0, 0, !13, !17, debug-location !25
%eax = XOR32rr undef %eax, undef %eax, implicit-def dead %eflags
bb.3.for.body (align 4):
successors: %bb.4.if.then(4), %bb.5.if.end(124)
liveins: %eax, %ecx, %edi, %edx, %esi, %r8d
DBG_VALUE debug-use %edi, debug-use _, !9, !17, debug-location !18
DBG_VALUE debug-use %esi, debug-use _, !10, !17, debug-location !19
DBG_VALUE debug-use %edx, debug-use _, !11, !17, debug-location !21
DBG_VALUE debug-use %ecx, debug-use _, !12, !17, debug-location !23
DBG_VALUE 0, 0, !13, !17, debug-location !25
TEST32rr %edi, %edi, implicit-def %eflags, debug-location !35
JG_1 %bb.4.if.then, implicit %eflags
bb.5.if.end:
successors: %bb.6.if.then.4(4), %bb.7.if.end.6(124)
liveins: %eax, %ecx, %edi, %edx, %esi, %r8d
DBG_VALUE debug-use %edi, debug-use _, !9, !17, debug-location !18
DBG_VALUE debug-use %esi, debug-use _, !10, !17, debug-location !19
DBG_VALUE debug-use %edx, debug-use _, !11, !17, debug-location !21
DBG_VALUE debug-use %ecx, debug-use _, !12, !17, debug-location !23
DBG_VALUE 0, 0, !13, !17, debug-location !25
TEST32rr %esi, %esi, implicit-def %eflags, debug-location !39
JG_1 %bb.6.if.then.4, implicit %eflags
bb.7.if.end.6:
successors: %bb.8.if.then.8(4), %bb.2.for.cond(124)
liveins: %eax, %ecx, %edi, %edx, %esi, %r8d
DBG_VALUE debug-use %edi, debug-use _, !9, !17, debug-location !18
DBG_VALUE debug-use %esi, debug-use _, !10, !17, debug-location !19
DBG_VALUE debug-use %edx, debug-use _, !11, !17, debug-location !21
DBG_VALUE debug-use %ecx, debug-use _, !12, !17, debug-location !23
DBG_VALUE 0, 0, !13, !17, debug-location !25
TEST32rr %edx, %edx, implicit-def %eflags, debug-location !45
JG_1 %bb.8.if.then.8, implicit %eflags
bb.2.for.cond:
successors: %bb.3.for.body(124), %bb.9.for.end(4)
liveins: %eax, %ecx, %edi, %edx, %esi, %r8d
DBG_VALUE debug-use %edi, debug-use _, !9, !17, debug-location !18
DBG_VALUE debug-use %esi, debug-use _, !10, !17, debug-location !19
DBG_VALUE debug-use %edx, debug-use _, !11, !17, debug-location !21
DBG_VALUE debug-use %ecx, debug-use _, !12, !17, debug-location !23
DBG_VALUE 0, 0, !13, !17, debug-location !25
%eax = INC32r killed %eax, implicit-def dead %eflags, debug-location !44
DBG_VALUE debug-use %eax, debug-use _, !13, !17, debug-location !25
CMP32rr %eax, %r8d, implicit-def %eflags, debug-location !31
JL_1 %bb.3.for.body, implicit %eflags
JMP_1 %bb.9.for.end
bb.4.if.then:
liveins: %ecx, %edi
DBG_VALUE debug-use %edi, debug-use _, !9, !17, debug-location !18
DBG_VALUE debug-use %ecx, debug-use _, !12, !17, debug-location !23
DBG_VALUE 0, 0, !13, !17, debug-location !25
%ecx = IMUL32rr killed %ecx, killed %edi, implicit-def dead %eflags, debug-location !36
DBG_VALUE 0, 0, !13, !17, debug-location !25
%eax = MOV32rr killed %ecx, debug-location !50
RETQ %eax, debug-location !50
bb.6.if.then.4:
liveins: %ecx, %esi
DBG_VALUE debug-use %esi, debug-use _, !10, !17, debug-location !19
DBG_VALUE debug-use %ecx, debug-use _, !12, !17, debug-location !23
DBG_VALUE 0, 0, !13, !17, debug-location !25
%ecx = IMUL32rr killed %ecx, killed %esi, implicit-def dead %eflags, debug-location !40
DBG_VALUE 0, 0, !13, !17, debug-location !25
%eax = MOV32rr killed %ecx, debug-location !50
RETQ %eax, debug-location !50
bb.8.if.then.8:
successors: %bb.9.for.end(0)
liveins: %ecx, %edx
DBG_VALUE debug-use %edx, debug-use _, !11, !17, debug-location !21
DBG_VALUE debug-use %ecx, debug-use _, !12, !17, debug-location !23
DBG_VALUE 0, 0, !13, !17, debug-location !25
%ecx = IMUL32rr killed %ecx, killed %edx, implicit-def dead %eflags, debug-location !46
bb.9.for.end:
liveins: %ecx
DBG_VALUE 0, 0, !13, !17, debug-location !25
%eax = MOV32rr killed %ecx, debug-location !50
RETQ %eax, debug-location !50
...

View File

@ -1,472 +0,0 @@
# RUN: llc -run-pass=livedebugvalues -march=x86-64 -o - %s | FileCheck -check-prefix=GENERATE %s
# RUN: llc -run-pass=livedebugvalues -march=x86-64 -o - %s | FileCheck -check-prefix=TERMINATE %s
#
# Check that spills are recognized in the Live Debug Values pass and that
# DBG_VALUE instructions are generated to keep track of spilled user
# variables.
# In addition we check that the ranges of spilled debug values are properly
# extended.
#
# Test case generated from:
#
# extern void use (int);
# extern void set (int *, int *, int *);
#
# int glob0, glob1, glob2, glob3, glob4, glob5;
#
# void foo(int b0, int b1, int int0, int int1, int int2,
# int int3, int int4)
# {
# int inta = glob0;
# int intb = glob1;
# int intc = glob2;
# int intd = glob3;
# int inte = glob4;
# int intf = glob5;
# int intg;
#
# if (b0)
# return;
#
# int0 += (int1 + int2 + int3) * int4;
# use(intf);
# use(inte);
#
# if (b1) {
# set(&inte, &intf, &intg);
# int0 = (int1 + int2 + int3) * int4;
# inta = (intb*inte + intc*inte + intd) * inte;
# }
# int0 += int4 * inta;
# use(int0);
# }
#
#
# Generated with
# clang -g -O2 -S -emit-llvm -fno-omit-frame-pointer spill1.c
# llc -stop-after=funclet-layout < spill1.ll > spill1.mir
#
# Make sure that we generated DBG_VALUE instructions for the spills
# GENERATE: ![[INT0:[0-9]+]] = !DILocalVariable(name: "int0",{{.*}})
# GENERATE: ![[INTB:[0-9]+]] = !DILocalVariable(name: "intb",{{.*}})
# GENERATE: ![[INTD:[0-9]+]] = !DILocalVariable(name: "intd",{{.*}})
#
# GENERATE: bb.1.if.end:
# GENERATE: MOV32mr %rbp, 1, %noreg, -48, %noreg, killed %edx :: (store 4 into %stack.5)
# GENERATE-NEXT: DBG_VALUE debug-use %rbp, 0, ![[INT0]], !DIExpression(DW_OP_constu, 48, DW_OP_minus)
# GENERATE: MOV32mr %rbp, 1, %noreg, -52, %noreg, killed %r8d :: (store 4 into %stack.4)
# GENERATE-NEXT: DBG_VALUE debug-use %rbp, 0, ![[INTB]], !DIExpression(DW_OP_constu, 52, DW_OP_minus)
# GENERATE: MOV32mr %rbp, 1, %noreg, -56, %noreg, killed %esi :: (store 4 into %stack.3)
# GENERATE-NEXT: DBG_VALUE debug-use %rbp, 0, ![[INTD]], !DIExpression(DW_OP_constu, 56, DW_OP_minus)
#
# Check that the spill locations that are valid at the end of bb.1.if.end are
# propagated to subsequent BBs.
#
# GENERATE: bb.2.if.then4:
# GENERATE-NOT: bb.3:
# GENERATE-DAG: DBG_VALUE debug-use %rbp, 0, ![[INTD]], !DIExpression(DW_OP_constu, 56, DW_OP_minus)
# GENERATE-DAG: DBG_VALUE debug-use %rbp, 0, ![[INTB]], !DIExpression(DW_OP_constu, 52, DW_OP_minus)
#
# GENERATE: bb.3:
# GENERATE-NOT: bb.4.if.end13:
# GENERATE-DAG: DBG_VALUE debug-use %rbp, 0, ![[INTD]], !DIExpression(DW_OP_constu, 56, DW_OP_minus)
# GENERATE-DAG: DBG_VALUE debug-use %rbp, 0, ![[INTB]], !DIExpression(DW_OP_constu, 52, DW_OP_minus)
#
# GENERATE: bb.4.if.end13:
# GENERATE-NOT: bb.5.cleanup:
# GENERATE-DAG: DBG_VALUE debug-use %rbp, 0, ![[INTD]], !DIExpression(DW_OP_constu, 56, DW_OP_minus)
# GENERATE-DAG: DBG_VALUE debug-use %rbp, 0, ![[INTB]], !DIExpression(DW_OP_constu, 52, DW_OP_minus)
#
# Check that the spill location rbp-48 (the variable int0) is not propagated
# because int0 is redefined within the same basic block.
#
# TERMINATE: bb.2.if.then4:
# TERMINATE-NOT: DBG_VALUE debug-use %rbp, -48,
--- |
; ModuleID = '<stdin>'
source_filename = "spill1.c"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
@glob0 = common local_unnamed_addr global i32 0, align 4, !dbg !0
@glob1 = common local_unnamed_addr global i32 0, align 4, !dbg !6
@glob2 = common local_unnamed_addr global i32 0, align 4, !dbg !9
@glob3 = common local_unnamed_addr global i32 0, align 4, !dbg !11
@glob4 = common local_unnamed_addr global i32 0, align 4, !dbg !13
@glob5 = common local_unnamed_addr global i32 0, align 4, !dbg !15
; Function Attrs: nounwind uwtable
define void @foo(i32 %b0, i32 %b1, i32 %int0, i32 %int1, i32 %int2, i32 %int3, i32 %int4) local_unnamed_addr #0 !dbg !20 {
entry:
%inte = alloca i32, align 4
%intf = alloca i32, align 4
%intg = alloca i32, align 4
tail call void @llvm.dbg.value(metadata i32 %b0, i64 0, metadata !24, metadata !38), !dbg !39
tail call void @llvm.dbg.value(metadata i32 %b1, i64 0, metadata !25, metadata !38), !dbg !40
tail call void @llvm.dbg.value(metadata i32 %int0, i64 0, metadata !26, metadata !38), !dbg !41
tail call void @llvm.dbg.value(metadata i32 %int1, i64 0, metadata !27, metadata !38), !dbg !42
tail call void @llvm.dbg.value(metadata i32 %int2, i64 0, metadata !28, metadata !38), !dbg !43
tail call void @llvm.dbg.value(metadata i32 %int3, i64 0, metadata !29, metadata !38), !dbg !44
tail call void @llvm.dbg.value(metadata i32 %int4, i64 0, metadata !30, metadata !38), !dbg !45
%0 = load i32, i32* @glob0, align 4, !dbg !46, !tbaa !47
tail call void @llvm.dbg.value(metadata i32 %0, i64 0, metadata !31, metadata !38), !dbg !51
%1 = load i32, i32* @glob1, align 4, !dbg !52, !tbaa !47
tail call void @llvm.dbg.value(metadata i32 %1, i64 0, metadata !32, metadata !38), !dbg !53
%2 = load i32, i32* @glob2, align 4, !dbg !54, !tbaa !47
tail call void @llvm.dbg.value(metadata i32 %2, i64 0, metadata !33, metadata !38), !dbg !55
%3 = load i32, i32* @glob3, align 4, !dbg !56, !tbaa !47
tail call void @llvm.dbg.value(metadata i32 %3, i64 0, metadata !34, metadata !38), !dbg !57
%4 = bitcast i32* %inte to i8*, !dbg !58
call void @llvm.lifetime.start(i64 4, i8* nonnull %4) #4, !dbg !58
%5 = load i32, i32* @glob4, align 4, !dbg !59, !tbaa !47
tail call void @llvm.dbg.value(metadata i32 %5, i64 0, metadata !35, metadata !38), !dbg !60
tail call void @llvm.dbg.value(metadata i32 %5, i64 0, metadata !35, metadata !38), !dbg !60
store i32 %5, i32* %inte, align 4, !dbg !60, !tbaa !47
%6 = bitcast i32* %intf to i8*, !dbg !61
call void @llvm.lifetime.start(i64 4, i8* nonnull %6) #4, !dbg !61
%7 = load i32, i32* @glob5, align 4, !dbg !62, !tbaa !47
tail call void @llvm.dbg.value(metadata i32 %7, i64 0, metadata !36, metadata !38), !dbg !63
tail call void @llvm.dbg.value(metadata i32 %7, i64 0, metadata !36, metadata !38), !dbg !63
store i32 %7, i32* %intf, align 4, !dbg !63, !tbaa !47
%8 = bitcast i32* %intg to i8*, !dbg !64
call void @llvm.lifetime.start(i64 4, i8* nonnull %8) #4, !dbg !64
%tobool = icmp eq i32 %b0, 0, !dbg !65
br i1 %tobool, label %if.end, label %cleanup, !dbg !67
if.end: ; preds = %entry
%add = add nsw i32 %int2, %int1, !dbg !68
%add1 = add nsw i32 %add, %int3, !dbg !69
%mul = mul nsw i32 %add1, %int4, !dbg !70
call void @llvm.dbg.value(metadata i32 %mul, i64 0, metadata !26, metadata !38), !dbg !41
%add2 = add nsw i32 %mul, %int0, !dbg !71
tail call void @llvm.dbg.value(metadata i32 %add2, i64 0, metadata !26, metadata !38), !dbg !41
tail call void @use(i32 %7) #4, !dbg !72
tail call void @use(i32 %5) #4, !dbg !73
%tobool3 = icmp eq i32 %b1, 0, !dbg !74
br i1 %tobool3, label %if.end13, label %if.then4, !dbg !76
if.then4: ; preds = %if.end
tail call void @llvm.dbg.value(metadata i32* %inte, i64 0, metadata !35, metadata !77), !dbg !60
tail call void @llvm.dbg.value(metadata i32* %intf, i64 0, metadata !36, metadata !77), !dbg !63
tail call void @llvm.dbg.value(metadata i32* %intg, i64 0, metadata !37, metadata !77), !dbg !78
call void @set(i32* nonnull %inte, i32* nonnull %intf, i32* nonnull %intg) #4, !dbg !79
%9 = load i32, i32* %inte, align 4, !dbg !81, !tbaa !47
call void @llvm.dbg.value(metadata i32 %9, i64 0, metadata !35, metadata !38), !dbg !60
%mul833 = add i32 %2, %1, !dbg !82
%add10 = mul i32 %9, %mul833, !dbg !82
%add11 = add nsw i32 %add10, %3, !dbg !83
%mul12 = mul nsw i32 %add11, %9, !dbg !84
call void @llvm.dbg.value(metadata i32 %mul12, i64 0, metadata !31, metadata !38), !dbg !51
br label %if.end13, !dbg !85
if.end13: ; preds = %if.then4, %if.end
%inta.0 = phi i32 [ %mul12, %if.then4 ], [ %0, %if.end ]
%int0.addr.0 = phi i32 [ %mul, %if.then4 ], [ %add2, %if.end ]
call void @llvm.dbg.value(metadata i32 %inta.0, i64 0, metadata !31, metadata !38), !dbg !51
call void @llvm.dbg.value(metadata i32 %int0.addr.0, i64 0, metadata !26, metadata !38), !dbg !41
%mul14 = mul nsw i32 %inta.0, %int4, !dbg !86
%add15 = add nsw i32 %int0.addr.0, %mul14, !dbg !87
call void @llvm.dbg.value(metadata i32 %add15, i64 0, metadata !26, metadata !38), !dbg !41
call void @use(i32 %add15) #4, !dbg !88
br label %cleanup, !dbg !89
cleanup: ; preds = %if.end13, %entry
%10 = bitcast i32* %intg to i8*
%11 = bitcast i32* %intf to i8*
%12 = bitcast i32* %inte to i8*
call void @llvm.lifetime.end(i64 4, i8* nonnull %10) #4, !dbg !89
call void @llvm.lifetime.end(i64 4, i8* nonnull %11) #4, !dbg !89
call void @llvm.lifetime.end(i64 4, i8* nonnull %12) #4, !dbg !89
ret void, !dbg !90
}
; Function Attrs: argmemonly nounwind
declare void @llvm.lifetime.start(i64, i8* nocapture) #1
declare void @use(i32) local_unnamed_addr #2
declare void @set(i32*, i32*, i32*) local_unnamed_addr #2
; Function Attrs: argmemonly nounwind
declare void @llvm.lifetime.end(i64, i8* nocapture) #1
; Function Attrs: nounwind readnone
declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #3
; Function Attrs: nounwind
declare void @llvm.stackprotector(i8*, i8**) #4
attributes #0 = { nounwind uwtable "no-frame-pointer-elim-non-leaf" }
attributes #1 = { argmemonly nounwind }
attributes #2 = { "no-frame-pointer-elim-non-leaf" }
attributes #3 = { nounwind readnone }
attributes #4 = { nounwind }
!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!17, !18}
!llvm.ident = !{!19}
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
!1 = distinct !DIGlobalVariable(name: "glob0", scope: !2, file: !3, line: 4, type: !8, isLocal: false, isDefinition: true)
!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 5.0.0 (trunk 292962)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
!3 = !DIFile(filename: "spill1.c", directory: "/home/test")
!4 = !{}
!5 = !{!0, !6, !9, !11, !13, !15}
!6 = !DIGlobalVariableExpression(var: !7, expr: !DIExpression())
!7 = distinct !DIGlobalVariable(name: "glob1", scope: !2, file: !3, line: 4, type: !8, isLocal: false, isDefinition: true)
!8 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!9 = !DIGlobalVariableExpression(var: !10, expr: !DIExpression())
!10 = distinct !DIGlobalVariable(name: "glob2", scope: !2, file: !3, line: 4, type: !8, isLocal: false, isDefinition: true)
!11 = !DIGlobalVariableExpression(var: !12, expr: !DIExpression())
!12 = distinct !DIGlobalVariable(name: "glob3", scope: !2, file: !3, line: 4, type: !8, isLocal: false, isDefinition: true)
!13 = !DIGlobalVariableExpression(var: !14, expr: !DIExpression())
!14 = distinct !DIGlobalVariable(name: "glob4", scope: !2, file: !3, line: 4, type: !8, isLocal: false, isDefinition: true)
!15 = !DIGlobalVariableExpression(var: !16, expr: !DIExpression())
!16 = distinct !DIGlobalVariable(name: "glob5", scope: !2, file: !3, line: 4, type: !8, isLocal: false, isDefinition: true)
!17 = !{i32 2, !"Dwarf Version", i32 4}
!18 = !{i32 2, !"Debug Info Version", i32 3}
!19 = !{!"clang version 5.0.0 (trunk 292962)"}
!20 = distinct !DISubprogram(name: "foo", scope: !3, file: !3, line: 6, type: !21, isLocal: false, isDefinition: true, scopeLine: 8, flags: DIFlagPrototyped, isOptimized: true, unit: !2, variables: !23)
!21 = !DISubroutineType(types: !22)
!22 = !{null, !8, !8, !8, !8, !8, !8, !8}
!23 = !{!24, !25, !26, !27, !28, !29, !30, !31, !32, !33, !34, !35, !36, !37}
!24 = !DILocalVariable(name: "b0", arg: 1, scope: !20, file: !3, line: 6, type: !8)
!25 = !DILocalVariable(name: "b1", arg: 2, scope: !20, file: !3, line: 6, type: !8)
!26 = !DILocalVariable(name: "int0", arg: 3, scope: !20, file: !3, line: 6, type: !8)
!27 = !DILocalVariable(name: "int1", arg: 4, scope: !20, file: !3, line: 6, type: !8)
!28 = !DILocalVariable(name: "int2", arg: 5, scope: !20, file: !3, line: 6, type: !8)
!29 = !DILocalVariable(name: "int3", arg: 6, scope: !20, file: !3, line: 7, type: !8)
!30 = !DILocalVariable(name: "int4", arg: 7, scope: !20, file: !3, line: 7, type: !8)
!31 = !DILocalVariable(name: "inta", scope: !20, file: !3, line: 9, type: !8)
!32 = !DILocalVariable(name: "intb", scope: !20, file: !3, line: 10, type: !8)
!33 = !DILocalVariable(name: "intc", scope: !20, file: !3, line: 11, type: !8)
!34 = !DILocalVariable(name: "intd", scope: !20, file: !3, line: 12, type: !8)
!35 = !DILocalVariable(name: "inte", scope: !20, file: !3, line: 13, type: !8)
!36 = !DILocalVariable(name: "intf", scope: !20, file: !3, line: 14, type: !8)
!37 = !DILocalVariable(name: "intg", scope: !20, file: !3, line: 15, type: !8)
!38 = !DIExpression()
!39 = !DILocation(line: 6, column: 14, scope: !20)
!40 = !DILocation(line: 6, column: 22, scope: !20)
!41 = !DILocation(line: 6, column: 30, scope: !20)
!42 = !DILocation(line: 6, column: 40, scope: !20)
!43 = !DILocation(line: 6, column: 50, scope: !20)
!44 = !DILocation(line: 7, column: 14, scope: !20)
!45 = !DILocation(line: 7, column: 24, scope: !20)
!46 = !DILocation(line: 9, column: 14, scope: !20)
!47 = !{!48, !48, i64 0}
!48 = !{!"int", !49, i64 0}
!49 = !{!"omnipotent char", !50, i64 0}
!50 = !{!"Simple C/C++ TBAA"}
!51 = !DILocation(line: 9, column: 7, scope: !20)
!52 = !DILocation(line: 10, column: 14, scope: !20)
!53 = !DILocation(line: 10, column: 7, scope: !20)
!54 = !DILocation(line: 11, column: 14, scope: !20)
!55 = !DILocation(line: 11, column: 7, scope: !20)
!56 = !DILocation(line: 12, column: 14, scope: !20)
!57 = !DILocation(line: 12, column: 7, scope: !20)
!58 = !DILocation(line: 13, column: 3, scope: !20)
!59 = !DILocation(line: 13, column: 14, scope: !20)
!60 = !DILocation(line: 13, column: 7, scope: !20)
!61 = !DILocation(line: 14, column: 3, scope: !20)
!62 = !DILocation(line: 14, column: 14, scope: !20)
!63 = !DILocation(line: 14, column: 7, scope: !20)
!64 = !DILocation(line: 15, column: 3, scope: !20)
!65 = !DILocation(line: 17, column: 7, scope: !66)
!66 = distinct !DILexicalBlock(scope: !20, file: !3, line: 17, column: 7)
!67 = !DILocation(line: 17, column: 7, scope: !20)
!68 = !DILocation(line: 20, column: 17, scope: !20)
!69 = !DILocation(line: 20, column: 24, scope: !20)
!70 = !DILocation(line: 20, column: 32, scope: !20)
!71 = !DILocation(line: 20, column: 8, scope: !20)
!72 = !DILocation(line: 21, column: 3, scope: !20)
!73 = !DILocation(line: 22, column: 3, scope: !20)
!74 = !DILocation(line: 24, column: 7, scope: !75)
!75 = distinct !DILexicalBlock(scope: !20, file: !3, line: 24, column: 7)
!76 = !DILocation(line: 24, column: 7, scope: !20)
!77 = !DIExpression(DW_OP_deref)
!78 = !DILocation(line: 15, column: 7, scope: !20)
!79 = !DILocation(line: 25, column: 5, scope: !80)
!80 = distinct !DILexicalBlock(scope: !75, file: !3, line: 24, column: 11)
!81 = !DILocation(line: 27, column: 18, scope: !80)
!82 = !DILocation(line: 27, column: 23, scope: !80)
!83 = !DILocation(line: 27, column: 35, scope: !80)
!84 = !DILocation(line: 27, column: 43, scope: !80)
!85 = !DILocation(line: 28, column: 3, scope: !80)
!86 = !DILocation(line: 29, column: 16, scope: !20)
!87 = !DILocation(line: 29, column: 8, scope: !20)
!88 = !DILocation(line: 30, column: 3, scope: !20)
!89 = !DILocation(line: 31, column: 1, scope: !20)
!90 = !DILocation(line: 31, column: 1, scope: !91)
!91 = !DILexicalBlockFile(scope: !20, file: !3, discriminator: 2)
...
---
name: foo
alignment: 4
exposesReturnsTwice: false
legalized: false
regBankSelected: false
selected: false
tracksRegLiveness: true
liveins:
- { reg: '%edi' }
- { reg: '%esi' }
- { reg: '%edx' }
- { reg: '%ecx' }
- { reg: '%r8d' }
- { reg: '%r9d' }
calleeSavedRegisters: [ '%bh', '%bl', '%bp', '%bpl', '%bx', '%ebp', '%ebx',
'%rbp', '%rbx', '%r12', '%r13', '%r14', '%r15',
'%r12b', '%r13b', '%r14b', '%r15b', '%r12d', '%r13d',
'%r14d', '%r15d', '%r12w', '%r13w', '%r14w', '%r15w' ]
frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
hasPatchPoint: false
stackSize: 72
offsetAdjustment: -24
maxAlignment: 8
adjustsStack: true
hasCalls: true
maxCallFrameSize: 0
hasOpaqueSPAdjustment: false
hasVAStart: false
hasMustTailInVarArgFunc: false
fixedStack:
- { id: 0, type: spill-slot, offset: -56, size: 8, alignment: 8, callee-saved-register: '%rbx' }
- { id: 1, type: spill-slot, offset: -48, size: 8, alignment: 16, callee-saved-register: '%r12' }
- { id: 2, type: spill-slot, offset: -40, size: 8, alignment: 8, callee-saved-register: '%r13' }
- { id: 3, type: spill-slot, offset: -32, size: 8, alignment: 16, callee-saved-register: '%r14' }
- { id: 4, type: spill-slot, offset: -24, size: 8, alignment: 8, callee-saved-register: '%r15' }
- { id: 5, type: spill-slot, offset: -16, size: 8, alignment: 16 }
- { id: 6, offset: 0, size: 4, alignment: 16, isImmutable: true, isAliased: false }
stack:
- { id: 0, name: inte, offset: -60, size: 4, alignment: 4 }
- { id: 1, name: intf, offset: -76, size: 4, alignment: 4 }
- { id: 2, name: intg, offset: -80, size: 4, alignment: 4 }
- { id: 3, type: spill-slot, offset: -72, size: 4, alignment: 4 }
- { id: 4, type: spill-slot, offset: -68, size: 4, alignment: 4 }
- { id: 5, type: spill-slot, offset: -64, size: 4, alignment: 4 }
body: |
bb.0.entry:
successors: %bb.1.if.end(0x30000000), %bb.5.cleanup(0x50000000)
liveins: %ecx, %edi, %edx, %esi, %r8d, %r9d, %r15, %r14, %r13, %r12, %rbx, %rbp
frame-setup PUSH64r killed %rbp, implicit-def %rsp, implicit %rsp
CFI_INSTRUCTION def_cfa_offset 16
CFI_INSTRUCTION offset %rbp, -16
%rbp = frame-setup MOV64rr %rsp
CFI_INSTRUCTION def_cfa_register %rbp
frame-setup PUSH64r killed %r15, implicit-def %rsp, implicit %rsp
frame-setup PUSH64r killed %r14, implicit-def %rsp, implicit %rsp
frame-setup PUSH64r killed %r13, implicit-def %rsp, implicit %rsp
frame-setup PUSH64r killed %r12, implicit-def %rsp, implicit %rsp
frame-setup PUSH64r killed %rbx, implicit-def %rsp, implicit %rsp
%rsp = frame-setup SUB64ri8 %rsp, 24, implicit-def dead %eflags
CFI_INSTRUCTION offset %rbx, -56
CFI_INSTRUCTION offset %r12, -48
CFI_INSTRUCTION offset %r13, -40
CFI_INSTRUCTION offset %r14, -32
CFI_INSTRUCTION offset %r15, -24
DBG_VALUE debug-use %edi, debug-use _, !24, !38, debug-location !39
DBG_VALUE debug-use %esi, debug-use _, !25, !38, debug-location !40
DBG_VALUE debug-use %edx, debug-use _, !26, !38, debug-location !41
DBG_VALUE debug-use %ecx, debug-use _, !27, !38, debug-location !42
DBG_VALUE debug-use %r8d, debug-use _, !28, !38, debug-location !43
DBG_VALUE debug-use %r9d, debug-use _, !29, !38, debug-location !44
%r14d = MOV32rr %r8d
DBG_VALUE debug-use %r14d, debug-use _, !28, !38, debug-location !43
%r12d = MOV32rr %esi
DBG_VALUE debug-use %r12d, debug-use _, !25, !38, debug-location !40
%eax = MOV32rr %edi
DBG_VALUE debug-use %eax, debug-use _, !24, !38, debug-location !39
%r13d = MOV32rm %rip, 1, _, @glob0, _, debug-location !46 :: (dereferenceable load 4 from @glob0, !tbaa !47)
DBG_VALUE debug-use %r13d, debug-use _, !31, !38, debug-location !51
%r8d = MOV32rm %rip, 1, _, @glob1, _, debug-location !52 :: (dereferenceable load 4 from @glob1, !tbaa !47)
DBG_VALUE debug-use %r8d, debug-use _, !32, !38, debug-location !53
%r15d = MOV32rm %rip, 1, _, @glob2, _, debug-location !54 :: (dereferenceable load 4 from @glob2, !tbaa !47)
DBG_VALUE debug-use %r15d, debug-use _, !33, !38, debug-location !55
%esi = MOV32rm %rip, 1, _, @glob3, _, debug-location !56 :: (dereferenceable load 4 from @glob3, !tbaa !47)
DBG_VALUE debug-use %esi, debug-use _, !34, !38, debug-location !57
%ebx = MOV32rm %rip, 1, _, @glob4, _, debug-location !59 :: (dereferenceable load 4 from @glob4, !tbaa !47)
DBG_VALUE debug-use %ebx, debug-use _, !35, !38, debug-location !60
MOV32mr %rbp, 1, _, -44, _, %ebx, debug-location !60 :: (store 4 into %ir.inte, !tbaa !47)
%edi = MOV32rm %rip, 1, _, @glob5, _, debug-location !62 :: (dereferenceable load 4 from @glob5, !tbaa !47)
DBG_VALUE debug-use %edi, debug-use _, !36, !38, debug-location !63
MOV32mr %rbp, 1, _, -60, _, %edi, debug-location !63 :: (store 4 into %ir.intf, !tbaa !47)
TEST32rr killed %eax, %eax, implicit-def %eflags, debug-location !67
JNE_1 %bb.5.cleanup, implicit %eflags
bb.1.if.end:
successors: %bb.2(0x30000000), %bb.3.if.then4(0x50000000)
liveins: %ebx, %ecx, %edi, %edx, %esi, %r8d, %r9d, %r12d, %r13d, %r14d, %r15d, %rbp
MOV32mr %rbp, 1, _, -48, _, killed %edx :: (store 4 into %stack.5)
MOV32mr %rbp, 1, _, -52, _, killed %r8d :: (store 4 into %stack.4)
MOV32mr %rbp, 1, _, -56, _, killed %esi :: (store 4 into %stack.3)
DBG_VALUE debug-use _, debug-use _, !30, !38, debug-location !45
%r14d = ADD32rr killed %r14d, killed %ecx, implicit-def dead %eflags, debug-location !68
%r14d = ADD32rr killed %r14d, killed %r9d, implicit-def dead %eflags, debug-location !69
%r14d = IMUL32rm killed %r14d, %rbp, 1, _, 16, _, implicit-def dead %eflags, debug-location !70 :: (load 4 from %fixed-stack.6, align 16)
DBG_VALUE debug-use %r14d, debug-use _, !26, !38, debug-location !41
CALL64pcrel32 @use, csr_64, implicit %rsp, implicit %edi, implicit-def %rsp, debug-location !72
%edi = MOV32rr killed %ebx, debug-location !73
CALL64pcrel32 @use, csr_64, implicit %rsp, implicit %edi, implicit-def %rsp, debug-location !73
TEST32rr killed %r12d, %r12d, implicit-def %eflags, debug-location !74
JE_1 %bb.2, implicit %eflags
bb.3.if.then4:
successors: %bb.4.if.end13(0x80000000)
liveins: %r14d, %r15d, %rbp
%rdi = LEA64r %rbp, 1, _, -44, _
DBG_VALUE %rbp, -44, !35, !38, debug-location !60
%rsi = LEA64r %rbp, 1, _, -60, _
DBG_VALUE %rbp, -60, !36, !38, debug-location !63
%rdx = LEA64r %rbp, 1, _, -64, _
DBG_VALUE %rbp, -64, !37, !38, debug-location !78
CALL64pcrel32 @set, csr_64, implicit %rsp, implicit %rdi, implicit %rsi, implicit %rdx, implicit-def %rsp, debug-location !79
%eax = MOV32rm %rbp, 1, _, -44, _, debug-location !81 :: (dereferenceable load 4 from %ir.inte, !tbaa !47)
DBG_VALUE debug-use %eax, debug-use _, !35, !38, debug-location !60
%r15d = ADD32rm killed %r15d, %rbp, 1, _, -52, _, implicit-def dead %eflags, debug-location !82 :: (load 4 from %stack.4)
%r15d = IMUL32rr killed %r15d, %eax, implicit-def dead %eflags, debug-location !82
%r15d = ADD32rm killed %r15d, %rbp, 1, _, -56, _, implicit-def dead %eflags, debug-location !83 :: (load 4 from %stack.3)
%r15d = IMUL32rr killed %r15d, killed %eax, implicit-def dead %eflags, debug-location !84
DBG_VALUE debug-use %r15d, debug-use _, !31, !38, debug-location !51
%r13d = MOV32rr killed %r15d
DBG_VALUE debug-use %r13d, debug-use _, !31, !38, debug-location !51
JMP_1 %bb.4.if.end13
bb.2:
successors: %bb.4.if.end13(0x80000000)
liveins: %r13d, %r14d, %rbp
%r14d = ADD32rm killed %r14d, %rbp, 1, _, -48, _, implicit-def dead %eflags, debug-location !71 :: (load 4 from %stack.5)
DBG_VALUE debug-use %r14d, debug-use _, !26, !38, debug-location !41
bb.4.if.end13:
successors: %bb.5.cleanup(0x80000000)
liveins: %r13d, %r14d, %rbp
DBG_VALUE debug-use %r14d, debug-use _, !26, !38, debug-location !41
DBG_VALUE debug-use %r13d, debug-use _, !31, !38, debug-location !51
%r13d = IMUL32rm killed %r13d, %rbp, 1, _, 16, _, implicit-def dead %eflags, debug-location !86 :: (load 4 from %fixed-stack.6, align 16)
%r13d = ADD32rr killed %r13d, killed %r14d, implicit-def dead %eflags, debug-location !87
DBG_VALUE debug-use %r13d, debug-use _, !26, !38, debug-location !41
%edi = MOV32rr killed %r13d, debug-location !88
CALL64pcrel32 @use, csr_64, implicit %rsp, implicit %edi, implicit-def %rsp, debug-location !88
bb.5.cleanup:
liveins: %rbp
%rsp = ADD64ri8 %rsp, 24, implicit-def dead %eflags, debug-location !90
%rbx = POP64r implicit-def %rsp, implicit %rsp, debug-location !90
%r12 = POP64r implicit-def %rsp, implicit %rsp, debug-location !90
%r13 = POP64r implicit-def %rsp, implicit %rsp, debug-location !90
%r14 = POP64r implicit-def %rsp, implicit %rsp, debug-location !90
%r15 = POP64r implicit-def %rsp, implicit %rsp, debug-location !90
%rbp = POP64r implicit-def %rsp, implicit %rsp, debug-location !90
RETQ debug-location !90
...

View File

@ -1,257 +0,0 @@
# RUN: llc -run-pass=livedebugvalues -march=x86-64 -o - %s | FileCheck %s
# Test the extension of debug ranges from predecessors.
# Generated from the source file LiveDebugValues.c:
# #include <stdio.h>
# int m;
# extern int inc(int n);
# extern int change(int n);
# extern int modify(int n);
# int main(int argc, char **argv) {
# int n;
# if (argc != 2)
# n = 2;
# else
# n = atoi(argv[1]);
# n = change(n);
# if (n > 10) {
# m = modify(n);
# m = m + n; // var `m' doesn't has a dbg.value
# }
# else
# m = inc(n); // var `m' doesn't has a dbg.value
# printf("m(main): %d\n", m);
# return 0;
# }
# with clang -g -O3 -c -emit-llvm LiveDebugValues.c -S -o live-debug-values.ll
# then llc -stop-after stackmap-liveness live-debug-values.ll -o /dev/null > live-debug-values.mir
# This case will also produce multiple locations but only the debug range
# extension is tested here. This test case is tested with DWARF information under
# llvm/test/DebugInfo/live-debug-values.ll and present here for testing under
# MIR->MIR serialization.
# DBG_VALUE for variable "n" is extended into %bb.5 from its predecessors %bb.3
# and %bb.4.
# CHECK: ![[N_VAR:[0-9]+]] = !DILocalVariable(name: "n",{{.*}})
#
# CHECK: bb.5.if.end.7:
# CHECK: DBG_VALUE debug-use %ebx, debug-use %noreg, ![[N_VAR]], !DIExpression(), debug-location !{{[0-9]+}}
--- |
; ModuleID = 'live-debug-values.ll'
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
@m = common global i32 0, align 4, !dbg !16
@.str = private unnamed_addr constant [13 x i8] c"m(main): %d\0A\00", align 1
; Function Attrs: nounwind uwtable
define i32 @main(i32 %argc, i8** nocapture readonly %argv) #0 !dbg !4 {
entry:
tail call void @llvm.dbg.value(metadata i32 %argc, i64 0, metadata !12, metadata !20), !dbg !21
tail call void @llvm.dbg.value(metadata i8** %argv, i64 0, metadata !13, metadata !20), !dbg !22
%cmp = icmp eq i32 %argc, 2, !dbg !24
br i1 %cmp, label %if.else, label %if.end, !dbg !26
if.else: ; preds = %entry
%arrayidx = getelementptr inbounds i8*, i8** %argv, i64 1, !dbg !27
%0 = load i8*, i8** %arrayidx, align 8, !dbg !27, !tbaa !28
%call = tail call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %0) #4, !dbg !32
tail call void @llvm.dbg.value(metadata i32 %call, i64 0, metadata !14, metadata !20), !dbg !33
br label %if.end
if.end: ; preds = %if.else, %entry
%n.0 = phi i32 [ %call, %if.else ], [ 2, %entry ]
%call1 = tail call i32 @change(i32 %n.0) #4, !dbg !34
tail call void @llvm.dbg.value(metadata i32 %call1, i64 0, metadata !14, metadata !20), !dbg !33
%cmp2 = icmp sgt i32 %call1, 10, !dbg !35
br i1 %cmp2, label %if.then.3, label %if.else.5, !dbg !37
if.then.3: ; preds = %if.end
%call4 = tail call i32 @modify(i32 %call1) #4, !dbg !38
%add = add nsw i32 %call4, %call1, !dbg !40
br label %if.end.7, !dbg !41
if.else.5: ; preds = %if.end
%call6 = tail call i32 @inc(i32 %call1) #4, !dbg !42
br label %if.end.7
if.end.7: ; preds = %if.else.5, %if.then.3
%storemerge = phi i32 [ %call6, %if.else.5 ], [ %add, %if.then.3 ]
store i32 %storemerge, i32* @m, align 4, !dbg !43, !tbaa !44
%call8 = tail call i32 (i8*, ...) @printf(i8* nonnull getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %storemerge) #4, !dbg !46
ret i32 0, !dbg !47
}
declare i32 @atoi(...) #1
declare i32 @change(i32) #1
declare i32 @modify(i32) #1
declare i32 @inc(i32) #1
; Function Attrs: nounwind
declare i32 @printf(i8* nocapture readonly, ...) #2
; Function Attrs: nounwind readnone
declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #3
attributes #0 = { nounwind uwtable }
attributes #1 = { nounwind }
attributes #2 = { nounwind }
attributes #3 = { nounwind readnone }
attributes #4 = { nounwind }
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!17, !18}
!llvm.ident = !{!19}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0 (trunk 253049) ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !15)
!1 = !DIFile(filename: "LiveDebugValues.c", directory: "/home/vt/julia/test/tvvikram")
!2 = !{}
!4 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 6, type: !5, isLocal: false, isDefinition: true, scopeLine: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !11)
!5 = !DISubroutineType(types: !6)
!6 = !{!7, !7, !8}
!7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
!8 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !9, size: 64, align: 64)
!9 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !10, size: 64, align: 64)
!10 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
!11 = !{!12, !13, !14}
!12 = !DILocalVariable(name: "argc", arg: 1, scope: !4, file: !1, line: 6, type: !7)
!13 = !DILocalVariable(name: "argv", arg: 2, scope: !4, file: !1, line: 6, type: !8)
!14 = !DILocalVariable(name: "n", scope: !4, file: !1, line: 7, type: !7)
!15 = !{!16}
!16 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "m", scope: !0, file: !1, line: 2, type: !7, isLocal: false, isDefinition: true), expr: !DIExpression())
!17 = !{i32 2, !"Dwarf Version", i32 4}
!18 = !{i32 2, !"Debug Info Version", i32 3}
!19 = !{!"clang version 3.8.0 (trunk 253049)"}
!20 = !DIExpression()
!21 = !DILocation(line: 6, column: 14, scope: !4)
!22 = !DILocation(line: 6, column: 27, scope: !23)
!23 = !DILexicalBlockFile(scope: !4, file: !1, discriminator: 1)
!24 = !DILocation(line: 8, column: 12, scope: !25)
!25 = distinct !DILexicalBlock(scope: !4, file: !1, line: 8, column: 7)
!26 = !DILocation(line: 8, column: 7, scope: !4)
!27 = !DILocation(line: 11, column: 14, scope: !25)
!28 = !{!29, !29, i64 0}
!29 = !{!"any pointer", !30, i64 0}
!30 = !{!"omnipotent char", !31, i64 0}
!31 = !{!"Simple C/C++ TBAA"}
!32 = !DILocation(line: 11, column: 9, scope: !25)
!33 = !DILocation(line: 7, column: 7, scope: !23)
!34 = !DILocation(line: 12, column: 7, scope: !4)
!35 = !DILocation(line: 13, column: 9, scope: !36)
!36 = distinct !DILexicalBlock(scope: !4, file: !1, line: 13, column: 7)
!37 = !DILocation(line: 13, column: 7, scope: !4)
!38 = !DILocation(line: 14, column: 9, scope: !39)
!39 = distinct !DILexicalBlock(scope: !36, file: !1, line: 13, column: 15)
!40 = !DILocation(line: 15, column: 11, scope: !39)
!41 = !DILocation(line: 16, column: 3, scope: !39)
!42 = !DILocation(line: 18, column: 9, scope: !36)
!43 = !DILocation(line: 15, column: 7, scope: !39)
!44 = !{!45, !45, i64 0}
!45 = !{!"int", !30, i64 0}
!46 = !DILocation(line: 19, column: 3, scope: !4)
!47 = !DILocation(line: 20, column: 3, scope: !4)
...
---
name: main
alignment: 4
exposesReturnsTwice: false
tracksRegLiveness: true
liveins:
- { reg: '%edi' }
- { reg: '%rsi' }
calleeSavedRegisters: [ '%bh', '%bl', '%bp', '%bpl', '%bx', '%ebp', '%ebx',
'%rbp', '%rbx', '%r12', '%r13', '%r14', '%r15',
'%r12b', '%r13b', '%r14b', '%r15b', '%r12d', '%r13d',
'%r14d', '%r15d', '%r12w', '%r13w', '%r14w', '%r15w' ]
frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
hasPatchPoint: false
stackSize: 8
offsetAdjustment: 0
maxAlignment: 0
adjustsStack: true
hasCalls: true
maxCallFrameSize: 0
hasOpaqueSPAdjustment: false
hasVAStart: false
hasMustTailInVarArgFunc: false
fixedStack:
- { id: 0, type: spill-slot, offset: -16, size: 8, alignment: 16, callee-saved-register: '%rbx' }
body: |
bb.0.entry:
successors: %bb.1.if.else(16), %bb.2.if.end(16)
liveins: %edi, %rsi, %rbx
frame-setup PUSH64r killed %rbx, implicit-def %rsp, implicit %rsp
CFI_INSTRUCTION def_cfa_offset 16
CFI_INSTRUCTION offset %rbx, -16
DBG_VALUE debug-use %edi, debug-use _, !12, !20, debug-location !21
DBG_VALUE debug-use %rsi, debug-use _, !13, !20, debug-location !22
%eax = MOV32rr %edi
DBG_VALUE debug-use %eax, debug-use _, !12, !20, debug-location !21
%edi = MOV32ri 2
CMP32ri8 killed %eax, 2, implicit-def %eflags, debug-location !26
JNE_1 %bb.2.if.end, implicit %eflags
bb.1.if.else:
successors: %bb.2.if.end(0)
liveins: %rsi
DBG_VALUE debug-use %rsi, debug-use _, !13, !20, debug-location !22
%rdi = MOV64rm killed %rsi, 1, _, 8, _, debug-location !27 :: (load 8 from %ir.arrayidx, !tbaa !28)
dead %eax = XOR32rr undef %eax, undef %eax, implicit-def dead %eflags, implicit-def %al, debug-location !32
CALL64pcrel32 @atoi, csr_64, implicit %rsp, implicit %rdi, implicit %al, implicit-def %rsp, implicit-def %eax, debug-location !32
%edi = MOV32rr %eax, debug-location !32
DBG_VALUE debug-use %edi, debug-use _, !14, !20, debug-location !33
bb.2.if.end:
successors: %bb.3.if.then.3(16), %bb.4.if.else.5(16)
liveins: %edi
CALL64pcrel32 @change, csr_64, implicit %rsp, implicit %edi, implicit-def %rsp, implicit-def %eax, debug-location !34
%ebx = MOV32rr %eax, debug-location !34
DBG_VALUE debug-use %ebx, debug-use _, !14, !20, debug-location !33
CMP32ri8 %ebx, 11, implicit-def %eflags, debug-location !37
JL_1 %bb.4.if.else.5, implicit killed %eflags, debug-location !37
bb.3.if.then.3:
successors: %bb.5.if.end.7(0)
liveins: %ebx
DBG_VALUE debug-use %ebx, debug-use _, !14, !20, debug-location !33
%edi = MOV32rr %ebx, debug-location !38
CALL64pcrel32 @modify, csr_64, implicit %rsp, implicit %edi, implicit-def %rsp, implicit-def %eax, debug-location !38
%ecx = MOV32rr %eax, debug-location !38
%ecx = ADD32rr killed %ecx, killed %ebx, implicit-def dead %eflags, debug-location !40
JMP_1 %bb.5.if.end.7
bb.4.if.else.5:
successors: %bb.5.if.end.7(0)
liveins: %ebx
DBG_VALUE debug-use %ebx, debug-use _, !14, !20, debug-location !33
%edi = MOV32rr killed %ebx, debug-location !42
CALL64pcrel32 @inc, csr_64, implicit %rsp, implicit %edi, implicit-def %rsp, implicit-def %eax, debug-location !42
%ecx = MOV32rr %eax, debug-location !42
bb.5.if.end.7:
liveins: %ecx
MOV32mr %rip, 1, _, @m, _, %ecx, debug-location !43 :: (store 4 into @m, !tbaa !44)
dead undef %edi = MOV32ri64 @.str, implicit-def %rdi, debug-location !46
dead %eax = XOR32rr undef %eax, undef %eax, implicit-def dead %eflags, implicit-def %al, debug-location !47
%esi = MOV32rr killed %ecx, debug-location !46
CALL64pcrel32 @printf, csr_64, implicit %rsp, implicit %rdi, implicit %esi, implicit %al, implicit-def %rsp, implicit-def dead %eax, debug-location !46
%eax = XOR32rr undef %eax, undef %eax, implicit-def dead %eflags, debug-location !47
%rbx = POP64r implicit-def %rsp, implicit %rsp, debug-location !47
RETQ %eax, debug-location !47
...

View File

@ -1,163 +0,0 @@
# RUN: llc -O1 -start-before=greedy -stop-after=virtregrewriter -o /dev/null %s -debug-only=livedebugvars 2>&1 | FileCheck -check-prefix=CHECKDBG %s
# REQUIRES: asserts
# This test case was generated by using the following c program:
# extern void foo(int, int);
#
# int bar[2] = {1, 2};
#
# int main(int argc, char** argv)
# {
# int a0 = bar[0];
# int a1 = bar[1];
# foo(a0, a1);
# return 0;
# }
#
# It was compiled with -g and -O1, and the mir was dumped before ra greedy.
--- |
; ModuleID = 'live-debug-vars-unused-arg.ll'
source_filename = "live-debug-vars-unused-arg.c"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
@bar = local_unnamed_addr global [2 x i32] [i32 1, i32 2], align 4, !dbg !0
; Function Attrs: nounwind uwtable
define i32 @main(i32 %argc, i8** nocapture readnone %argv) local_unnamed_addr #0 !dbg !14 {
entry:
tail call void @llvm.dbg.value(metadata i32 %argc, metadata !21, metadata !DIExpression()), !dbg !25
tail call void @llvm.dbg.value(metadata i8** %argv, metadata !22, metadata !DIExpression()), !dbg !26
%0 = load i32, i32* getelementptr inbounds ([2 x i32], [2 x i32]* @bar, i64 0, i64 0), align 4, !dbg !27, !tbaa !28
tail call void @llvm.dbg.value(metadata i32 %0, metadata !23, metadata !DIExpression()), !dbg !32
%1 = load i32, i32* getelementptr inbounds ([2 x i32], [2 x i32]* @bar, i64 0, i64 1), align 4, !dbg !33, !tbaa !28
tail call void @llvm.dbg.value(metadata i32 %1, metadata !24, metadata !DIExpression()), !dbg !34
tail call void @foo(i32 %0, i32 %1) #2, !dbg !35
ret i32 0, !dbg !36
}
declare void @foo(i32, i32) local_unnamed_addr
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #1
; Function Attrs: nounwind
declare void @llvm.stackprotector(i8*, i8**) #2
attributes #0 = { nounwind uwtable }
attributes #1 = { nounwind readnone speculatable }
attributes #2 = { nounwind }
!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!10, !11, !12}
!llvm.ident = !{!13}
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
!1 = distinct !DIGlobalVariable(name: "bar", scope: !2, file: !3, line: 3, type: !6, isLocal: false, isDefinition: true)
!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 6.0.0 (trunk 313866) (llvm/trunk 313875)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
!3 = !DIFile(filename: "live-debug-vars-unused-arg.c", directory: "/repo/uabbpet/master")
!4 = !{}
!5 = !{!0}
!6 = !DICompositeType(tag: DW_TAG_array_type, baseType: !7, size: 64, elements: !8)
!7 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!8 = !{!9}
!9 = !DISubrange(count: 2)
!10 = !{i32 2, !"Dwarf Version", i32 4}
!11 = !{i32 2, !"Debug Info Version", i32 3}
!12 = !{i32 1, !"wchar_size", i32 4}
!13 = !{!"clang version 6.0.0 (trunk 313866) (llvm/trunk 313875)"}
!14 = distinct !DISubprogram(name: "main", scope: !3, file: !3, line: 5, type: !15, isLocal: false, isDefinition: true, scopeLine: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, variables: !20)
!15 = !DISubroutineType(types: !16)
!16 = !{!7, !7, !17}
!17 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !18, size: 64)
!18 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !19, size: 64)
!19 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
!20 = !{!21, !22, !23, !24}
!21 = !DILocalVariable(name: "argc", arg: 1, scope: !14, file: !3, line: 5, type: !7)
!22 = !DILocalVariable(name: "argv", arg: 2, scope: !14, file: !3, line: 5, type: !17)
!23 = !DILocalVariable(name: "a0", scope: !14, file: !3, line: 7, type: !7)
!24 = !DILocalVariable(name: "a1", scope: !14, file: !3, line: 8, type: !7)
!25 = !DILocation(line: 5, column: 14, scope: !14)
!26 = !DILocation(line: 5, column: 27, scope: !14)
!27 = !DILocation(line: 7, column: 12, scope: !14)
!28 = !{!29, !29, i64 0}
!29 = !{!"int", !30, i64 0}
!30 = !{!"omnipotent char", !31, i64 0}
!31 = !{!"Simple C/C++ TBAA"}
!32 = !DILocation(line: 7, column: 7, scope: !14)
!33 = !DILocation(line: 8, column: 12, scope: !14)
!34 = !DILocation(line: 8, column: 7, scope: !14)
!35 = !DILocation(line: 9, column: 3, scope: !14)
!36 = !DILocation(line: 10, column: 3, scope: !14)
...
---
name: main
alignment: 4
exposesReturnsTwice: false
legalized: false
regBankSelected: false
selected: false
tracksRegLiveness: true
registers:
- { id: 0, class: gr32, preferred-register: '' }
- { id: 1, class: gr64, preferred-register: '' }
- { id: 2, class: gr32, preferred-register: '' }
- { id: 3, class: gr32, preferred-register: '' }
- { id: 4, class: gr32, preferred-register: '' }
liveins:
frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
hasPatchPoint: false
stackSize: 0
offsetAdjustment: 0
maxAlignment: 0
adjustsStack: false
hasCalls: true
stackProtector: ''
maxCallFrameSize: 4294967295
hasOpaqueSPAdjustment: false
hasVAStart: false
hasMustTailInVarArgFunc: false
savePoint: ''
restorePoint: ''
fixedStack:
stack:
constants:
body: |
bb.0.entry:
DBG_VALUE debug-use %edi, debug-use _, !21, !DIExpression(), debug-location !25
DBG_VALUE debug-use %rsi, debug-use _, !22, !DIExpression(), debug-location !26
%2 = MOV32rm %rip, 1, _, @bar, _, debug-location !27 :: (dereferenceable load 4 from `i32* getelementptr inbounds ([2 x i32], [2 x i32]* @bar, i64 0, i64 0)`, !tbaa !28)
DBG_VALUE debug-use %2, debug-use _, !23, !DIExpression(), debug-location !32
%3 = MOV32rm %rip, 1, _, @bar + 4, _, debug-location !33 :: (dereferenceable load 4 from `i32* getelementptr inbounds ([2 x i32], [2 x i32]* @bar, i64 0, i64 1)`, !tbaa !28)
DBG_VALUE debug-use %3, debug-use _, !24, !DIExpression(), debug-location !34
ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead %rsp, implicit-def dead %eflags, implicit-def dead %ssp, implicit %rsp, implicit %ssp, debug-location !35
%edi = COPY %2, debug-location !35
%esi = COPY %3, debug-location !35
CALL64pcrel32 @foo, csr_64, implicit %rsp, implicit %ssp, implicit killed %edi, implicit killed %esi, implicit-def %rsp, debug-location !35
ADJCALLSTACKUP64 0, 0, implicit-def dead %rsp, implicit-def dead %eflags, implicit-def dead %ssp, implicit %rsp, implicit %ssp, debug-location !35
%eax = MOV32r0 implicit-def dead %eflags, debug-location !36
RET 0, killed %eax, debug-location !36
...
# Let's verify that the slot index ranges for the unused variables argc/argv,
# connected to physical regs %edi and %rsi, does not overlap with the ranges
# for %2 and %3. The register allocator is actually allocating the
# virtual registers # to %edi and %esi, so the ranges for argc/argv should
# not cover the whole BB.
#
# CHECKDBG-LABEL: ********** EMITTING LIVE DEBUG VARIABLES **********
# CHECKDBG-NEXT: !"argc,5" [0B;0e):0 Loc0=debug-use %edi
# CHECKDBG-NEXT: [0B;0e):0 %bb.0-160B
# CHECKDBG-NEXT: !"argv,5" [0B;0e):0 Loc0=debug-use %rsi
# CHECKDBG-NEXT: [0B;0e):0 %bb.0-160B
# CHECKDBG-NEXT: !"a0,7" [16r;64r):0 Loc0=debug-use %2
# CHECKDBG-NEXT: [16r;64r):0 %bb.0-160B
# CHECKDBG-NEXT: !"a1,8" [32r;80r):0 Loc0=debug-use %3
# CHECKDBG-NEXT: [32r;80r):0 %bb.0-160B

View File

@ -1,158 +0,0 @@
# RUN: llc -O1 -start-before=greedy -stop-after=virtregrewriter -o - %s | FileCheck -check-prefix=CHECKMIR %s
# This test case was generated by using the following c program:
# extern void foo(int, int);
#
# int bar[2] = {1, 2};
#
# int main(int argc, char** argv)
# {
# int a0 = bar[0];
# int a1 = bar[1];
# foo(a0, a1);
# return 0;
# }
#
# It was compiled with -g and -O1, and the mir was dumped before ra greedy.
--- |
; ModuleID = 'live-debug-vars-unused-arg.ll'
source_filename = "live-debug-vars-unused-arg.c"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
@bar = local_unnamed_addr global [2 x i32] [i32 1, i32 2], align 4, !dbg !0
; Function Attrs: nounwind uwtable
define i32 @main(i32 %argc, i8** nocapture readnone %argv) local_unnamed_addr #0 !dbg !14 {
entry:
tail call void @llvm.dbg.value(metadata i32 %argc, metadata !21, metadata !DIExpression()), !dbg !25
tail call void @llvm.dbg.value(metadata i8** %argv, metadata !22, metadata !DIExpression()), !dbg !26
%0 = load i32, i32* getelementptr inbounds ([2 x i32], [2 x i32]* @bar, i64 0, i64 0), align 4, !dbg !27, !tbaa !28
tail call void @llvm.dbg.value(metadata i32 %0, metadata !23, metadata !DIExpression()), !dbg !32
%1 = load i32, i32* getelementptr inbounds ([2 x i32], [2 x i32]* @bar, i64 0, i64 1), align 4, !dbg !33, !tbaa !28
tail call void @llvm.dbg.value(metadata i32 %1, metadata !24, metadata !DIExpression()), !dbg !34
tail call void @foo(i32 %0, i32 %1) #2, !dbg !35
ret i32 0, !dbg !36
}
declare void @foo(i32, i32) local_unnamed_addr
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #1
; Function Attrs: nounwind
declare void @llvm.stackprotector(i8*, i8**) #2
attributes #0 = { nounwind uwtable }
attributes #1 = { nounwind readnone speculatable }
attributes #2 = { nounwind }
!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!10, !11, !12}
!llvm.ident = !{!13}
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
!1 = distinct !DIGlobalVariable(name: "bar", scope: !2, file: !3, line: 3, type: !6, isLocal: false, isDefinition: true)
!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 6.0.0 (trunk 313866) (llvm/trunk 313875)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
!3 = !DIFile(filename: "live-debug-vars-unused-arg.c", directory: "/repo/uabbpet/master")
!4 = !{}
!5 = !{!0}
!6 = !DICompositeType(tag: DW_TAG_array_type, baseType: !7, size: 64, elements: !8)
!7 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!8 = !{!9}
!9 = !DISubrange(count: 2)
!10 = !{i32 2, !"Dwarf Version", i32 4}
!11 = !{i32 2, !"Debug Info Version", i32 3}
!12 = !{i32 1, !"wchar_size", i32 4}
!13 = !{!"clang version 6.0.0 (trunk 313866) (llvm/trunk 313875)"}
!14 = distinct !DISubprogram(name: "main", scope: !3, file: !3, line: 5, type: !15, isLocal: false, isDefinition: true, scopeLine: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, variables: !20)
!15 = !DISubroutineType(types: !16)
!16 = !{!7, !7, !17}
!17 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !18, size: 64)
!18 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !19, size: 64)
!19 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
!20 = !{!21, !22, !23, !24}
!21 = !DILocalVariable(name: "argc", arg: 1, scope: !14, file: !3, line: 5, type: !7)
!22 = !DILocalVariable(name: "argv", arg: 2, scope: !14, file: !3, line: 5, type: !17)
!23 = !DILocalVariable(name: "a0", scope: !14, file: !3, line: 7, type: !7)
!24 = !DILocalVariable(name: "a1", scope: !14, file: !3, line: 8, type: !7)
!25 = !DILocation(line: 5, column: 14, scope: !14)
!26 = !DILocation(line: 5, column: 27, scope: !14)
!27 = !DILocation(line: 7, column: 12, scope: !14)
!28 = !{!29, !29, i64 0}
!29 = !{!"int", !30, i64 0}
!30 = !{!"omnipotent char", !31, i64 0}
!31 = !{!"Simple C/C++ TBAA"}
!32 = !DILocation(line: 7, column: 7, scope: !14)
!33 = !DILocation(line: 8, column: 12, scope: !14)
!34 = !DILocation(line: 8, column: 7, scope: !14)
!35 = !DILocation(line: 9, column: 3, scope: !14)
!36 = !DILocation(line: 10, column: 3, scope: !14)
...
---
name: main
alignment: 4
exposesReturnsTwice: false
legalized: false
regBankSelected: false
selected: false
tracksRegLiveness: true
registers:
- { id: 0, class: gr32, preferred-register: '' }
- { id: 1, class: gr64, preferred-register: '' }
- { id: 2, class: gr32, preferred-register: '' }
- { id: 3, class: gr32, preferred-register: '' }
- { id: 4, class: gr32, preferred-register: '' }
liveins:
frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
hasPatchPoint: false
stackSize: 0
offsetAdjustment: 0
maxAlignment: 0
adjustsStack: false
hasCalls: true
stackProtector: ''
maxCallFrameSize: 4294967295
hasOpaqueSPAdjustment: false
hasVAStart: false
hasMustTailInVarArgFunc: false
savePoint: ''
restorePoint: ''
fixedStack:
stack:
constants:
body: |
bb.0.entry:
DBG_VALUE debug-use %edi, debug-use _, !21, !DIExpression(), debug-location !25
DBG_VALUE debug-use %rsi, debug-use _, !22, !DIExpression(), debug-location !26
%2 = MOV32rm %rip, 1, _, @bar, _, debug-location !27 :: (dereferenceable load 4 from `i32* getelementptr inbounds ([2 x i32], [2 x i32]* @bar, i64 0, i64 0)`, !tbaa !28)
DBG_VALUE debug-use %2, debug-use _, !23, !DIExpression(), debug-location !32
%3 = MOV32rm %rip, 1, _, @bar + 4, _, debug-location !33 :: (dereferenceable load 4 from `i32* getelementptr inbounds ([2 x i32], [2 x i32]* @bar, i64 0, i64 1)`, !tbaa !28)
DBG_VALUE debug-use %3, debug-use _, !24, !DIExpression(), debug-location !34
ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead %rsp, implicit-def dead %eflags, implicit-def dead %ssp, implicit %rsp, implicit %ssp, debug-location !35
%edi = COPY %2, debug-location !35
%esi = COPY %3, debug-location !35
CALL64pcrel32 @foo, csr_64, implicit %rsp, implicit %ssp, implicit killed %edi, implicit killed %esi, implicit-def %rsp, debug-location !35
ADJCALLSTACKUP64 0, 0, implicit-def dead %rsp, implicit-def dead %eflags, implicit-def dead %ssp, implicit %rsp, implicit %ssp, debug-location !35
%eax = MOV32r0 implicit-def dead %eflags, debug-location !36
RET 0, killed %eax, debug-location !36
...
# Verify that we only get one DBG_VALUE for argc and one for argv.
#
# CHECKMIR: ![[ARGC:[0-9]+]] = !DILocalVariable(name: "argc", arg: 1
# CHECKMIR: ![[ARGV:[0-9]+]] = !DILocalVariable(name: "argv", arg: 2
# CHECKMIR: name: main
# CHECKMIR: body:
# CHECKMIR: DBG_VALUE debug-use %edi, debug-use %noreg, ![[ARGC]]
# CHECKMIR-NOT: DBG_VALUE debug-use %{{.*}}, debug-use %noreg, ![[ARGC]]
# CHECKMIR: DBG_VALUE debug-use %rsi, debug-use %noreg, ![[ARGV]]
# CHECKMIR-NOT: DBG_VALUE debug-use %{{.*}}, debug-use %noreg, ![[ARGC]]
# CHECKMIR-NOT: DBG_VALUE debug-use %{{.*}}, debug-use %noreg, ![[ARGV]]

View File

@ -1,239 +0,0 @@
--- |
; RUN: llc -run-pass=livedebugvalues -march=x86-64 -o - %s | FileCheck %s
; Created from:
; void sink(int a);
; void __attribute((always_inline)) f(int a) { sink(a); }
; void foo(int i) {
; f(i);
; if (i)
; f(i);
; f(i);
; }
;
; This test verifies that LiveDebugValues doesn't propagate DBG_VALUEs into
; basic blocks that are beyond the scope of the source variable.
;
; CHECK: ![[F_SP:[0-9]+]] = distinct !DISubprogram(name: "f", {{.*}})
; CHECK: ![[A_VAR:[0-9]+]] = !DILocalVariable(name: "a",{{.*}})
; CHECK: ![[I_VAR:[0-9]+]] = !DILocalVariable(name: "i",{{.*}})
; CHECK: ![[I_LOC:[0-9]+]] = !DILocation(line: 4, column: 14, scope: !{{[0-9]+}})
; CHECK: ![[INLCS1:[0-9]+]] = !DILocation(line: 3, column: 41, scope: ![[F_SP]], inlinedAt: ![[CS1:[0-9]+]])
; CHECK: ![[CS1]] = distinct !DILocation(line: 5, column: 3, scope: !{{[0-9]+}})
; CHECK: ![[INLCS2:[0-9]+]] = !DILocation(line: 3, column: 41, scope: ![[F_SP]], inlinedAt: ![[CS2:[0-9]+]])
; CHECK: ![[CS2]] = distinct !DILocation(line: 7, column: 5, scope: !{{[0-9]+}})
; CHECK: ![[INLCS3:[0-9]+]] = !DILocation(line: 3, column: 41, scope: ![[F_SP]], inlinedAt: ![[CS3:[0-9]+]])
; CHECK: ![[CS3]] = distinct !DILocation(line: 8, column: 3, scope: !{{[0-9]+}})
;
; CHECK: bb.1.if.then:
; CHECK: DBG_VALUE debug-use %ebx, debug-use %noreg, ![[I_VAR]], !DIExpression(), debug-location ![[I_LOC]]
; CHECK-NOT: DBG_VALUE debug-use %ebx, debug-use %noreg, ![[A_VAR]], !DIExpression(), debug-location
; CHECK: DBG_VALUE debug-use %ebx, debug-use %noreg, ![[A_VAR]], !DIExpression(), debug-location ![[INLCS2]]
; CHECK: bb.2.if.end:
; CHECK: DBG_VALUE debug-use %ebx, debug-use %noreg, ![[I_VAR]], !DIExpression(), debug-location ![[I_LOC]]
; CHECK-NOT: DBG_VALUE debug-use %ebx, debug-use %noreg, ![[A_VAR]], !DIExpression(), debug-location
; CHECK: DBG_VALUE debug-use %ebx, debug-use %noreg, ![[A_VAR]], !DIExpression(), debug-location ![[INLCS3]]
;
; ModuleID = 'livedebugvalues-limit.ll'
source_filename = "livedebugvalues-limit.c"
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx"
; Function Attrs: alwaysinline nounwind ssp uwtable
define void @f(i32 %a) local_unnamed_addr #0 !dbg !7 {
entry:
tail call void @llvm.dbg.value(metadata i32 %a, i64 0, metadata !12, metadata !13), !dbg !14
tail call void @sink(i32 %a) #4, !dbg !15
ret void, !dbg !16
}
declare void @sink(i32) local_unnamed_addr
; Function Attrs: nounwind ssp uwtable
define void @foo(i32 %i) local_unnamed_addr #2 !dbg !17 {
entry:
tail call void @llvm.dbg.value(metadata i32 %i, i64 0, metadata !19, metadata !13), !dbg !20
tail call void @llvm.dbg.value(metadata i32 %i, i64 0, metadata !12, metadata !13) #4, !dbg !21
tail call void @sink(i32 %i) #4, !dbg !23
%tobool = icmp eq i32 %i, 0, !dbg !24
br i1 %tobool, label %if.end, label %if.then, !dbg !26
if.then: ; preds = %entry
tail call void @llvm.dbg.value(metadata i32 %i, i64 0, metadata !12, metadata !13) #4, !dbg !27
tail call void @sink(i32 %i) #4, !dbg !29
br label %if.end, !dbg !30
if.end: ; preds = %if.then, %entry
tail call void @llvm.dbg.value(metadata i32 %i, i64 0, metadata !12, metadata !13) #4, !dbg !31
tail call void @sink(i32 %i) #4, !dbg !33
ret void, !dbg !34
}
; Function Attrs: nounwind readnone
declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #3
; Function Attrs: nounwind
declare void @llvm.stackprotector(i8*, i8**) #4
attributes #0 = { alwaysinline nounwind ssp uwtable }
attributes #2 = { nounwind ssp uwtable }
attributes #3 = { nounwind readnone }
attributes #4 = { nounwind }
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4, !5}
!llvm.ident = !{!6}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 4.0.0 (trunk 281923) (llvm/trunk 281916)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
!1 = !DIFile(filename: "livedebugvalues-limit.c", directory: "/Volumes/Fusion/Data/llvm")
!2 = !{}
!3 = !{i32 2, !"Dwarf Version", i32 4}
!4 = !{i32 2, !"Debug Info Version", i32 3}
!5 = !{i32 1, !"PIC Level", i32 2}
!6 = !{!"clang version 4.0.0 (trunk 281923) (llvm/trunk 281916)"}
!7 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 3, type: !8, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !11)
!8 = !DISubroutineType(types: !9)
!9 = !{null, !10}
!10 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
!11 = !{!12}
!12 = !DILocalVariable(name: "a", arg: 1, scope: !7, file: !1, line: 3, type: !10)
!13 = !DIExpression()
!14 = !DILocation(line: 3, column: 41, scope: !7)
!15 = !DILocation(line: 3, column: 46, scope: !7)
!16 = !DILocation(line: 3, column: 55, scope: !7)
!17 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 4, type: !8, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !18)
!18 = !{!19}
!19 = !DILocalVariable(name: "i", arg: 1, scope: !17, file: !1, line: 4, type: !10)
!20 = !DILocation(line: 4, column: 14, scope: !17)
!21 = !DILocation(line: 3, column: 41, scope: !7, inlinedAt: !22)
!22 = distinct !DILocation(line: 5, column: 3, scope: !17)
!23 = !DILocation(line: 3, column: 46, scope: !7, inlinedAt: !22)
!24 = !DILocation(line: 6, column: 7, scope: !25)
!25 = distinct !DILexicalBlock(scope: !17, file: !1, line: 6, column: 7)
!26 = !DILocation(line: 6, column: 7, scope: !17)
!27 = !DILocation(line: 3, column: 41, scope: !7, inlinedAt: !28)
!28 = distinct !DILocation(line: 7, column: 5, scope: !25)
!29 = !DILocation(line: 3, column: 46, scope: !7, inlinedAt: !28)
!30 = !DILocation(line: 7, column: 5, scope: !25)
!31 = !DILocation(line: 3, column: 41, scope: !7, inlinedAt: !32)
!32 = distinct !DILocation(line: 8, column: 3, scope: !17)
!33 = !DILocation(line: 3, column: 46, scope: !7, inlinedAt: !32)
!34 = !DILocation(line: 9, column: 1, scope: !17)
...
---
name: f
alignment: 4
exposesReturnsTwice: false
legalized: false
regBankSelected: false
selected: false
tracksRegLiveness: true
liveins:
- { reg: '%edi' }
calleeSavedRegisters: [ '%bh', '%bl', '%bp', '%bpl', '%bx', '%ebp', '%ebx',
'%rbp', '%rbx', '%r12', '%r13', '%r14', '%r15',
'%r12b', '%r13b', '%r14b', '%r15b', '%r12d', '%r13d',
'%r14d', '%r15d', '%r12w', '%r13w', '%r14w', '%r15w' ]
frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
hasPatchPoint: false
stackSize: 8
offsetAdjustment: 0
maxAlignment: 0
adjustsStack: false
hasCalls: false
maxCallFrameSize: 0
hasOpaqueSPAdjustment: false
hasVAStart: false
hasMustTailInVarArgFunc: false
fixedStack:
- { id: 0, type: spill-slot, offset: -16, size: 8, alignment: 16 }
body: |
bb.0.entry:
liveins: %edi, %rbp
frame-setup PUSH64r killed %rbp, implicit-def %rsp, implicit %rsp
CFI_INSTRUCTION def_cfa_offset 16
CFI_INSTRUCTION offset %rbp, -16
%rbp = frame-setup MOV64rr %rsp
CFI_INSTRUCTION def_cfa_register %rbp
DBG_VALUE debug-use %edi, debug-use _, !12, !13, debug-location !14
%rbp = POP64r implicit-def %rsp, implicit %rsp, debug-location !15
TAILJMPd64 @sink, csr_64, implicit %rsp, implicit %rsp, implicit %edi, debug-location !15
...
---
name: foo
alignment: 4
exposesReturnsTwice: false
legalized: false
regBankSelected: false
selected: false
tracksRegLiveness: true
liveins:
- { reg: '%edi' }
calleeSavedRegisters: [ '%bh', '%bl', '%bp', '%bpl', '%bx', '%ebp', '%ebx',
'%rbp', '%rbx', '%r12', '%r13', '%r14', '%r15',
'%r12b', '%r13b', '%r14b', '%r15b', '%r12d', '%r13d',
'%r14d', '%r15d', '%r12w', '%r13w', '%r14w', '%r15w' ]
frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
hasPatchPoint: false
stackSize: 24
offsetAdjustment: -8
maxAlignment: 0
adjustsStack: true
hasCalls: true
maxCallFrameSize: 0
hasOpaqueSPAdjustment: false
hasVAStart: false
hasMustTailInVarArgFunc: false
fixedStack:
- { id: 0, type: spill-slot, offset: -24, size: 8, alignment: 8, callee-saved-register: '%rbx' }
- { id: 1, type: spill-slot, offset: -16, size: 8, alignment: 16 }
body: |
bb.0.entry:
successors: %bb.2.if.end, %bb.1.if.then
liveins: %edi, %rbx, %rbp
frame-setup PUSH64r killed %rbp, implicit-def %rsp, implicit %rsp
CFI_INSTRUCTION def_cfa_offset 16
CFI_INSTRUCTION offset %rbp, -16
%rbp = frame-setup MOV64rr %rsp
CFI_INSTRUCTION def_cfa_register %rbp
frame-setup PUSH64r killed %rbx, implicit-def %rsp, implicit %rsp
frame-setup PUSH64r undef %rax, implicit-def %rsp, implicit %rsp
CFI_INSTRUCTION offset %rbx, -24
DBG_VALUE debug-use %edi, debug-use _, !19, !13, debug-location !20
%ebx = MOV32rr %edi
DBG_VALUE debug-use %ebx, debug-use _, !12, !13, debug-location !21
DBG_VALUE debug-use %ebx, debug-use _, !19, !13, debug-location !20
CALL64pcrel32 @sink, csr_64, implicit %rsp, implicit %edi, implicit-def %rsp, debug-location !23
TEST32rr %ebx, %ebx, implicit-def %eflags, debug-location !24
JE_1 %bb.2.if.end, implicit %eflags
bb.1.if.then:
successors: %bb.2.if.end
liveins: %ebx, %rbp
DBG_VALUE debug-use %ebx, debug-use _, !19, !13, debug-location !20
DBG_VALUE debug-use %ebx, debug-use _, !12, !13, debug-location !27
%edi = MOV32rr %ebx, debug-location !29
CALL64pcrel32 @sink, csr_64, implicit %rsp, implicit %edi, implicit-def %rsp, debug-location !29
bb.2.if.end:
liveins: %ebx, %rbp
DBG_VALUE debug-use %ebx, debug-use _, !19, !13, debug-location !20
%edi = MOV32rr killed %ebx, debug-location !33
%rsp = ADD64ri8 %rsp, 8, implicit-def dead %eflags, debug-location !33
DBG_VALUE debug-use %ebx, debug-use _, !12, !13, debug-location !31
%rbx = POP64r implicit-def %rsp, implicit %rsp, debug-location !33
%rbp = POP64r implicit-def %rsp, implicit %rsp, debug-location !33
TAILJMPd64 @sink, csr_64, implicit %rsp, implicit %rsp, implicit %edi, debug-location !33
...

View File

@ -1,141 +0,0 @@
--- |
; RUN: llc -run-pass=machinelicm -o - %s | FileCheck %s
; Line numbers should not be retained when loop invariant instructions are hoisted.
; Doing so causes poor stepping bevavior.
;
; Created from:
; int x;
; void Process(const unsigned int *p)
; {
; while (1)
; x = *p++;
; }
;
; with clang -emit-llvm -S -O2 -g -o t.ll t.c
; llc -relocation-model=pic -stop-after=machine-combine -O2 t.ll -o t.mir
;
; We check that when the machine loop invariant pass hoists instructions
; out of a loop the debug information is not retained.
;
; CHECK-LABEL: bb.0.entry:
; CHECK: MOV64rm %rip, 1, %noreg, target-flags(x86-gotpcrel) @x, %noreg :: (load 8 from got)
; CHECK-LABEL: bb.1.while.body:
;
; ModuleID = 'tx.ll'
source_filename = "t.c"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
@x = common local_unnamed_addr global i32 0, align 4, !dbg !0
; Function Attrs: noreturn nounwind uwtable
define void @Process(i32* nocapture readonly %p) local_unnamed_addr #0 !dbg !9 {
entry:
tail call void @llvm.dbg.value(metadata i32* %p, i64 0, metadata !16, metadata !17), !dbg !18
br label %while.body, !dbg !19
while.body: ; preds = %while.body, %entry
%p.addr.0 = phi i32* [ %p, %entry ], [ %incdec.ptr, %while.body ]
tail call void @llvm.dbg.value(metadata i32* %p.addr.0, i64 0, metadata !16, metadata !17), !dbg !18
%incdec.ptr = getelementptr inbounds i32, i32* %p.addr.0, i64 1, !dbg !20
tail call void @llvm.dbg.value(metadata i32* %incdec.ptr, i64 0, metadata !16, metadata !17), !dbg !18
%0 = load i32, i32* %p.addr.0, align 4, !dbg !21, !tbaa !22
store i32 %0, i32* @x, align 4, !dbg !26, !tbaa !22
br label %while.body, !dbg !27, !llvm.loop !29
}
; Function Attrs: nounwind readnone
declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1
attributes #0 = { noreturn nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { nounwind readnone }
attributes #2 = { nounwind }
!llvm.dbg.cu = !{!1}
!llvm.module.flags = !{!6, !7}
!llvm.ident = !{!8}
!0 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "x", scope: !1, file: !2, line: 1, type: !5, isLocal: false, isDefinition: true), expr: !DIExpression())
!1 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, producer: "clang version 4.0.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !3, globals: !4)
!2 = !DIFile(filename: "t.c", directory: "/home/test")
!3 = !{}
!4 = !{!0}
!5 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!6 = !{i32 2, !"Dwarf Version", i32 4}
!7 = !{i32 2, !"Debug Info Version", i32 3}
!8 = !{!"clang version 4.0.0 "}
!9 = distinct !DISubprogram(name: "Process", scope: !2, file: !2, line: 2, type: !10, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, unit: !1, variables: !15)
!10 = !DISubroutineType(types: !11)
!11 = !{null, !12}
!12 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !13, size: 64)
!13 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !14)
!14 = !DIBasicType(name: "unsigned int", size: 32, encoding: DW_ATE_unsigned)
!15 = !{!16}
!16 = !DILocalVariable(name: "p", arg: 1, scope: !9, file: !2, line: 2, type: !12)
!17 = !DIExpression()
!18 = !DILocation(line: 2, column: 34, scope: !9)
!19 = !DILocation(line: 4, column: 3, scope: !9)
!20 = !DILocation(line: 5, column: 11, scope: !9)
!21 = !DILocation(line: 5, column: 9, scope: !9)
!22 = !{!23, !23, i64 0}
!23 = !{!"int", !24, i64 0}
!24 = !{!"omnipotent char", !25, i64 0}
!25 = !{!"Simple C/C++ TBAA"}
!26 = !DILocation(line: 5, column: 7, scope: !9)
!27 = !DILocation(line: 4, column: 3, scope: !28)
!28 = !DILexicalBlockFile(scope: !9, file: !2, discriminator: 1)
!29 = distinct !{!29, !19, !20}
...
---
name: Process
alignment: 4
exposesReturnsTwice: false
legalized: false
regBankSelected: false
selected: false
tracksRegLiveness: true
registers:
- { id: 0, class: gr64 }
- { id: 1, class: gr64 }
- { id: 2, class: gr64 }
- { id: 3, class: gr32 }
- { id: 4, class: gr64 }
liveins:
- { reg: '%rdi', virtual-reg: '%2' }
frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
hasPatchPoint: false
stackSize: 0
offsetAdjustment: 0
maxAlignment: 0
adjustsStack: false
hasCalls: false
maxCallFrameSize: 0
hasOpaqueSPAdjustment: false
hasVAStart: false
hasMustTailInVarArgFunc: false
body: |
bb.0.entry:
successors: %bb.1.while.body(0x80000000)
liveins: %rdi
DBG_VALUE debug-use %rdi, debug-use _, !16, !17, debug-location !18
%2 = COPY %rdi
DBG_VALUE debug-use %2, debug-use _, !16, !17, debug-location !18
bb.1.while.body:
successors: %bb.1.while.body(0x80000000)
%0 = PHI %2, %bb.0.entry, %1, %bb.1.while.body
DBG_VALUE debug-use %0, debug-use _, !16, !17, debug-location !18
%1 = ADD64ri8 %0, 4, implicit-def dead %eflags, debug-location !20
DBG_VALUE debug-use %1, debug-use _, !16, !17, debug-location !18
%3 = MOV32rm %0, 1, _, 0, _, debug-location !21 :: (load 4 from %ir.p.addr.0, !tbaa !22)
%4 = MOV64rm %rip, 1, _, target-flags(x86-gotpcrel) @x, _, debug-location !26 :: (load 8 from got)
MOV32mr killed %4, 1, _, 0, _, killed %3, debug-location !26 :: (store 4 into @x, !tbaa !22)
JMP_1 %bb.1.while.body, debug-location !27
...

View File

@ -1,77 +0,0 @@
# Verify that a CFI instruction with no debug location
# does not result in a line-0 location in the assembler.
# RUN: %llc_dwarf -start-after=prologepilog -march=x86-64 -use-unknown-locations=Enable %s -o - | FileCheck %s
#
# CHECK-NOT: .loc 1 0
# CHECK: .cfi_def_cfa_offset
# UNSUPPORTED: cygwin,mingw32,win32
--- |
; ModuleID = 'no-cfi-loc.ll'
source_filename = "no-cfi-loc.ll"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
define void @foo() !dbg !6 {
entry:
call void @bar(), !dbg !8
ret void, !dbg !9
}
declare void @bar()
; Function Attrs: nounwind
declare void @llvm.stackprotector(i8*, i8**) #0
attributes #0 = { nounwind }
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4}
!llvm.ident = !{!5}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 4.0.0 (trunk 288778)", isOptimized: false, runtimeVersion: 0, emissionKind: LineTablesOnly, enums: !2)
!1 = !DIFile(filename: "t.c", directory: "/home/probinson/projects/scratch")
!2 = !{}
!3 = !{i32 2, !"Dwarf Version", i32 4}
!4 = !{i32 2, !"Debug Info Version", i32 3}
!5 = !{!"clang version 4.0.0 (trunk 288778)"}
!6 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 2, type: !7, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
!7 = !DISubroutineType(types: !2)
!8 = !DILocation(line: 3, column: 2, scope: !6)
!9 = !DILocation(line: 4, column: 1, scope: !6)
...
---
name: foo
alignment: 4
exposesReturnsTwice: false
legalized: false
regBankSelected: false
selected: false
tracksRegLiveness: true
calleeSavedRegisters: [ '%bh', '%bl', '%bp', '%bpl', '%bx', '%ebp', '%ebx',
'%rbp', '%rbx', '%r12', '%r13', '%r14', '%r15',
'%r12b', '%r13b', '%r14b', '%r15b', '%r12d', '%r13d',
'%r14d', '%r15d', '%r12w', '%r13w', '%r14w', '%r15w' ]
frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
hasPatchPoint: false
stackSize: 8
offsetAdjustment: 0
maxAlignment: 0
adjustsStack: true
hasCalls: true
maxCallFrameSize: 0
hasOpaqueSPAdjustment: false
hasVAStart: false
hasMustTailInVarArgFunc: false
body: |
bb.0.entry:
frame-setup PUSH64r undef %rax, implicit-def %rsp, implicit %rsp, debug-location !8
CFI_INSTRUCTION def_cfa_offset 16
CALL64pcrel32 @bar, csr_64, implicit %rsp, implicit-def %rsp, debug-location !8
%rax = POP64r implicit-def %rsp, implicit %rsp, debug-location !9
RET 0, debug-location !9
...

View File

@ -1,50 +0,0 @@
# RUN: llc -O1 -filetype=asm -mtriple x86_64-unknown-linux-gnu -mcpu=x86-64 -o - %s -start-before=simple-register-coalescing -stop-after=simple-register-coalescing | FileCheck %s
--- |
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define i32 @main() local_unnamed_addr !dbg !14 {
entry:
%shl = shl i32 undef, undef, !dbg !19
tail call void @llvm.dbg.value(metadata i32 %shl, metadata !18, metadata !DIExpression()), !dbg !20
ret i32 %shl, !dbg !21
}
declare void @llvm.dbg.value(metadata, metadata, metadata)
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!12, !13}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 6.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !2)
!1 = !DIFile(filename: "bar.c", directory: "")
!2 = !{}
!7 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!12 = !{i32 2, !"Debug Info Version", i32 3}
!13 = !{i32 1, !"wchar_size", i32 4}
!14 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 12, type: !15, isLocal: false, isDefinition: true, scopeLine: 12, isOptimized: true, unit: !0, variables: !17)
!15 = !DISubroutineType(types: !16)
!16 = !{!7}
!17 = !{!18}
!18 = !DILocalVariable(name: "bazinga", scope: !14, file: !1, line: 13, type: !7)
!19 = !DILocation(line: 14, column: 11, scope: !14)
!20 = !DILocation(line: 13, column: 7, scope: !14)
!21 = !DILocation(line: 16, column: 3, scope: !14)
...
---
name: main
alignment: 4
registers:
- { id: 0, class: gr32, preferred-register: '' }
body: |
bb.0.entry:
%0 = MOV32r0 implicit-def dead %eflags, debug-location !19
DBG_VALUE debug-use %0, debug-use _, !18, !DIExpression(), debug-location !20
%eax = COPY killed %0, debug-location !21
RET 0, killed %eax, debug-location !21
...
# CHECK: %eax = MOV32r0
# CHECK-NEXT: DBG_VALUE debug-use %eax

View File

@ -1,2 +0,0 @@
config.suffixes = ['.mir']