1 ; RUN: opt < %s -passes='loop-mssa(loop-deletion,licm,loop-idiom)' -disable-output
2 ; Check no assertion when loop-idiom deletes the MemSet already analyzed by licm
3 define void @set_array() {
4 br i1 false, label %bb3.preheader.lr.ph, label %bb9
6 bb3.preheader.lr.ph: ; preds = %0
7 br label %bb3.preheader
9 bb4: ; preds = %bb4.lr.ph, %bb7
10 %j.3.06 = phi i8 [ %j.3.17, %bb4.lr.ph ], [ %_tmp13, %bb7 ]
13 bb6: ; preds = %bb4, %bb6
14 %k.4.04 = phi i8 [ 0, %bb4 ], [ %_tmp9, %bb6 ]
15 %_tmp31 = sext i8 %j.3.06 to i64
16 %_tmp4 = mul i64 %_tmp31, 10
17 %_tmp5 = getelementptr i8, ptr undef, i64 %_tmp4
18 %_tmp7 = getelementptr i8, ptr %_tmp5, i8 %k.4.04
19 store i8 42, ptr %_tmp7
20 %_tmp9 = add i8 %k.4.04, 1
21 %_tmp11 = icmp slt i8 %_tmp9, 10
22 br i1 %_tmp11, label %bb6, label %bb7
25 %_tmp13 = add i8 %j.3.06, 1
26 %_tmp15 = icmp slt i8 %_tmp13, 2
27 br i1 %_tmp15, label %bb4, label %bb3.bb1.loopexit_crit_edge
29 bb3.bb1.loopexit_crit_edge: ; preds = %bb7
30 %split = phi i8 [ %_tmp13, %bb7 ]
31 br label %bb1.loopexit
33 bb1.loopexit: ; preds = %bb3.bb1.loopexit_crit_edge, %bb3.preheader
34 %j.3.0.lcssa = phi i8 [ %split, %bb3.bb1.loopexit_crit_edge ], [ %j.3.17, %bb3.preheader ]
35 br i1 false, label %bb3.preheader, label %bb1.bb9_crit_edge
37 bb3.preheader: ; preds = %bb3.preheader.lr.ph, %bb1.loopexit
38 %j.3.17 = phi i8 [ undef, %bb3.preheader.lr.ph ], [ %j.3.0.lcssa, %bb1.loopexit ]
39 %_tmp155 = icmp slt i8 %j.3.17, 2
40 br i1 %_tmp155, label %bb4.lr.ph, label %bb1.loopexit
42 bb4.lr.ph: ; preds = %bb3.preheader
45 bb1.bb9_crit_edge: ; preds = %bb1.loopexit
48 bb9: ; preds = %bb1.bb9_crit_edge, %0