1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -simplifycfg < %s -S | FileCheck %s
4 ; The dead code would cause a select that had itself
5 ; as an operand to be analyzed. This would then cause
6 ; infinite recursion and eventual crash.
8 define void @PR36045(i1 %t, i32* %b) {
9 ; CHECK-LABEL: @PR36045(
11 ; CHECK-NEXT: [[TMP0:%.*]] = xor i1 [[T:%.*]], true
12 ; CHECK-NEXT: call void @llvm.assume(i1 [[TMP0]])
13 ; CHECK-NEXT: ret void
16 br i1 %t, label %if, label %end
19 br i1 %t, label %unreach, label %pre
25 %p = phi i32 [ 70, %if ], [ %sel, %for ]
29 %cmp = icmp sgt i32 %p, 8
31 %sel = select i1 %cmp, i32 %p, i32 %add
32 %cmp21 = icmp ult i32 %sel, 21
33 br i1 %cmp21, label %pre, label %for.end
36 br i1 %t, label %unreach2, label %then12
43 %spec = phi i32 [ %sel, %for.end ], [ 42, %then12 ]