brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · f553baf Raw
50 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -passes=simplifycfg < %s -S | FileCheck %s3 4; The dead code would cause a select that had itself5; as an operand to be analyzed. This would then cause6; infinite recursion and eventual crash.7 8define void @PR36045(i1 %t, ptr %b) {9; CHECK-LABEL: @PR36045(10; CHECK-NEXT:  entry:11; CHECK-NEXT:    [[TMP0:%.*]] = xor i1 [[T:%.*]], true12; CHECK-NEXT:    call void @llvm.assume(i1 [[TMP0]])13; CHECK-NEXT:    ret void14;15entry:16  br i1 %t, label %if, label %end17 18if:19  br i1 %t, label %unreach, label %pre20 21unreach:22  unreachable23 24pre:25  %p = phi i32 [ 70, %if ], [ %sel, %for ]26  br label %for27 28for:29  %cmp = icmp sgt i32 %p, 830  %add = add i32 %p, 231  %sel = select i1 %cmp, i32 %p, i32 %add32  %cmp21 = icmp ult i32 %sel, 2133  br i1 %cmp21, label %pre, label %for.end34 35for.end:36  br i1 %t, label %unreach2, label %then1237 38then12:39  store i32 0, ptr %b40  br label %unreach241 42unreach2:43  %spec = phi i32 [ %sel, %for.end ], [ 42, %then12 ]44  unreachable45 46end:47  ret void48}49 50