1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -loop-deletion -enable-new-pm=0 < %s | FileCheck %s
4 ; Make sure this does not crash due to incorrect SCEV invalidation (PR49967).
9 ; CHECK-NEXT: br label [[VECTOR_PH:%.*]]
11 ; CHECK-NEXT: br label [[FOR_BODY63:%.*]]
12 ; CHECK: for.cond.cleanup62:
13 ; CHECK-NEXT: br i1 true, label [[FOR_BODY151_PREHEADER:%.*]], label [[VECTOR_PH]]
14 ; CHECK: for.body151.preheader:
15 ; CHECK-NEXT: br label [[FOR_COND_CLEANUP150_LOOPEXIT:%.*]]
17 ; CHECK-NEXT: [[I58_010:%.*]] = phi i16 [ 32, [[VECTOR_PH]] ]
18 ; CHECK-NEXT: store i16 undef, i16* undef, align 1
19 ; CHECK-NEXT: [[INC89:%.*]] = add nuw nsw i16 [[I58_010]], 1
20 ; CHECK-NEXT: [[EXITCOND12_NOT:%.*]] = icmp eq i16 [[INC89]], 33
21 ; CHECK-NEXT: br i1 [[EXITCOND12_NOT]], label [[FOR_COND_CLEANUP62:%.*]], label [[FOR_BODY63_FOR_BODY63_CRIT_EDGE:%.*]]
22 ; CHECK: for.body63.for.body63_crit_edge:
23 ; CHECK-NEXT: unreachable
24 ; CHECK: for.cond.cleanup150.loopexit:
25 ; CHECK-NEXT: unreachable
30 vector.ph: ; preds = %for.cond.cleanup62, %entry
33 for.cond.cleanup62: ; preds = %for.body63
34 br i1 true, label %for.body151.preheader, label %vector.ph
36 for.body151.preheader: ; preds = %for.cond.cleanup62
39 for.body63: ; preds = %for.body63, %vector.ph
40 %i58.010 = phi i16 [ 32, %vector.ph ], [ %inc89, %for.body63 ]
41 store i16 undef, i16* undef, align 1
42 %inc89 = add nuw nsw i16 %i58.010, 1
43 %exitcond12.not = icmp eq i16 %inc89, 33
44 br i1 %exitcond12.not, label %for.cond.cleanup62, label %for.body63
46 for.cond.cleanup150.loopexit: ; preds = %for.body151
49 for.body151: ; preds = %for.body151.preheader, %for.body151
50 %i146.29 = phi i16 [ %inc177, %for.body151 ], [ undef, %for.body151.preheader ]
51 %inc177 = add nuw nsw i16 %i146.29, 1
52 %exitcond.not = icmp eq i16 %inc177, 32
53 br i1 %exitcond.not, label %for.cond.cleanup150.loopexit, label %for.body151