brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.7 KiB · c1c4c12 Raw
101 lines · plain
1; RUN: opt -passes=callsite-splitting -S < %s | FileCheck %s --implicit-check-not=dbg_value2 3;; Test that DebugLocs are preserved, and that dbg.values are duplicated.4 5 6; CHECK-LABEL: @test17; CHECK:         #dbg_value(i32 0,8; CHECK-NEXT:    [[R1:%.+]] = call i32 @callee(i32 0, i32 %dd), !dbg [[DBG1:!.*]]9; CHECK:         #dbg_value(i32 0,10; CHECK-NEXT:    [[R2:%.+]] = call i32 @callee(i32 1, i32 %dd), !dbg [[DBG1]]11; CHECK-LABEL: CallSite:12; CHECK-NEXT:    phi i32 [ [[R2]], %land.rhs.split ], [ [[R1]], %entry.split ], !dbg [[DBG1]]13; CHECK-NEXT:    #dbg_value(i32 1,14 15declare void @llvm.dbg.value(metadata, metadata, metadata)16 17define i32 @test1(ptr dereferenceable(4) %cc, i32 %dd, i1 %arg) !dbg !6 {18entry:19  br i1 %arg, label %CallSite, label %land.rhs20 21land.rhs:                                         ; preds = %entry22  br label %CallSite23 24CallSite:                                         ; preds = %land.rhs, %entry25  %pv = phi i32 [ 0, %entry ], [ 1, %land.rhs ]26  call void @llvm.dbg.value(metadata i32 0, metadata !9, metadata !DIExpression()), !dbg !1827  %call = call i32 @callee(i32 %pv, i32 %dd), !dbg !1828  call void @llvm.dbg.value(metadata i32 1, metadata !9, metadata !DIExpression()), !dbg !1829  ret i32 %call30}31 32; CHECK-LABEL: @test233; CHECK:         [[LV1:%.*]] = load i32, ptr %ptr, align 4, !dbg [[DBG_LV:!.*]]34; CHECK-NEXT:    #dbg_value(i32 0,35; CHECK-NEXT:    [[R1:%.+]] = call i32 @callee(i32 0, i32 10), !dbg [[DBG_CALL:!.*]]36; CHECK:         [[LV2:%.*]] = load i32, ptr %ptr, align 4, !dbg [[DBG_LV]]37; CHECK-NEXT:    #dbg_value(i32 0,38; CHECK-NEXT:    [[R2:%.+]] = call i32 @callee(i32 0, i32 %i), !dbg [[DBG_CALL]]39; CHECK-LABEL: CallSite:40; CHECK-NEXT:    phi i32 [ [[LV1]], %Header.split ], [ [[LV2]], %TBB.split ], !dbg [[DBG_LV]]41; CHECK-NEXT:    phi i32 [ [[R1]], %Header.split ], [ [[R2]], %TBB.split ], !dbg [[DBG_CALL]]42; CHECK-NEXT:    #dbg_value(i32 1,43 44define void @test2(ptr %ptr, i32 %i, i1 %arg) !dbg !19 {45Header:46  %tobool = icmp ne i32 %i, 1047  br i1 %tobool, label %TBB, label %CallSite48 49TBB:                                              ; preds = %Header50  br i1 %arg, label %CallSite, label %End51 52CallSite:                                         ; preds = %TBB, %Header53  %lv = load i32, ptr %ptr, align 4, !dbg !2554  call void @llvm.dbg.value(metadata i32 0, metadata !21, metadata !DIExpression()), !dbg !2655  %cv = call i32 @callee(i32 0, i32 %i), !dbg !2656  call void @llvm.dbg.value(metadata i32 1, metadata !21, metadata !DIExpression()), !dbg !2657  %sub = sub nsw i32 %lv, %cv58  br label %End59 60End:                                              ; preds = %CallSite, %TBB61  ret void62}63 64define i32 @callee(i32 %aa, i32 %bb) {65entry:66  %add = add nsw i32 %aa, %bb67  ret i32 %add68}69 70!llvm.dbg.cu = !{!0}71!llvm.debugify = !{!3, !4}72!llvm.module.flags = !{!5}73 74!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)75!1 = !DIFile(filename: "<stdin>", directory: "/")76!2 = !{}77!3 = !{i32 23}78!4 = !{i32 11}79!5 = !{i32 2, !"Debug Info Version", i32 3}80!6 = distinct !DISubprogram(name: "test", linkageName: "test", scope: null, file: !1, line: 3, type: !7, isLocal: false, isDefinition: true, scopeLine: 3, isOptimized: true, unit: !0, retainedNodes: !8)81!7 = !DISubroutineType(types: !2)82!8 = !{!9, !11, !13, !15, !16, !17}83!9 = !DILocalVariable(name: "2", scope: !6, file: !1, line: 3, type: !10)84!10 = !DIBasicType(name: "ty64", size: 64, encoding: DW_ATE_unsigned)85!11 = !DILocalVariable(name: "3", scope: !6, file: !1, line: 5, type: !12)86!12 = !DIBasicType(name: "ty32", size: 32, encoding: DW_ATE_unsigned)87!13 = !DILocalVariable(name: "4", scope: !6, file: !1, line: 6, type: !14)88!14 = !DIBasicType(name: "ty8", size: 8, encoding: DW_ATE_unsigned)89!15 = !DILocalVariable(name: "5", scope: !6, file: !1, line: 9, type: !12)90!16 = !DILocalVariable(name: "6", scope: !6, file: !1, line: 10, type: !12)91!17 = !DILocalVariable(name: "7", scope: !6, file: !1, line: 11, type: !10)92!18 = !DILocation(line: 10, column: 1, scope: !6)93!19 = distinct !DISubprogram(name: "test_add_new_phi", linkageName: "test_add_new_phi", scope: null, file: !1, line: 14, type: !7, isLocal: false, isDefinition: true, scopeLine: 14, isOptimized: true, unit: !0, retainedNodes: !20)94!20 = !{!21, !22, !23, !24}95!21 = !DILocalVariable(name: "8", scope: !19, file: !1, line: 14, type: !14)96!22 = !DILocalVariable(name: "9", scope: !19, file: !1, line: 17, type: !10)97!23 = !DILocalVariable(name: "10", scope: !19, file: !1, line: 18, type: !12)98!24 = !DILocalVariable(name: "11", scope: !19, file: !1, line: 20, type: !12)99!25 = !DILocation(line: 18, column: 1, scope: !19)100!26 = !DILocation(line: 19, column: 1, scope: !19)101