72 lines · plain
1; FIXME: Fix machine verifier issues and remove -verify-machineinstrs=0. PR39452.2; RUN: llc -stop-before=finalize-isel -pre-RA-sched=linearize -verify-machineinstrs=0 < %s -experimental-debug-variable-locations=false | FileCheck %s3source_filename = "linear-dbg-value.ll"4 5; Function Attrs: nounwind readonly uwtable6define i32 @foo(ptr nocapture readonly %a, i32 %N) local_unnamed_addr #0 !dbg !6 {7entry:8 %cmp6 = icmp sgt i32 %N, 0, !dbg !119 br i1 %cmp6, label %for.body.preheader, label %for.cond.cleanup, !dbg !1510 11for.body.preheader: ; preds = %entry12 %wide.trip.count = zext i32 %N to i6413 br label %for.body, !dbg !1714 15for.cond.cleanup.loopexit: ; preds = %for.body16 br label %for.cond.cleanup, !dbg !1917 18for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry19 %x.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.cond.cleanup.loopexit ]20 ret i32 %x.0.lcssa, !dbg !1921 22for.body: ; preds = %for.body, %for.body.preheader23; CHECK: ![[X:[0-9]+]] = !DILocalVariable(name: "x",24; CHECK-LABEL: bb.3.for.body:25; CHECK: DBG_VALUE {{.*}} ![[X]], !DIExpression()26; CHECK: DBG_VALUE {{.*}} ![[X]], !DIExpression()27 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.body.preheader ]28 %x.07 = phi i32 [ %add, %for.body ], [ 0, %for.body.preheader ]29 %arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv, !dbg !1730 %0 = load i32, ptr %arrayidx, align 4, !dbg !1731 %add = add nsw i32 %0, %x.07, !dbg !1732 call void @llvm.dbg.value(metadata i32 %add, metadata !9, metadata !DIExpression()), !dbg !2033 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1, !dbg !2134 call void @llvm.dbg.value(metadata i32 %add, metadata !9, metadata !DIExpression()), !dbg !2035 %exitcond = icmp eq i64 %indvars.iv.next, %wide.trip.count, !dbg !1136 br i1 %exitcond, label %for.cond.cleanup.loopexit, label %for.body, !dbg !1537}38 39; Function Attrs: nounwind readnone speculatable40declare void @llvm.dbg.value(metadata, metadata, metadata) #141 42attributes #0 = { nounwind readonly uwtable }43attributes #1 = { nounwind readnone speculatable }44 45!llvm.dbg.cu = !{!0}46!llvm.module.flags = !{!3, !4}47!llvm.ident = !{!5}48 49!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 4.0.1 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)50!1 = !DIFile(filename: "foo.c", directory: "/tmp")51!2 = !{}52!3 = !{i32 2, !"Dwarf Version", i32 4}53!4 = !{i32 2, !"Debug Info Version", i32 3}54!5 = !{!"clang version 4.0.1 "}55!6 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 2, type: !7, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !8)56!7 = !DISubroutineType(types: !2)57!8 = !{!9}58!9 = !DILocalVariable(name: "x", scope: !6, file: !1, line: 3, type: !10)59!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)60!11 = !DILocation(line: 4, scope: !12)61!12 = !DILexicalBlockFile(scope: !13, file: !1, discriminator: 1)62!13 = distinct !DILexicalBlock(scope: !14, file: !1, line: 4, column: 3)63!14 = distinct !DILexicalBlock(scope: !6, file: !1, line: 4, column: 3)64!15 = !DILocation(line: 4, scope: !16)65!16 = !DILexicalBlockFile(scope: !14, file: !1, discriminator: 1)66!17 = !DILocation(line: 5, scope: !18)67!18 = distinct !DILexicalBlock(scope: !13, file: !1, line: 4, column: 31)68!19 = !DILocation(line: 7, scope: !6)69!20 = !DILocation(line: 3, scope: !6)70!21 = !DILocation(line: 4, scope: !22)71!22 = !DILexicalBlockFile(scope: !13, file: !1, discriminator: 3)72