brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.7 KiB · c82aa3b Raw
141 lines · plain
1; RUN: llc < %s -frame-pointer=all -verify-coalescing2; PR134143;4; During coalescing, remat triggers DCE which deletes the penultimate use of a5; load. This load should not be folded into the remaining use because it is not6; safe to move, and it would extend the live range of the address.7;8; LiveRangeEdit::foldAsLoad() doesn't extend live ranges, so -verify-coalescing9; catches the problem.10 11target triple = "i386-unknown-linux-gnu"12 13%type_a = type { ptr, %type_b }14%type_b = type { %type_c, i32 }15%type_c = type { i32, %type_d }16%type_d = type { i64 }17%type_e = type { %type_c, i64 }18 19declare void @llvm.memcpy.p0.p0.i32(ptr nocapture, ptr nocapture, i32, i1) nounwind20 21define linkonce_odr void @test(i1 %arg) nounwind {22entry:23  br i1 %arg, label %while.end.while.end26_crit_edge, label %while.body12.lr.ph24 25while.end.while.end26_crit_edge:                  ; preds = %entry26  br label %while.end2627 28while.body12.lr.ph:                               ; preds = %entry29  br label %while.body1230 31while.body12:                                     ; preds = %if.end24, %while.body12.lr.ph32  %tmp = phi ptr [ undef, %while.body12.lr.ph ], [ %tmp18, %if.end24 ]33  %ins151154161 = phi i128 [ 0, %while.body12.lr.ph ], [ %phitmp, %if.end24 ]34  %ins135156160 = phi i128 [ 0, %while.body12.lr.ph ], [ %phitmp158, %if.end24 ]35  %ins151 = or i128 0, %ins15115416136  %cmp.i.i.i.i.i67 = icmp sgt i32 undef, 837  br i1 %cmp.i.i.i.i.i67, label %if.then.i.i.i.i71, label %if.else.i.i.i.i7438 39if.then.i.i.i.i71:                                ; preds = %while.body1240  %call4.i.i.i.i68 = call noalias ptr @malloc(i32 undef) nounwind41  %tmp1 = getelementptr inbounds %type_a, ptr %tmp, i32 0, i32 1, i32 0, i32 142  %tmp2 = load ptr, ptr %tmp1, align 443  call void @llvm.memcpy.p0.p0.i32(ptr undef, ptr %tmp2, i32 undef, i1 false) nounwind44  unreachable45 46if.else.i.i.i.i74:                                ; preds = %while.body1247  %i_.i.i.i.i72 = getelementptr inbounds %type_a, ptr %tmp, i32 0, i32 1, i32 0, i32 1, i32 048  %tmp3 = load i64, ptr %i_.i.i.i.i72, align 449  %tmp4 = zext i64 %tmp3 to i12850  %tmp5 = shl nuw nsw i128 %tmp4, 3251  %ins148 = or i128 %tmp5, %ins15152  %second3.i.i76 = getelementptr inbounds %type_a, ptr %tmp, i32 0, i32 1, i32 153  %tmp6 = load i32, ptr %second3.i.i76, align 454  %tmp7 = zext i32 %tmp6 to i12855  %tmp8 = shl nuw i128 %tmp7, 9656  %mask144 = and i128 %ins148, 7922816249581759351983439872057  %tmp9 = load ptr, ptr undef, align 458  %tmp10 = load i32, ptr %tmp9, align 459  %tmp11 = zext i32 %tmp10 to i12860  %ins135 = or i128 %tmp11, %ins13515616061  %cmp.i.i.i.i.i88 = icmp sgt i32 %tmp10, 862  br i1 %cmp.i.i.i.i.i88, label %if.then.i.i.i.i92, label %if.else.i.i.i.i9563 64if.then.i.i.i.i92:                                ; preds = %if.else.i.i.i.i7465  %call4.i.i.i.i89 = call noalias ptr @malloc(i32 %tmp10) nounwind66  %ins126 = or i128 0, %ins13567  %tmp12 = getelementptr inbounds %type_e, ptr %tmp9, i32 0, i32 0, i32 168  %tmp13 = load ptr, ptr %tmp12, align 469  call void @llvm.memcpy.p0.p0.i32(ptr %call4.i.i.i.i89, ptr %tmp13, i32 %tmp10, i1 false) nounwind70  br label %A71 72if.else.i.i.i.i95:                                ; preds = %if.else.i.i.i.i7473  %i_.i.i.i.i93 = getelementptr inbounds %type_e, ptr %tmp9, i32 0, i32 0, i32 1, i32 074  br label %A75 76A:                                                ; preds = %if.else.i.i.i.i95, %if.then.i.i.i.i9277  %ins135157 = phi i128 [ %ins126, %if.then.i.i.i.i92 ], [ undef, %if.else.i.i.i.i95 ]78  %second3.i.i97 = getelementptr inbounds %type_e, ptr %tmp9, i32 0, i32 179  %tmp14 = load i64, ptr %second3.i.i97, align 480  %tmp15 = trunc i64 %tmp14 to i3281  %cmp.i99 = icmp sgt i32 %tmp6, %tmp1582  %tmp16 = trunc i128 %ins135157 to i3283  %cmp.i.i.i.i.i.i101 = icmp sgt i32 %tmp16, 884  br i1 %cmp.i.i.i.i.i.i101, label %if.then.i.i.i.i.i103, label %B85 86if.then.i.i.i.i.i103:                             ; preds = %A87  unreachable88 89B:                                                ; preds = %A90  %tmp17 = trunc i128 %ins148 to i3291  %cmp.i.i.i.i.i.i83 = icmp sgt i32 %tmp17, 892  br i1 %cmp.i.i.i.i.i.i83, label %if.then.i.i.i.i.i85, label %C93 94if.then.i.i.i.i.i85:                              ; preds = %B95  unreachable96 97C:                                                ; preds = %B98  br i1 %cmp.i99, label %if.then17, label %if.end2499 100if.then17:                                        ; preds = %C101  br i1 false, label %if.then.i.i.i.i.i43, label %D102 103if.then.i.i.i.i.i43:                              ; preds = %if.then17104  unreachable105 106D:                                                ; preds = %if.then17107  br i1 %arg, label %if.then.i.i.i.i.i, label %E108 109if.then.i.i.i.i.i:                                ; preds = %D110  unreachable111 112E:                                                ; preds = %D113  br label %if.end24114 115if.end24:                                         ; preds = %E, %C116  %phitmp = or i128 %tmp8, %mask144117  %phitmp158 = or i128 undef, undef118  %tmp18 = load ptr, ptr undef, align 4119  %tmp19 = load ptr, ptr undef, align 4120  %cmp.i49 = icmp eq ptr %tmp18, %tmp19121  br i1 %cmp.i49, label %while.cond10.while.end26_crit_edge, label %while.body12122 123while.cond10.while.end26_crit_edge:               ; preds = %if.end24124  %.pre = load ptr, ptr undef, align 4125  br label %while.end26126 127while.end26:                                      ; preds = %while.cond10.while.end26_crit_edge, %while.end.while.end26_crit_edge128  br i1 %arg, label %while.body.lr.ph.i, label %F129 130while.body.lr.ph.i:                               ; preds = %while.end26131  br label %while.body.i132 133while.body.i:                                     ; preds = %while.body.i, %while.body.lr.ph.i134  br i1 false, label %while.body.i, label %F135 136F:                                                ; preds = %while.body.i, %while.end26137  ret void138}139 140declare noalias ptr @malloc(i32) nounwind141