52 lines · plain
1; RUN: opt -passes='require<profile-summary>,function(codegenprepare)' -S -mtriple=x86_64 < %s \2; RUN: | FileCheck %s3 4;; Check debug locations are propagated onto new PHIs.5 6; CHECK: .split:7; CHECK-NEXT: %merge = phi i32 [ poison, %while.body ], [ %dest.sroa.clone, %while.body.clone ], !dbg [[DBG:!.*]]8 9; CHECK: while.body.clone:10; CHECK-NEXT: %dest.sroa.clone = phi i32 [ %1, %.split ], [ poison, %if.else ], !dbg [[DBG]]11 12; CHECK: [[DBG]] = !DILocation(line: 1, column: 1, scope: ![[#]])13 14define void @test(i1 %c) !dbg !5 {15entry:16 br label %if.else17 18if.else: ; preds = %if.else1, %entry19 br i1 %c, label %while.body, label %preheader20 21preheader: ; preds = %if.else22 br label %if.else123 24if.then: ; preds = %if.else125 unreachable26 27while.body: ; preds = %if.else1, %while.body, %if.else28 %dest.sroa = phi i32 [ %1, %while.body ], [ poison, %if.else1 ], [ poison, %if.else ], !dbg !829 %0 = inttoptr i32 %dest.sroa to ptr30 %incdec.ptr = getelementptr inbounds i8, ptr %0, i32 -131 %1 = ptrtoint ptr %incdec.ptr to i3232 store i8 0, ptr %incdec.ptr, align 133 br label %while.body34 35if.else1: ; preds = %if.else1, %preheader36 indirectbr ptr poison, [label %if.then, label %while.body, label %if.else, label %if.else1]37}38 39!llvm.dbg.cu = !{!0}40!llvm.debugify = !{!2, !3}41!llvm.module.flags = !{!4}42 43!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug)44!1 = !DIFile(filename: "test.ll", directory: "/")45!2 = !{i32 11}46!3 = !{i32 0}47!4 = !{i32 2, !"Debug Info Version", i32 3}48!5 = distinct !DISubprogram(name: "test", linkageName: "test", scope: null, file: !1, line: 1, type: !6, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0)49!6 = !DISubroutineType(types: !7)50!7 = !{}51!8 = !DILocation(line: 1, column: 1, scope: !5)52