65 lines · plain
1; RUN: opt %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S \2; RUN: | FileCheck %s3 4;; Generated using:5;; opt -passes=debugify --debugify-atoms --debugify-level=locations \6;; llvm/test/Transforms/SimplifyCFG/debug-info-thread-phi.ll7;; With unused/untested metadata nodes removed.8 9;; Check the duplicated store gets distinct atom info in each branch.10 11; CHECK-LABEL: @bar(12; CHECK: if.then:13; CHECK: store i32 1{{.*}}, !dbg [[DBG1:!.*]]14; CHECK: if.end.1.critedge:15; CHECK: store i32 1{{.*}}, !dbg [[DBG2:!.*]]16;17; CHECK: distinct !DISubprogram(name: "bar", {{.*}}keyInstructions: true)18; CHECK: [[DBG1]] = !DILocation(line: 1{{.*}}, atomGroup: 119; CHECK: [[DBG2]] = !DILocation(line: 1{{.*}}, atomGroup: 220 21define void @bar(i32 %aa) !dbg !5 {22entry:23 %aa.addr = alloca i32, align 424 %bb = alloca i32, align 425 store i32 %aa, ptr %aa.addr, align 426 store i32 0, ptr %bb, align 427 %tobool = icmp ne i32 %aa, 028 br i1 %tobool, label %if.then, label %if.end29 30if.then: ; preds = %entry31 call void @foo()32 br label %if.end33 34if.end: ; preds = %if.then, %entry35 store i32 1, ptr %bb, align 4, !dbg !836 br i1 %tobool, label %if.then.1, label %if.end.137 38if.then.1: ; preds = %if.end39 call void @foo()40 br label %if.end.141 42if.end.1: ; preds = %if.then.1, %if.end43 store i32 2, ptr %bb, align 444 br label %for.end45 46for.end: ; preds = %if.end.147 ret void48}49 50declare void @foo()51 52!llvm.dbg.cu = !{!0}53!llvm.debugify = !{!2, !3}54!llvm.module.flags = !{!4}55 56!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug)57!1 = !DIFile(filename: "llvm/test/Transforms/SimplifyCFG/debug-info-thread-phi.ll", directory: "/")58!2 = !{i32 15}59!3 = !{i32 0}60!4 = !{i32 2, !"Debug Info Version", i32 3}61!5 = distinct !DISubprogram(name: "bar", linkageName: "bar", scope: null, file: !1, line: 1, type: !6, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, keyInstructions: true)62!6 = !DISubroutineType(types: !7)63!7 = !{}64!8 = !DILocation(line: 1, column: 1, scope: !5, atomGroup: 1, atomRank: 1)65