1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
4 define i1 @qux(ptr %m, ptr %n, ptr %o, ptr %p) nounwind {
7 ; CHECK-NEXT: [[T7:%.*]] = icmp eq ptr [[M:%.*]], [[N:%.*]]
8 ; CHECK-NEXT: [[T15:%.*]] = icmp eq ptr [[O:%.*]], [[P:%.*]]
9 ; CHECK-NEXT: [[SPEC_SELECT:%.*]] = select i1 [[T7]], i1 [[T15]], i1 false, !prof [[PROF0:![0-9]+]]
10 ; CHECK-NEXT: ret i1 [[SPEC_SELECT]]
13 %t7 = icmp eq ptr %m, %n
14 br i1 %t7, label %bb, label %UnifiedReturnBlock, !prof !0
17 %t15 = icmp eq ptr %o, %p
18 br label %UnifiedReturnBlock
21 %result = phi i1 [ 0, %entry ], [ %t15, %bb ]
26 @a = external dso_local global i32, align 4
28 define i32 @PR50638() {
29 ; CHECK-LABEL: @PR50638(
31 ; CHECK-NEXT: store i32 0, ptr @a, align 4
32 ; CHECK-NEXT: ret i32 0
35 store i32 0, ptr @a, align 4
39 %tobool.not = phi i1 [ false, %for ], [ true, %entry ]
40 br i1 %tobool.not, label %end, label %for
43 %cmp = phi i1 [ true, %pre.for ], [ false, %post.for ]
44 %storemerge = phi i32 [ 0, %pre.for ], [ 1, %post.for ]
45 store i32 %storemerge, ptr @a, align 4
46 br i1 %cmp, label %post.for, label %pre.for
55 !0 = !{!"branch_weights", i32 4, i32 64}