brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.4 KiB · d3f68f2 Raw
74 lines · plain
1; RUN: opt < %s -loop-reduce -S 2>&1 | FileCheck %s2 3;; This test case checks that whether the new icmp instruction preserves4;; the debug location of the original instruction for %exitcond5 6;; This test case also checks that the debug value of the dead icmp7;; instruction is salvaged.8 9; CHECK-LABEL: bb.nph:10; CHECK:           #dbg_value(i32 %n, ![[META1:[0-9]+]], !DIExpression(DW_OP_lit0, DW_OP_eq, DW_OP_stack_value), ![[META2:[0-9]+]])11; CHECK-LABEL: bb:12; CHECK:         icmp uge i32 %indvar.next, %n, !dbg ![[DBGLOC:[0-9]+]]13 14; CHECK: ![[META1]] = !DILocalVariable(name: "1",15; CHECK: ![[META2]] = !DILocation(line: 1, column: 1,16; CHECK: ![[DBGLOC]] = !DILocation(line: 6, column: 1, scope17 18; ModuleID = 'simplified-dbg.bc'19source_filename = "abc.ll"20target datalayout = "n8:16:32:64"21target triple = "x86_64-unknown-linux-gnu"22 23define void @foobar(i32 %n) !dbg !6 {24bb.nph:25  %cond = icmp eq i32 %n, 0, !dbg !1626  call void @llvm.dbg.value(metadata i1 %cond, metadata !9, metadata !DIExpression()), !dbg !1627  %umax = select i1 %cond, i32 1, i32 %n, !dbg !1728  call void @llvm.dbg.value(metadata i32 %umax, metadata !11, metadata !DIExpression()), !dbg !1729  br label %bb, !dbg !1830 31bb:                                               ; preds = %bb, %bb.nph32  %i.03 = phi i32 [ 0, %bb.nph ], [ %indvar.next, %bb ], !dbg !1933  call void @llvm.dbg.value(metadata i32 %i.03, metadata !13, metadata !DIExpression()), !dbg !1934  %indvar.next = add nuw nsw i32 %i.03, 1, !dbg !2035  call void @llvm.dbg.value(metadata i32 %indvar.next, metadata !14, metadata !DIExpression()), !dbg !2036  %exitcond = icmp eq i32 %indvar.next, %umax, !dbg !2137  call void @llvm.dbg.value(metadata i1 %exitcond, metadata !15, metadata !DIExpression()), !dbg !2138  br i1 %exitcond, label %return, label %bb, !dbg !2239 40return:                                           ; preds = %bb41  ret void, !dbg !2342}43 44declare void @llvm.dbg.value(metadata, metadata, metadata)45 46!llvm.dbg.cu = !{!0}47!llvm.debugify = !{!3, !4}48!llvm.module.flags = !{!5}49 50!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)51!1 = !DIFile(filename: "simplified.ll", directory: "/")52!2 = !{}53!3 = !{i32 8}54!4 = !{i32 5}55!5 = !{i32 2, !"Debug Info Version", i32 3}56!6 = distinct !DISubprogram(name: "foobar", linkageName: "foobar", scope: null, file: !1, line: 1, type: !7, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !8)57!7 = !DISubroutineType(types: !2)58!8 = !{!9, !11, !13, !14, !15}59!9 = !DILocalVariable(name: "1", scope: !6, file: !1, line: 1, type: !10)60!10 = !DIBasicType(name: "ty8", size: 8, encoding: DW_ATE_unsigned)61!11 = !DILocalVariable(name: "2", scope: !6, file: !1, line: 2, type: !12)62!12 = !DIBasicType(name: "ty32", size: 32, encoding: DW_ATE_unsigned)63!13 = !DILocalVariable(name: "3", scope: !6, file: !1, line: 4, type: !12)64!14 = !DILocalVariable(name: "4", scope: !6, file: !1, line: 5, type: !12)65!15 = !DILocalVariable(name: "5", scope: !6, file: !1, line: 6, type: !10)66!16 = !DILocation(line: 1, column: 1, scope: !6)67!17 = !DILocation(line: 2, column: 1, scope: !6)68!18 = !DILocation(line: 3, column: 1, scope: !6)69!19 = !DILocation(line: 4, column: 1, scope: !6)70!20 = !DILocation(line: 5, column: 1, scope: !6)71!21 = !DILocation(line: 6, column: 1, scope: !6)72!22 = !DILocation(line: 7, column: 1, scope: !6)73!23 = !DILocation(line: 8, column: 1, scope: !6)74