72 lines · plain
1; Test that the debug information is propagated correctly to the new instructions2; RUN: opt < %s -passes=ipsccp -S | FileCheck %s3 4define double @sdiv_ashr_sitofp_dbg_pres(i7 %y) !dbg !5 {5; CHECK-LABEL: define double @sdiv_ashr_sitofp_dbg_pres(6; CHECK: [[SDIV:%.*]] = udiv i8 42, [[ZEXT1:%.*]], !dbg [[DBG9:![0-9]+]]7; CHECK: [[ASHR:%.*]] = lshr i8 42, [[SDIV]], !dbg [[DBG10:![0-9]+]]8; CHECK: [[SITOFP:%.*]] = uitofp nneg i16 [[ZEXT2:%.*]] to double, !dbg [[DBG12:![0-9]+]]9;10 %zext1 = zext i7 %y to i8, !dbg !811 %sdiv = sdiv i8 42, %zext1, !dbg !912 %ashr = ashr i8 42, %sdiv, !dbg !1013 %zext2 = zext i8 %ashr to i16, !dbg !1114 %sitofp = sitofp i16 %zext2 to double, !dbg !1215 ret double %sitofp, !dbg !1316}17 18define i32 @test_duplicate_successors_phi(i1 %c, i32 %x) !dbg !14 {19; CHECK-LABEL: define i32 @test_duplicate_successors_phi(20; CHECK: switch:21; CHECK-NEXT: br label %[[SWITCH_DEFAULT:.*]], !dbg [[DBG16:![0-9]+]]22;23entry:24 br i1 %c, label %switch, label %end, !dbg !1525 26switch: ; preds = %entry27 switch i32 -1, label %switch.default [28 i32 0, label %end29 i32 1, label %end30 ], !dbg !1631 32switch.default: ; preds = %switch33 ret i32 -1, !dbg !1734 35end: ; preds = %switch, %switch, %entry36 %phi = phi i32 [ %x, %entry ], [ 1, %switch ], [ 1, %switch ], !dbg !1837 ret i32 %phi, !dbg !1938}39 40!llvm.dbg.cu = !{!0}41!llvm.debugify = !{!2, !3}42!llvm.module.flags = !{!4}43 44;.45; CHECK: [[DBG9]] = !DILocation(line: 246; CHECK: [[DBG10]] = !DILocation(line: 347; CHECK: [[DBG12]] = !DILocation(line: 548; CHECK: [[DBG16]] = !DILocation(line: 849;.50 51 52!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug)53!1 = !DIFile(filename: "sccp.ll", directory: "/")54!2 = !{i32 11}55!3 = !{i32 0}56!4 = !{i32 2, !"Debug Info Version", i32 3}57!5 = distinct !DISubprogram(name: "sdiv_ashr_sitofp_dbg_pres", linkageName: "sdiv_ashr_sitofp_dbg_pres", scope: null, file: !1, line: 1, type: !6, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0)58!6 = !DISubroutineType(types: !7)59!7 = !{}60!8 = !DILocation(line: 1, column: 1, scope: !5)61!9 = !DILocation(line: 2, column: 1, scope: !5)62!10 = !DILocation(line: 3, column: 1, scope: !5)63!11 = !DILocation(line: 4, column: 1, scope: !5)64!12 = !DILocation(line: 5, column: 1, scope: !5)65!13 = !DILocation(line: 6, column: 1, scope: !5)66!14 = distinct !DISubprogram(name: "test_duplicate_successors_phi", linkageName: "test_duplicate_successors_phi", scope: null, file: !1, line: 7, type: !6, scopeLine: 7, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0)67!15 = !DILocation(line: 7, column: 1, scope: !14)68!16 = !DILocation(line: 8, column: 1, scope: !14)69!17 = !DILocation(line: 9, column: 1, scope: !14)70!18 = !DILocation(line: 10, column: 1, scope: !14)71!19 = !DILocation(line: 11, column: 1, scope: !14)72