|
| 1 | +; RUN: opt %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S \ |
| 2 | +; RUN: | FileCheck %s |
| 3 | + |
| 4 | +;; Generated using: |
| 5 | +;; opt -passes=debugify --debugify-atoms --debugify-level=locations \ |
| 6 | +;; llvm/test/Transforms/SimplifyCFG/debug-info-thread-phi.ll |
| 7 | +;; 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 | +; CHECK: [[DBG1]] = !DILocation(line: 1{{.*}}, atomGroup: 1 |
| 17 | +; CHECK: [[DBG2]] = !DILocation(line: 1{{.*}}, atomGroup: 2 |
| 18 | + |
| 19 | +define void @bar(i32 %aa) !dbg !5 { |
| 20 | +entry: |
| 21 | + %aa.addr = alloca i32, align 4 |
| 22 | + %bb = alloca i32, align 4 |
| 23 | + store i32 %aa, ptr %aa.addr, align 4 |
| 24 | + store i32 0, ptr %bb, align 4 |
| 25 | + %tobool = icmp ne i32 %aa, 0 |
| 26 | + br i1 %tobool, label %if.then, label %if.end |
| 27 | + |
| 28 | +if.then: ; preds = %entry |
| 29 | + call void @foo() |
| 30 | + br label %if.end |
| 31 | + |
| 32 | +if.end: ; preds = %if.then, %entry |
| 33 | + store i32 1, ptr %bb, align 4, !dbg !8 |
| 34 | + br i1 %tobool, label %if.then.1, label %if.end.1 |
| 35 | + |
| 36 | +if.then.1: ; preds = %if.end |
| 37 | + call void @foo() |
| 38 | + br label %if.end.1 |
| 39 | + |
| 40 | +if.end.1: ; preds = %if.then.1, %if.end |
| 41 | + store i32 2, ptr %bb, align 4 |
| 42 | + br label %for.end |
| 43 | + |
| 44 | +for.end: ; preds = %if.end.1 |
| 45 | + ret void |
| 46 | +} |
| 47 | + |
| 48 | +declare void @foo() |
| 49 | + |
| 50 | +!llvm.dbg.cu = !{!0} |
| 51 | +!llvm.debugify = !{!2, !3} |
| 52 | +!llvm.module.flags = !{!4} |
| 53 | + |
| 54 | +!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug) |
| 55 | +!1 = !DIFile(filename: "llvm/test/Transforms/SimplifyCFG/debug-info-thread-phi.ll", directory: "/") |
| 56 | +!2 = !{i32 15} |
| 57 | +!3 = !{i32 0} |
| 58 | +!4 = !{i32 2, !"Debug Info Version", i32 3} |
| 59 | +!5 = distinct !DISubprogram(name: "bar", linkageName: "bar", scope: null, file: !1, line: 1, type: !6, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0) |
| 60 | +!6 = !DISubroutineType(types: !7) |
| 61 | +!7 = !{} |
| 62 | +!8 = !DILocation(line: 1, column: 1, scope: !5, atomGroup: 1, atomRank: 1) |
0 commit comments