brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.5 KiB · 5d304d1 Raw
76 lines · plain
1; RUN: opt -disable-output "-passes=print<scalar-evolution>" < %s 2>&1 | FileCheck %s2 3; Make sure poison value tracking works in the presence of @llvm.dbg4; intrinsics.  Unfortunately, I was not able to reduce this file5; further while still keeping the debug info well formed.6 7define void @foo(i32 %n, ptr %arr) !dbg !7 {8; CHECK-LABEL: Classifying expressions for: @foo9entry:10  %cmp1 = icmp slt i32 0, %n, !dbg !1211  br i1 %cmp1, label %for.body.lr.ph, label %for.end, !dbg !1512 13for.body.lr.ph:                                   ; preds = %entry14  br label %for.body, !dbg !1515 16for.body:                                         ; preds = %for.inc, %for.body.lr.ph17  %i.02 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.inc ]18  %add = add nsw i32 %i.02, 50, !dbg !1619  tail call void @llvm.dbg.value(metadata i32 %add, i64 0, metadata !18, metadata !19), !dbg !2020  %idxprom = sext i32 %add to i64, !dbg !2121 22; CHECK:  %idxprom = sext i32 %add to i6423; CHECK-NEXT:  -->  {50,+,1}<nuw><nsw><%for.body>24 25  %arrayidx = getelementptr inbounds i32, ptr %arr, i64 %idxprom, !dbg !2126  store i32 100, ptr %arrayidx, align 4, !dbg !2227  br label %for.inc, !dbg !2328 29for.inc:                                          ; preds = %for.body30  %inc = add nsw i32 %i.02, 1, !dbg !2431  %cmp = icmp slt i32 %inc, %n, !dbg !1232  br i1 %cmp, label %for.body, label %for.cond.for.end_crit_edge, !dbg !15, !llvm.loop !2533 34for.cond.for.end_crit_edge:                       ; preds = %for.inc35  br label %for.end, !dbg !1536 37for.end:                                          ; preds = %for.cond.for.end_crit_edge, %entry38  ret void, !dbg !2739}40 41; Function Attrs: nounwind readnone42declare void @llvm.dbg.value(metadata, i64, metadata, metadata)43 44!llvm.dbg.cu = !{!0}45!llvm.module.flags = !{!3, !4, !5}46!llvm.ident = !{!6}47 48!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0  (llvm/trunk 271857)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)49!1 = !DIFile(filename: "x.c", directory: "/Users/sanjoy/Code/clang/build/debug+asserts-x86")50!2 = !{}51!3 = !{i32 2, !"Dwarf Version", i32 2}52!4 = !{i32 2, !"Debug Info Version", i32 3}53!5 = !{i32 1, !"PIC Level", i32 2}54!6 = !{!"clang version 3.9.0  (llvm/trunk 271857)"}55!7 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)56!8 = !DISubroutineType(types: !9)57!9 = !{null, !10, !11}58!10 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)59!11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !10, size: 64, align: 64)60!12 = !DILocation(line: 2, column: 24, scope: !13)61!13 = distinct !DILexicalBlock(scope: !14, file: !1, line: 2, column: 6)62!14 = distinct !DILexicalBlock(scope: !7, file: !1, line: 2, column: 6)63!15 = !DILocation(line: 2, column: 6, scope: !14)64!16 = !DILocation(line: 3, column: 14, scope: !17)65!17 = distinct !DILexicalBlock(scope: !13, file: !1, line: 2, column: 34)66!18 = !DILocalVariable(name: "k", scope: !17, file: !1, line: 3, type: !10)67!19 = !DIExpression()68!20 = !DILocation(line: 3, column: 8, scope: !17)69!21 = !DILocation(line: 4, column: 4, scope: !17)70!22 = !DILocation(line: 4, column: 11, scope: !17)71!23 = !DILocation(line: 5, column: 6, scope: !17)72!24 = !DILocation(line: 2, column: 30, scope: !13)73!25 = distinct !{!25, !26}74!26 = !DILocation(line: 2, column: 6, scope: !7)75!27 = !DILocation(line: 6, column: 1, scope: !7)76