53 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 and have their atom groups remapped.5 6; CHECK: .split:7; CHECK-NEXT: %merge = phi i32 [ poison, %while.body ], [ %dest.sroa.clone, %while.body.clone ], !dbg [[G1R1:!.*]]8 9; CHECK: while.body.clone:10; CHECK-NEXT: %dest.sroa.clone = phi i32 [ %1, %.split ], [ poison, %if.else ], !dbg [[G2R1:!.*]]11 12; CHECK: [[G1R1]] = !DILocation(line: 1, column: 1, scope: !5, atomGroup: 1, atomRank: 1)13; CHECK: [[G2R1]] = !DILocation(line: 1, column: 1, scope: !5, atomGroup: 2, atomRank: 1)14 15define void @test(i1 %c) !dbg !5 {16entry:17 br label %if.else18 19if.else: ; preds = %if.else1, %entry20 br i1 %c, label %while.body, label %preheader21 22preheader: ; preds = %if.else23 br label %if.else124 25if.then: ; preds = %if.else126 unreachable27 28while.body: ; preds = %if.else1, %while.body, %if.else29 %dest.sroa = phi i32 [ %1, %while.body ], [ poison, %if.else1 ], [ poison, %if.else ], !dbg !1230 %0 = inttoptr i32 %dest.sroa to ptr31 %incdec.ptr = getelementptr inbounds i8, ptr %0, i32 -132 %1 = ptrtoint ptr %incdec.ptr to i3233 store i8 0, ptr %incdec.ptr, align 134 br label %while.body35 36if.else1: ; preds = %if.else1, %preheader37 indirectbr ptr poison, [label %if.then, label %while.body, label %if.else, label %if.else1]38}39 40!llvm.dbg.cu = !{!0}41!llvm.debugify = !{!2, !3}42!llvm.module.flags = !{!4}43 44!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug)45!1 = !DIFile(filename: "test.ll", directory: "/")46!2 = !{i32 11}47!3 = !{i32 0}48!4 = !{i32 2, !"Debug Info Version", i32 3}49!5 = distinct !DISubprogram(name: "test", linkageName: "test", scope: null, file: !1, line: 1, type: !6, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, keyInstructions: true)50!6 = !DISubroutineType(types: !7)51!7 = !{}52!12 = !DILocation(line: 1, column: 1, scope: !5, atomGroup: 1, atomRank: 1)53