1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=print-predicateinfo < %s 2>&1 | FileCheck %s
3 ; Don't insert predicate info for conditions with a single target.
4 @a = global i32 6, align 4
5 @c = global i32 -1, align 4
6 @e = common global i32 0, align 4
7 @.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
8 @d = common global i32 0, align 4
9 @b = common global [6 x i32] zeroinitializer, align 16
11 ; Function Attrs: nounwind ssp uwtable
14 ; CHECK-NEXT: store i32 6, ptr @e, align 4
15 ; CHECK-NEXT: br label [[TMP1:%.*]]
16 ; CHECK: [[TMP2:%.*]] = load i32, ptr @d, align 4
17 ; CHECK-NEXT: [[TMP3:%.*]] = sext i32 [[TMP2]] to i64
18 ; CHECK-NEXT: [[TMP4:%.*]] = getelementptr inbounds [6 x i32], ptr @b, i64 0, i64 [[TMP3]]
19 ; CHECK-NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP4]], align 4
20 ; CHECK-NEXT: [[TMP6:%.*]] = call i32 (ptr, ...) @printf(ptr @.str, i32 [[TMP5]])
21 ; CHECK-NEXT: [[TMP7:%.*]] = load i32, ptr @a, align 4
22 ; CHECK-NEXT: [[TMP8:%.*]] = icmp eq i32 [[TMP7]], 0
23 ; CHECK-NEXT: br i1 [[TMP8]], label %thread-pre-split, label [[TMP9:%.*]]
24 ; CHECK: [[TMP10:%.*]] = load i32, ptr @e, align 4
25 ; CHECK-NEXT: [[TMP11:%.*]] = icmp eq i32 [[TMP10]], 0
26 ; CHECK-NEXT: br i1 [[TMP11]], label [[TMP12:%.*]], label [[TMP12]]
27 ; CHECK: thread-pre-split:
28 ; CHECK-NEXT: [[DOTPR:%.*]] = load i32, ptr @e, align 4
29 ; CHECK-NEXT: br label [[TMP12]]
30 ; CHECK: [[TMP13:%.*]] = phi i32 [ [[DOTPR]], %thread-pre-split ], [ [[TMP10]], [[TMP9]] ], [ [[TMP10]], [[TMP9]] ]
31 ; CHECK-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
32 ; CHECK-NEXT: br i1 [[TMP14]], label [[TMP15:%.*]], label [[TMP15]]
33 ; CHECK: br i1 [[TMP14]], label [[TMP16:%.*]], label [[TMP17:%.*]]
34 ; CHECK: br label [[TMP17]]
35 ; CHECK: [[DOT0:%.*]] = phi i32 [ 1, [[TMP16]] ], [ -1, [[TMP15]] ]
36 ; CHECK-NEXT: [[TMP18:%.*]] = and i32 [[DOT0]], 8693
37 ; CHECK-NEXT: [[TMP19:%.*]] = load i32, ptr @c, align 4
38 ; CHECK-NEXT: [[TMP20:%.*]] = xor i32 [[TMP18]], [[TMP19]]
39 ; CHECK-NEXT: [[TMP21:%.*]] = xor i32 [[TMP20]], -1
40 ; CHECK-NEXT: store i32 [[TMP21]], ptr @d, align 4
41 ; CHECK-NEXT: [[TMP22:%.*]] = icmp slt i32 [[TMP20]], -2
42 ; CHECK-NEXT: br i1 [[TMP22]], label [[TMP1]], label [[TMP23:%.*]]
45 store i32 6, ptr @e, align 4
48 ; <label>:1: ; preds = %17, %0
49 %2 = load i32, ptr @d, align 4
50 %3 = sext i32 %2 to i64
51 %4 = getelementptr inbounds [6 x i32], ptr @b, i64 0, i64 %3
52 %5 = load i32, ptr %4, align 4
53 %6 = call i32 (ptr, ...) @printf(ptr @.str, i32 %5) #2
54 %7 = load i32, ptr @a, align 4
55 %8 = icmp eq i32 %7, 0
56 br i1 %8, label %thread-pre-split, label %9
58 ; <label>:9: ; preds = %1
59 %10 = load i32, ptr @e, align 4
60 %11 = icmp eq i32 %10, 0
61 br i1 %11, label %12, label %12
63 thread-pre-split: ; preds = %1
64 %.pr = load i32, ptr @e, align 4
67 ; <label>:12: ; preds = %thread-pre-split, %9, %9
68 %13 = phi i32 [ %.pr, %thread-pre-split ], [ %10, %9 ], [ %10, %9 ]
69 %14 = icmp ne i32 %13, 0
70 br i1 %14, label %15, label %15
72 ; <label>:15: ; preds = %12, %12
73 br i1 %14, label %16, label %17
75 ; <label>:16: ; preds = %15
78 ; <label>:17: ; preds = %16, %15
79 %.0 = phi i32 [ 1, %16 ], [ -1, %15 ]
80 %18 = and i32 %.0, 8693
81 %19 = load i32, ptr @c, align 4
82 %20 = xor i32 %18, %19
84 store i32 %21, ptr @d, align 4
85 %22 = icmp slt i32 %20, -2
86 br i1 %22, label %1, label %23
88 ; <label>:23: ; preds = %17
92 declare i32 @printf(ptr, ...)