|
| 1 | +; RUN: opt -S -o - %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 | FileCheck %s |
| 2 | + |
| 3 | + |
| 4 | +declare i1 @make_condition() |
| 5 | + |
| 6 | +define i1 @specfn() readnone nounwind speculatable { |
| 7 | + ret i1 true |
| 8 | +} |
| 9 | + |
| 10 | +; CHECK-LABEL: @test1( |
| 11 | +; CHECK: call i1 @specfn(), !dbg |
| 12 | +; CHECK: select i1 |
| 13 | +define void @test1(i1 %cond) !dbg !6 { |
| 14 | +start: |
| 15 | + br i1 %cond, label %then, label %else, !dbg !9 |
| 16 | + |
| 17 | +then: ; preds = %start |
| 18 | + %sres = call i1 @specfn(), !dbg !8 |
| 19 | + br label %else, !dbg !11 |
| 20 | + |
| 21 | +else: ; preds = %then, %start |
| 22 | + %phi = phi i1 [ %cond, %start ], [ %sres, %then ], !dbg !12 |
| 23 | + ret void, !dbg !13 |
| 24 | +} |
| 25 | + |
| 26 | +!llvm.dbg.cu = !{!0} |
| 27 | +!llvm.debugify = !{!3, !4} |
| 28 | +!llvm.module.flags = !{!5} |
| 29 | + |
| 30 | +!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) |
| 31 | +!1 = !DIFile(filename: "test.ll", directory: "/") |
| 32 | +!2 = !{} |
| 33 | +!3 = !{i32 6} |
| 34 | +!4 = !{i32 0} |
| 35 | +!5 = !{i32 2, !"Debug Info Version", i32 3} |
| 36 | +!6 = distinct !DISubprogram(name: "test1", linkageName: "test1", scope: null, file: !1, line: 1, type: !7, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2) |
| 37 | +!7 = !DISubroutineType(types: !2) |
| 38 | +!8 = !DILocation(line: 1, column: 1, scope: !6) |
| 39 | +!9 = !DILocation(line: 2, column: 1, scope: !6) |
| 40 | +!10 = !DILocation(line: 3, column: 2, scope: !6) |
| 41 | +!11 = !DILocation(line: 4, column: 2, scope: !6) |
| 42 | +!12 = !DILocation(line: 5, column: 3, scope: !6) |
| 43 | +!13 = !DILocation(line: 6, column: 3, scope: !6) |
0 commit comments