brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.4 KiB · 1aecd34 Raw
60 lines · plain
1; RUN: opt -S -passes=loop-reduce -mtriple=x86_64-unknown-unknown < %s | FileCheck %s2 3; Check that LoopStrengthReduce's OptimizeShadowIV() propagates the debug4; locations of the old phi (`%accum`) and binop (`%accum.next`) instruction5; to the new phi and binop instruction, respectively.6 7target datalayout = "n8:16:32:64"8 9define i32 @foobar6() !dbg !5 {10; CHECK-LABEL: define i32 @foobar6(11; CHECK:  loop:12; CHECK:    [[IV_S_:%.*]] = phi double [ -3.220000e+03, %[[ENTRY:.*]] ], [ [[IV_S_NEXT_:%.*]], %loop ], !dbg [[DBG9:![0-9]+]]13; CHECK:    [[IV_S_NEXT_]] = fadd double [[IV_S_]], 0x41624E65A0000000, !dbg [[DBG11:![0-9]+]]14; CHECK:  exit:15;16entry:17  br label %loop, !dbg !818 19loop:                                             ; preds = %loop, %entry20  %accum = phi i32 [ -3220, %entry ], [ %accum.next, %loop ], !dbg !921  %iv = phi i32 [ 12, %entry ], [ %iv.next, %loop ], !dbg !1022  %tmp1 = sitofp i32 %accum to double, !dbg !1123  tail call void @foo(double %tmp1), !dbg !1224  %accum.next = add nsw i32 %accum, 9597741, !dbg !1325  %iv.next = add nuw nsw i32 %iv, 1, !dbg !1426  %exitcond = icmp ugt i32 %iv, 235, !dbg !1527  br i1 %exitcond, label %exit, label %loop, !dbg !1628 29exit:                                             ; preds = %loop30  ret i32 %accum.next, !dbg !1731}32 33declare void @foo(double)34 35!llvm.dbg.cu = !{!0}36!llvm.debugify = !{!2, !3}37!llvm.module.flags = !{!4}38 39; CHECK: [[DBG9]] = !DILocation(line: 2,40; CHECK: [[DBG11]] = !DILocation(line: 6,41 42!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug)43!1 = !DIFile(filename: "main.ll", directory: "/")44!2 = !{i32 10}45!3 = !{i32 0}46!4 = !{i32 2, !"Debug Info Version", i32 3}47!5 = distinct !DISubprogram(name: "foobar6", linkageName: "foobar6", scope: null, file: !1, line: 1, type: !6, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0)48!6 = !DISubroutineType(types: !7)49!7 = !{}50!8 = !DILocation(line: 1, column: 1, scope: !5)51!9 = !DILocation(line: 2, column: 1, scope: !5)52!10 = !DILocation(line: 3, column: 1, scope: !5)53!11 = !DILocation(line: 4, column: 1, scope: !5)54!12 = !DILocation(line: 5, column: 1, scope: !5)55!13 = !DILocation(line: 6, column: 1, scope: !5)56!14 = !DILocation(line: 7, column: 1, scope: !5)57!15 = !DILocation(line: 8, column: 1, scope: !5)58!16 = !DILocation(line: 9, column: 1, scope: !5)59!17 = !DILocation(line: 10, column: 1, scope: !5)60