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