1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; RUN: opt -print-predicateinfo < %s 2>&1 | FileCheck %s
3; Don't insert predicate info for conditions with a single target.
4@a = global i32 1, align 4
5@d = common global i32 0, align 4
6@c = common global i32 0, align 4
7@b = common global i32 0, align 4
8@e = common global i32 0, align 4
9
10define i32 @main() {
11; CHECK-LABEL: @main(
12; CHECK-NEXT:    [[TMP1:%.*]] = load i32, i32* @d, align 4
13; CHECK-NEXT:    [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 0
14; CHECK-NEXT:    br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP13:%.*]]
15; CHECK:         [[TMP4:%.*]] = load i32, i32* @a, align 4
16; CHECK-NEXT:    [[TMP5:%.*]] = load i32, i32* @c, align 4
17; CHECK-NEXT:    [[TMP6:%.*]] = icmp slt i32 [[TMP5]], 1
18; CHECK-NEXT:    br i1 [[TMP6]], label [[TMP7:%.*]], label [[TMP9:%.*]]
19; CHECK:         [[TMP8:%.*]] = icmp eq i32 [[TMP4]], 0
20; CHECK-NEXT:    br i1 [[TMP8]], label [[TMP9]], label [[TMP9]]
21; CHECK:         [[DOT0:%.*]] = phi i32 [ [[TMP4]], [[TMP7]] ], [ [[TMP4]], [[TMP7]] ], [ [[DOT1:%.*]], [[TMP13]] ], [ [[TMP4]], [[TMP3]] ]
22; CHECK-NEXT:    [[TMP10:%.*]] = load i32, i32* @b, align 4
23; CHECK-NEXT:    [[TMP11:%.*]] = sdiv i32 [[TMP10]], [[DOT0]]
24; CHECK-NEXT:    [[TMP12:%.*]] = icmp eq i32 [[TMP11]], 0
25; CHECK-NEXT:    br i1 [[TMP12]], label [[TMP13]], label [[TMP13]]
26; CHECK:         [[DOT1]] = phi i32 [ [[DOT0]], [[TMP9]] ], [ [[DOT0]], [[TMP9]] ], [ undef, [[TMP0:%.*]] ]
27; CHECK-NEXT:    [[TMP14:%.*]] = load i32, i32* @e, align 4
28; CHECK-NEXT:    [[TMP15:%.*]] = icmp eq i32 [[TMP14]], 0
29; CHECK-NEXT:    br i1 [[TMP15]], label [[TMP16:%.*]], label [[TMP9]]
30; CHECK:         ret i32 0
31;
32  %1 = load i32, i32* @d, align 4
33  %2 = icmp eq i32 %1, 0
34  br i1 %2, label %3, label %13
35
36; <label>:3:                                      ; preds = %0
37  %4 = load i32, i32* @a, align 4
38  %5 = load i32, i32* @c, align 4
39  %6 = icmp slt i32 %5, 1
40  br i1 %6, label %7, label %9
41
42; <label>:7:                                      ; preds = %3
43  %8 = icmp eq i32 %4, 0
44  br i1 %8, label %9, label %9
45
46; <label>:9:                                      ; preds = %13, %7, %7, %3
47  %.0 = phi i32 [ %4, %7 ], [ %4, %7 ], [ %.1, %13 ], [ %4, %3 ]
48  %10 = load i32, i32* @b, align 4
49  %11 = sdiv i32 %10, %.0
50  %12 = icmp eq i32 %11, 0
51  br i1 %12, label %13, label %13
52
53; <label>:13:                                     ; preds = %9, %9, %0
54  %.1 = phi i32 [ %.0, %9 ], [ %.0, %9 ], [ undef, %0 ]
55  %14 = load i32, i32* @e, align 4
56  %15 = icmp eq i32 %14, 0
57  br i1 %15, label %16, label %9
58
59; <label>:16:                                     ; preds = %13
60  ret i32 0
61}
62
63; Function Attrs: argmemonly nounwind
64declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture)
65
66; Function Attrs: argmemonly nounwind
67declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture)
68
69