17 changes: 8 additions & 9 deletions llvm/test/Transforms/IndVarSimplify/dangling-use.ll
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,38 @@
target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i8:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f128:64:128-n32"
target triple = "powerpc-unknown-linux-gnu"

define void @vec_inverse_5_7_vert_loop_copyseparate(i8* %x, i32 %n, i32 %rowbytes) nounwind {
define void @vec_inverse_5_7_vert_loop_copyseparate(ptr %x, i32 %n, i32 %rowbytes) nounwind {
entry:
%tmp1 = sdiv i32 %n, 3 ; <i32> [#uses=1]
%tmp2 = sdiv i32 %rowbytes, 5 ; <i32> [#uses=2]
br label %bb49

bb49: ; preds = %bb48, %entry
%x_addr.0 = phi i8* [ %x, %entry ], [ %tmp481, %bb48 ] ; <i8*> [#uses=2]
%x_addr.0 = phi ptr [ %x, %entry ], [ %tmp481, %bb48 ] ; <ptr> [#uses=2]
br label %bb10

bb10: ; preds = %bb49
%tmp326 = mul nsw i32 %tmp1, %tmp2 ; <i32> [#uses=1]
%tmp351 = getelementptr inbounds i8, i8* %x_addr.0, i32 %tmp326 ; <i8*> [#uses=1]
%tmp351 = getelementptr inbounds i8, ptr %x_addr.0, i32 %tmp326 ; <ptr> [#uses=1]
br i1 false, label %bb.nph, label %bb48

bb.nph: ; preds = %bb10
br label %bb23

bb23: ; preds = %bb28, %bb.nph
%pOriginHi.01 = phi i8* [ %tmp351, %bb.nph ], [ %pOriginHi.0, %bb28 ] ; <i8*> [#uses=2]
%tmp378 = bitcast i8* %pOriginHi.01 to i8* ; <i8*> [#uses=1]
store i8* %tmp378, i8** null
%tmp385 = getelementptr inbounds i8, i8* %pOriginHi.01, i32 %tmp2 ; <i8*> [#uses=1]
%pOriginHi.01 = phi ptr [ %tmp351, %bb.nph ], [ %pOriginHi.0, %bb28 ] ; <ptr> [#uses=2]
store ptr %pOriginHi.01, ptr null
%tmp385 = getelementptr inbounds i8, ptr %pOriginHi.01, i32 %tmp2 ; <ptr> [#uses=1]
br label %bb28

bb28: ; preds = %bb23
%pOriginHi.0 = phi i8* [ %tmp385, %bb23 ] ; <i8*> [#uses=1]
%pOriginHi.0 = phi ptr [ %tmp385, %bb23 ] ; <ptr> [#uses=1]
br i1 false, label %bb23, label %bb28.bb48_crit_edge

bb28.bb48_crit_edge: ; preds = %bb28
br label %bb48

bb48: ; preds = %bb28.bb48_crit_edge, %bb10
%tmp481 = getelementptr inbounds i8, i8* %x_addr.0, i32 1 ; <i8*> [#uses=1]
%tmp481 = getelementptr inbounds i8, ptr %x_addr.0, i32 1 ; <ptr> [#uses=1]
br label %bb49
}
26 changes: 13 additions & 13 deletions llvm/test/Transforms/IndVarSimplify/deterministic-sign.ll
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
target triple = "aarch64-unknown-linux-gnu"

define dso_local float @foo(float* noalias %dst, float* %src, i32 %offset, i32 %N) {
define dso_local float @foo(ptr noalias %dst, ptr %src, i32 %offset, i32 %N) {
; CHECK-LABEL: @foo(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i32 1, [[N:%.*]]
Expand All @@ -21,14 +21,14 @@ define dso_local float @foo(float* noalias %dst, float* %src, i32 %offset, i32 %
; CHECK: for.body:
; CHECK-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ 1, [[FOR_BODY_LR_PH]] ], [ [[INDVARS_IV_NEXT:%.*]], [[FOR_BODY]] ]
; CHECK-NEXT: [[TMP1:%.*]] = add nsw i64 [[INDVARS_IV]], [[TMP0]]
; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds float, float* [[SRC:%.*]], i64 [[TMP1]]
; CHECK-NEXT: [[TMP2:%.*]] = load float, float* [[ARRAYIDX]], align 4
; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds float, ptr [[SRC:%.*]], i64 [[TMP1]]
; CHECK-NEXT: [[TMP2:%.*]] = load float, ptr [[ARRAYIDX]], align 4
; CHECK-NEXT: [[TMP3:%.*]] = add nsw i64 [[TMP1]], 1
; CHECK-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds float, float* [[SRC]], i64 [[TMP3]]
; CHECK-NEXT: [[TMP4:%.*]] = load float, float* [[ARRAYIDX3]], align 4
; CHECK-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds float, ptr [[SRC]], i64 [[TMP3]]
; CHECK-NEXT: [[TMP4:%.*]] = load float, ptr [[ARRAYIDX3]], align 4
; CHECK-NEXT: [[ADD4:%.*]] = fadd fast float [[TMP2]], [[TMP4]]
; CHECK-NEXT: [[ARRAYIDX6:%.*]] = getelementptr inbounds float, float* [[DST:%.*]], i64 [[INDVARS_IV]]
; CHECK-NEXT: store float [[ADD4]], float* [[ARRAYIDX6]], align 4
; CHECK-NEXT: [[ARRAYIDX6:%.*]] = getelementptr inbounds float, ptr [[DST:%.*]], i64 [[INDVARS_IV]]
; CHECK-NEXT: store float [[ADD4]], ptr [[ARRAYIDX6]], align 4
; CHECK-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
; CHECK-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV_NEXT]], [[WIDE_TRIP_COUNT]]
; CHECK-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY]], label [[FOR_COND_FOR_COND_CLEANUP_CRIT_EDGE:%.*]], !llvm.loop [[LOOP0:![0-9]+]]
Expand All @@ -47,16 +47,16 @@ for.cond.cleanup: ; preds = %for.cond
for.body: ; preds = %for.cond
%add = add nsw i32 %i.0, %offset
%idxprom = sext i32 %add to i64
%arrayidx = getelementptr inbounds float, float* %src, i64 %idxprom
%0 = load float, float* %arrayidx, align 4
%arrayidx = getelementptr inbounds float, ptr %src, i64 %idxprom
%0 = load float, ptr %arrayidx, align 4
%add1 = add nsw i32 %add, 1
%idxprom2 = sext i32 %add1 to i64
%arrayidx3 = getelementptr inbounds float, float* %src, i64 %idxprom2
%1 = load float, float* %arrayidx3, align 4
%arrayidx3 = getelementptr inbounds float, ptr %src, i64 %idxprom2
%1 = load float, ptr %arrayidx3, align 4
%add4 = fadd fast float %0, %1
%idxprom5 = zext i32 %i.0 to i64
%arrayidx6 = getelementptr inbounds float, float* %dst, i64 %idxprom5
store float %add4, float* %arrayidx6, align 4
%arrayidx6 = getelementptr inbounds float, ptr %dst, i64 %idxprom5
store float %add4, ptr %arrayidx6, align 4
%inc = add nuw nsw i32 %i.0, 1
br label %for.cond, !llvm.loop !1
}
Expand Down
16 changes: 8 additions & 8 deletions llvm/test/Transforms/IndVarSimplify/divide-pointer.ll
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ target triple = "i386-apple-darwin10.0"
%struct.xyz = type <{ i64, i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, [8 x i8], i64, i64, i32, i32, [4 x i32], i32, i32, i32, i32, i32, i32, [76 x i32], i32, [2 x %struct.uvw] }>
%struct.uvw = type <{ i64, i64 }>

define i32 @foo(%struct.xyz* %header, i8* %p2, i8* %p3, i8* nocapture %p4) nounwind {
define i32 @foo(ptr %header, ptr %p2, ptr %p3, ptr nocapture %p4) nounwind {
entry:
br label %while.body.i

while.body.i: ; preds = %while.body.i, %entry
br i1 undef, label %while.body.i, label %bcopy_internal.exit

bcopy_internal.exit: ; preds = %while.body.i
%conv135 = ptrtoint %struct.xyz* %header to i32 ; <i32> [#uses=1]
%conv135 = ptrtoint ptr %header to i32 ; <i32> [#uses=1]
%shr136 = lshr i32 %conv135, 12 ; <i32> [#uses=1]
br label %for.body

Expand All @@ -28,15 +28,15 @@ if.then199: ; preds = %if.then199, %for.body
br label %if.then199
}

define i32 @same_thing_but_signed(%struct.xyz* %header, i8* %p2, i8* %p3, i8* nocapture %p4) nounwind {
define i32 @same_thing_but_signed(ptr %header, ptr %p2, ptr %p3, ptr nocapture %p4) nounwind {
entry:
br label %while.body.i

while.body.i: ; preds = %while.body.i, %entry
br i1 undef, label %while.body.i, label %bcopy_internal.exit

bcopy_internal.exit: ; preds = %while.body.i
%conv135 = ptrtoint %struct.xyz* %header to i32 ; <i32> [#uses=1]
%conv135 = ptrtoint ptr %header to i32 ; <i32> [#uses=1]
%shr136 = ashr i32 %conv135, 12 ; <i32> [#uses=1]
br label %for.body

Expand All @@ -50,15 +50,15 @@ if.then199: ; preds = %if.then199, %for.body
br label %if.then199
}

define i32 @same_thing_but_multiplied(%struct.xyz* %header, i8* %p2, i8* %p3, i8* nocapture %p4) nounwind {
define i32 @same_thing_but_multiplied(ptr %header, ptr %p2, ptr %p3, ptr nocapture %p4) nounwind {
entry:
br label %while.body.i

while.body.i: ; preds = %while.body.i, %entry
br i1 undef, label %while.body.i, label %bcopy_internal.exit

bcopy_internal.exit: ; preds = %while.body.i
%conv135 = ptrtoint %struct.xyz* %header to i32 ; <i32> [#uses=1]
%conv135 = ptrtoint ptr %header to i32 ; <i32> [#uses=1]
%shr136 = shl i32 %conv135, 12 ; <i32> [#uses=1]
br label %for.body

Expand All @@ -72,15 +72,15 @@ if.then199: ; preds = %if.then199, %for.body
br label %if.then199
}

define i32 @same_thing_but_xored(%struct.xyz* %header, i8* %p2, i8* %p3, i8* nocapture %p4) nounwind {
define i32 @same_thing_but_xored(ptr %header, ptr %p2, ptr %p3, ptr nocapture %p4) nounwind {
entry:
br label %while.body.i

while.body.i: ; preds = %while.body.i, %entry
br i1 undef, label %while.body.i, label %bcopy_internal.exit

bcopy_internal.exit: ; preds = %while.body.i
%conv135 = ptrtoint %struct.xyz* %header to i32 ; <i32> [#uses=1]
%conv135 = ptrtoint ptr %header to i32 ; <i32> [#uses=1]
%shr136 = xor i32 %conv135, 12 ; <i32> [#uses=1]
br label %for.body

Expand Down
10 changes: 5 additions & 5 deletions llvm/test/Transforms/IndVarSimplify/dont-recompute.ll
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ for.end: ; preds = %for.body
ret void
}

define void @test6(i32 %m, i32* %p) nounwind uwtable {
define void @test6(i32 %m, ptr %p) nounwind uwtable {
; CHECK-LABEL: @test6(
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[FOR_BODY:%.*]]
Expand All @@ -210,8 +210,8 @@ define void @test6(i32 %m, i32* %p) nounwind uwtable {
; CHECK-NEXT: [[A_05:%.*]] = phi i32 [ 0, [[ENTRY]] ], [ [[ADD:%.*]], [[FOR_BODY]] ]
; CHECK-NEXT: [[ADD]] = add i32 [[A_05]], [[M:%.*]]
; CHECK-NEXT: [[SOFT_USE:%.*]] = add i32 [[ADD]], 123
; CHECK-NEXT: [[PIDX:%.*]] = getelementptr i32, i32* [[P:%.*]], i32 [[ADD]]
; CHECK-NEXT: store i32 [[SOFT_USE]], i32* [[PIDX]]
; CHECK-NEXT: [[PIDX:%.*]] = getelementptr i32, ptr [[P:%.*]], i32 [[ADD]]
; CHECK-NEXT: store i32 [[SOFT_USE]], ptr [[PIDX]]
; CHECK-NEXT: [[INC]] = add nuw nsw i32 [[I_06]], 1
; CHECK-NEXT: [[EXITCOND:%.*]] = icmp eq i32 [[INC]], 186
; CHECK-NEXT: br i1 [[EXITCOND]], label [[FOR_END:%.*]], label [[FOR_BODY]]
Expand All @@ -228,8 +228,8 @@ for.body: ; preds = %for.body, %entry
%a.05 = phi i32 [ 0, %entry ], [ %add, %for.body ]
%add = add i32 %a.05, %m
%soft_use = add i32 %add, 123
%pidx = getelementptr i32, i32* %p, i32 %add
store i32 %soft_use, i32* %pidx
%pidx = getelementptr i32, ptr %p, i32 %add
store i32 %soft_use, ptr %pidx
%inc = add nsw i32 %i.06, 1
%exitcond = icmp eq i32 %inc, 186
br i1 %exitcond, label %for.end, label %for.body
Expand Down
20 changes: 10 additions & 10 deletions llvm/test/Transforms/IndVarSimplify/drop-exact.ll
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128-ni:1"

; We make a transform by getting rid of add nsw i32 %tmp17, -1; make sure that
; we drop "exact" flag on lshr as we do it.
define void @drop_exact(i32* %p, i64* %p1) {
define void @drop_exact(ptr %p, ptr %p1) {
; CHECK-LABEL: @drop_exact(
; CHECK-NEXT: bb:
; CHECK-NEXT: br label [[BB12:%.*]]
Expand All @@ -20,9 +20,9 @@ define void @drop_exact(i32* %p, i64* %p1) {
; CHECK-NEXT: [[TMP19:%.*]] = lshr i32 [[TMP17]], 1
; CHECK-NEXT: [[TMP20:%.*]] = urem i32 [[TMP19]], 250
; CHECK-NEXT: [[TMP22:%.*]] = lshr i32 [[TMP17]], 1
; CHECK-NEXT: store i32 [[TMP22]], i32* [[P:%.*]], align 4
; CHECK-NEXT: store i32 [[TMP22]], ptr [[P:%.*]], align 4
; CHECK-NEXT: [[TMP26:%.*]] = zext i32 [[TMP20]] to i64
; CHECK-NEXT: store i64 [[TMP26]], i64* [[P1:%.*]], align 4
; CHECK-NEXT: store i64 [[TMP26]], ptr [[P1:%.*]], align 4
; CHECK-NEXT: [[TMP42]] = add nuw nsw i32 [[TMP14]], 1
; CHECK-NEXT: [[EXITCOND:%.*]] = icmp eq i32 [[TMP42]], 719
; CHECK-NEXT: br i1 [[EXITCOND]], label [[BB7:%.*]], label [[BB12]]
Expand All @@ -43,16 +43,16 @@ bb12: ; preds = %bb12, %bb
%tmp20 = urem i32 %tmp19, 250
%tmp21 = add nsw i32 %tmp17, -1
%tmp22 = lshr exact i32 %tmp21, 1
store i32 %tmp22, i32* %p, align 4
store i32 %tmp22, ptr %p, align 4
%tmp26 = zext i32 %tmp20 to i64
store i64 %tmp26, i64* %p1, align 4
store i64 %tmp26, ptr %p1, align 4
%tmp42 = add nuw nsw i32 %tmp14, 1
%tmp43 = icmp ugt i32 %tmp14, 717
br i1 %tmp43, label %bb7, label %bb12
}

; Throw away add nsw i32 %tmp17, 0, do not drop exact flag.
define void @dont_drop_exact(i32* %p, i64* %p1) {
define void @dont_drop_exact(ptr %p, ptr %p1) {
; CHECK-LABEL: @dont_drop_exact(
; CHECK-NEXT: bb:
; CHECK-NEXT: br label [[BB12:%.*]]
Expand All @@ -67,9 +67,9 @@ define void @dont_drop_exact(i32* %p, i64* %p1) {
; CHECK-NEXT: [[TMP19:%.*]] = lshr i32 [[TMP17]], 1
; CHECK-NEXT: [[TMP20:%.*]] = urem i32 [[TMP19]], 250
; CHECK-NEXT: [[TMP22:%.*]] = lshr exact i32 [[TMP17]], 1
; CHECK-NEXT: store i32 [[TMP22]], i32* [[P:%.*]], align 4
; CHECK-NEXT: store i32 [[TMP22]], ptr [[P:%.*]], align 4
; CHECK-NEXT: [[TMP26:%.*]] = zext i32 [[TMP20]] to i64
; CHECK-NEXT: store i64 [[TMP26]], i64* [[P1:%.*]], align 4
; CHECK-NEXT: store i64 [[TMP26]], ptr [[P1:%.*]], align 4
; CHECK-NEXT: [[TMP42]] = add nuw nsw i32 [[TMP14]], 1
; CHECK-NEXT: [[EXITCOND:%.*]] = icmp eq i32 [[TMP42]], 719
; CHECK-NEXT: br i1 [[EXITCOND]], label [[BB7:%.*]], label [[BB12]]
Expand All @@ -90,9 +90,9 @@ bb12: ; preds = %bb12, %bb
%tmp20 = urem i32 %tmp19, 250
%tmp21 = add nsw i32 %tmp17, 0
%tmp22 = lshr exact i32 %tmp21, 1
store i32 %tmp22, i32* %p, align 4
store i32 %tmp22, ptr %p, align 4
%tmp26 = zext i32 %tmp20 to i64
store i64 %tmp26, i64* %p1, align 4
store i64 %tmp26, ptr %p1, align 4
%tmp42 = add nuw nsw i32 %tmp14, 1
%tmp43 = icmp ugt i32 %tmp14, 717
br i1 %tmp43, label %bb7, label %bb12
Expand Down
94 changes: 47 additions & 47 deletions llvm/test/Transforms/IndVarSimplify/elim-extend.ll
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3

; IV with constant start, preinc and postinc sign extends, with and without NSW.
; IV rewrite only removes one sext. WidenIVs removes all three.
define void @postincConstIV(i8* %base, i32 %limit) nounwind {
define void @postincConstIV(ptr %base, i32 %limit) nounwind {
; CHECK-LABEL: @postincConstIV(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[SMAX:%.*]] = call i32 @llvm.smax.i32(i32 [[LIMIT:%.*]], i32 0)
Expand All @@ -14,13 +14,13 @@ define void @postincConstIV(i8* %base, i32 %limit) nounwind {
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
; CHECK-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[LOOP]] ], [ 0, [[ENTRY:%.*]] ]
; CHECK-NEXT: [[PREADR:%.*]] = getelementptr i8, i8* [[BASE:%.*]], i64 [[INDVARS_IV]]
; CHECK-NEXT: store i8 0, i8* [[PREADR]], align 1
; CHECK-NEXT: [[PREADR:%.*]] = getelementptr i8, ptr [[BASE:%.*]], i64 [[INDVARS_IV]]
; CHECK-NEXT: store i8 0, ptr [[PREADR]], align 1
; CHECK-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
; CHECK-NEXT: [[POSTADR:%.*]] = getelementptr i8, i8* [[BASE]], i64 [[INDVARS_IV_NEXT]]
; CHECK-NEXT: store i8 0, i8* [[POSTADR]], align 1
; CHECK-NEXT: [[POSTADRNSW:%.*]] = getelementptr inbounds i8, i8* [[BASE]], i64 [[INDVARS_IV_NEXT]]
; CHECK-NEXT: store i8 0, i8* [[POSTADRNSW]], align 1
; CHECK-NEXT: [[POSTADR:%.*]] = getelementptr i8, ptr [[BASE]], i64 [[INDVARS_IV_NEXT]]
; CHECK-NEXT: store i8 0, ptr [[POSTADR]], align 1
; CHECK-NEXT: [[POSTADRNSW:%.*]] = getelementptr inbounds i8, ptr [[BASE]], i64 [[INDVARS_IV_NEXT]]
; CHECK-NEXT: store i8 0, ptr [[POSTADRNSW]], align 1
; CHECK-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV_NEXT]], [[WIDE_TRIP_COUNT]]
; CHECK-NEXT: br i1 [[EXITCOND]], label [[LOOP]], label [[EXIT:%.*]]
; CHECK: exit:
Expand All @@ -34,16 +34,16 @@ loop:
%iv = phi i32 [ %postiv, %loop ], [ 0, %entry ]
%ivnsw = phi i32 [ %postivnsw, %loop ], [ 0, %entry ]
%preofs = sext i32 %iv to i64
%preadr = getelementptr i8, i8* %base, i64 %preofs
store i8 0, i8* %preadr
%preadr = getelementptr i8, ptr %base, i64 %preofs
store i8 0, ptr %preadr
%postiv = add i32 %iv, 1
%postofs = sext i32 %postiv to i64
%postadr = getelementptr i8, i8* %base, i64 %postofs
store i8 0, i8* %postadr
%postadr = getelementptr i8, ptr %base, i64 %postofs
store i8 0, ptr %postadr
%postivnsw = add nsw i32 %ivnsw, 1
%postofsnsw = sext i32 %postivnsw to i64
%postadrnsw = getelementptr inbounds i8, i8* %base, i64 %postofsnsw
store i8 0, i8* %postadrnsw
%postadrnsw = getelementptr inbounds i8, ptr %base, i64 %postofsnsw
store i8 0, ptr %postadrnsw
%cond = icmp sgt i32 %limit, %iv
br i1 %cond, label %loop, label %exit
exit:
Expand All @@ -55,7 +55,7 @@ return:
; IV with nonconstant start, preinc and postinc sign extends,
; with and without NSW.
; As with postincConstIV, WidenIVs removes all three sexts.
define void @postincVarIV(i8* %base, i32 %init, i32 %limit) nounwind {
define void @postincVarIV(ptr %base, i32 %init, i32 %limit) nounwind {
; CHECK-LABEL: @postincVarIV(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[PRECOND:%.*]] = icmp sgt i32 [[LIMIT:%.*]], [[INIT:%.*]]
Expand All @@ -66,13 +66,13 @@ define void @postincVarIV(i8* %base, i32 %init, i32 %limit) nounwind {
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
; CHECK-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[TMP0]], [[LOOP_PREHEADER]] ], [ [[INDVARS_IV_NEXT:%.*]], [[LOOP]] ]
; CHECK-NEXT: [[PREADR:%.*]] = getelementptr i8, i8* [[BASE:%.*]], i64 [[INDVARS_IV]]
; CHECK-NEXT: store i8 0, i8* [[PREADR]], align 1
; CHECK-NEXT: [[PREADR:%.*]] = getelementptr i8, ptr [[BASE:%.*]], i64 [[INDVARS_IV]]
; CHECK-NEXT: store i8 0, ptr [[PREADR]], align 1
; CHECK-NEXT: [[INDVARS_IV_NEXT]] = add nsw i64 [[INDVARS_IV]], 1
; CHECK-NEXT: [[POSTADR:%.*]] = getelementptr i8, i8* [[BASE]], i64 [[INDVARS_IV_NEXT]]
; CHECK-NEXT: store i8 0, i8* [[POSTADR]], align 1
; CHECK-NEXT: [[POSTADRNSW:%.*]] = getelementptr i8, i8* [[BASE]], i64 [[INDVARS_IV_NEXT]]
; CHECK-NEXT: store i8 0, i8* [[POSTADRNSW]], align 1
; CHECK-NEXT: [[POSTADR:%.*]] = getelementptr i8, ptr [[BASE]], i64 [[INDVARS_IV_NEXT]]
; CHECK-NEXT: store i8 0, ptr [[POSTADR]], align 1
; CHECK-NEXT: [[POSTADRNSW:%.*]] = getelementptr i8, ptr [[BASE]], i64 [[INDVARS_IV_NEXT]]
; CHECK-NEXT: store i8 0, ptr [[POSTADRNSW]], align 1
; CHECK-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV_NEXT]], [[WIDE_TRIP_COUNT]]
; CHECK-NEXT: br i1 [[EXITCOND]], label [[LOOP]], label [[EXIT:%.*]]
; CHECK: exit:
Expand All @@ -87,16 +87,16 @@ loop:
%iv = phi i32 [ %postiv, %loop ], [ %init, %entry ]
%ivnsw = phi i32 [ %postivnsw, %loop ], [ %init, %entry ]
%preofs = sext i32 %iv to i64
%preadr = getelementptr i8, i8* %base, i64 %preofs
store i8 0, i8* %preadr
%preadr = getelementptr i8, ptr %base, i64 %preofs
store i8 0, ptr %preadr
%postiv = add i32 %iv, 1
%postofs = sext i32 %postiv to i64
%postadr = getelementptr i8, i8* %base, i64 %postofs
store i8 0, i8* %postadr
%postadr = getelementptr i8, ptr %base, i64 %postofs
store i8 0, ptr %postadr
%postivnsw = add nsw i32 %ivnsw, 1
%postofsnsw = sext i32 %postivnsw to i64
%postadrnsw = getelementptr i8, i8* %base, i64 %postofsnsw
store i8 0, i8* %postadrnsw
%postadrnsw = getelementptr i8, ptr %base, i64 %postofsnsw
store i8 0, ptr %postadrnsw
%cond = icmp sgt i32 %limit, %postiv
br i1 %cond, label %loop, label %exit
exit:
Expand All @@ -110,7 +110,7 @@ return:
; %innercount is currently blocked by lcssa, so is not widened.
; %inneriv can be widened only after proving it has no signed-overflow
; based on the loop test.
define void @nestedIV(i8* %address, i32 %limit) nounwind {
define void @nestedIV(ptr %address, i32 %limit) nounwind {
; CHECK-LABEL: @nestedIV(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[LIMITDEC:%.*]] = add i32 [[LIMIT:%.*]], -1
Expand All @@ -121,8 +121,8 @@ define void @nestedIV(i8* %address, i32 %limit) nounwind {
; CHECK-NEXT: [[INDVARS_IV1:%.*]] = phi i64 [ [[INDVARS_IV_NEXT2:%.*]], [[OUTERMERGE:%.*]] ], [ 0, [[ENTRY:%.*]] ]
; CHECK-NEXT: [[INNERCOUNT:%.*]] = phi i32 [ [[INNERCOUNT_MERGE:%.*]], [[OUTERMERGE]] ], [ 0, [[ENTRY]] ]
; CHECK-NEXT: [[TMP0:%.*]] = add nsw i64 [[INDVARS_IV1]], -1
; CHECK-NEXT: [[ADR1:%.*]] = getelementptr i8, i8* [[ADDRESS:%.*]], i64 [[TMP0]]
; CHECK-NEXT: store i8 0, i8* [[ADR1]], align 1
; CHECK-NEXT: [[ADR1:%.*]] = getelementptr i8, ptr [[ADDRESS:%.*]], i64 [[TMP0]]
; CHECK-NEXT: store i8 0, ptr [[ADR1]], align 1
; CHECK-NEXT: br label [[INNERPREHEADER:%.*]]
; CHECK: innerpreheader:
; CHECK-NEXT: [[INNERPRECMP:%.*]] = icmp sgt i32 [[LIMITDEC]], [[INNERCOUNT]]
Expand All @@ -134,10 +134,10 @@ define void @nestedIV(i8* %address, i32 %limit) nounwind {
; CHECK: innerloop:
; CHECK-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[TMP1]], [[INNERLOOP_PREHEADER]] ], [ [[INDVARS_IV_NEXT:%.*]], [[INNERLOOP]] ]
; CHECK-NEXT: [[INDVARS_IV_NEXT]] = add nsw i64 [[INDVARS_IV]], 1
; CHECK-NEXT: [[ADR2:%.*]] = getelementptr i8, i8* [[ADDRESS]], i64 [[INDVARS_IV]]
; CHECK-NEXT: store i8 0, i8* [[ADR2]], align 1
; CHECK-NEXT: [[ADR3:%.*]] = getelementptr i8, i8* [[ADDRESS]], i64 [[INDVARS_IV_NEXT]]
; CHECK-NEXT: store i8 0, i8* [[ADR3]], align 1
; CHECK-NEXT: [[ADR2:%.*]] = getelementptr i8, ptr [[ADDRESS]], i64 [[INDVARS_IV]]
; CHECK-NEXT: store i8 0, ptr [[ADR2]], align 1
; CHECK-NEXT: [[ADR3:%.*]] = getelementptr i8, ptr [[ADDRESS]], i64 [[INDVARS_IV_NEXT]]
; CHECK-NEXT: store i8 0, ptr [[ADR3]], align 1
; CHECK-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV_NEXT]], [[WIDE_TRIP_COUNT]]
; CHECK-NEXT: br i1 [[EXITCOND]], label [[INNERLOOP]], label [[INNEREXIT:%.*]]
; CHECK: innerexit:
Expand All @@ -146,11 +146,11 @@ define void @nestedIV(i8* %address, i32 %limit) nounwind {
; CHECK-NEXT: br label [[OUTERMERGE]]
; CHECK: outermerge:
; CHECK-NEXT: [[INNERCOUNT_MERGE]] = phi i32 [ [[TMP2]], [[INNEREXIT]] ], [ [[INNERCOUNT]], [[INNERPREHEADER]] ]
; CHECK-NEXT: [[ADR4:%.*]] = getelementptr i8, i8* [[ADDRESS]], i64 [[INDVARS_IV1]]
; CHECK-NEXT: store i8 0, i8* [[ADR4]], align 1
; CHECK-NEXT: [[ADR4:%.*]] = getelementptr i8, ptr [[ADDRESS]], i64 [[INDVARS_IV1]]
; CHECK-NEXT: store i8 0, ptr [[ADR4]], align 1
; CHECK-NEXT: [[OFS5:%.*]] = sext i32 [[INNERCOUNT_MERGE]] to i64
; CHECK-NEXT: [[ADR5:%.*]] = getelementptr i8, i8* [[ADDRESS]], i64 [[OFS5]]
; CHECK-NEXT: store i8 0, i8* [[ADR5]], align 1
; CHECK-NEXT: [[ADR5:%.*]] = getelementptr i8, ptr [[ADDRESS]], i64 [[OFS5]]
; CHECK-NEXT: store i8 0, ptr [[ADR5]], align 1
; CHECK-NEXT: [[INDVARS_IV_NEXT2]] = add nuw nsw i64 [[INDVARS_IV1]], 1
; CHECK-NEXT: [[EXITCOND5:%.*]] = icmp ne i64 [[INDVARS_IV_NEXT2]], [[WIDE_TRIP_COUNT4]]
; CHECK-NEXT: br i1 [[EXITCOND5]], label [[OUTERLOOP]], label [[RETURN:%.*]]
Expand All @@ -169,8 +169,8 @@ outerloop:

%outercountdec = add i32 %outercount, -1
%ofs1 = sext i32 %outercountdec to i64
%adr1 = getelementptr i8, i8* %address, i64 %ofs1
store i8 0, i8* %adr1
%adr1 = getelementptr i8, ptr %address, i64 %ofs1
store i8 0, ptr %adr1

br label %innerpreheader

Expand All @@ -188,12 +188,12 @@ innerloop:
%innerpostiv = add i32 %inneriv, 1

%ofs2 = sext i32 %inneriv to i64
%adr2 = getelementptr i8, i8* %address, i64 %ofs2
store i8 0, i8* %adr2
%adr2 = getelementptr i8, ptr %address, i64 %ofs2
store i8 0, ptr %adr2

%ofs3 = sext i32 %innerpostiv to i64
%adr3 = getelementptr i8, i8* %address, i64 %ofs3
store i8 0, i8* %adr3
%adr3 = getelementptr i8, ptr %address, i64 %ofs3
store i8 0, ptr %adr3

%innercmp = icmp sgt i32 %limitdec, %innerpostiv
br i1 %innercmp, label %innerloop, label %innerexit
Expand All @@ -208,12 +208,12 @@ outermerge:
%innercount.merge = phi i32 [ %innercount.lcssa, %innerexit ], [ %innercount, %innerpreheader ]

%ofs4 = sext i32 %outercount to i64
%adr4 = getelementptr i8, i8* %address, i64 %ofs4
store i8 0, i8* %adr4
%adr4 = getelementptr i8, ptr %address, i64 %ofs4
store i8 0, ptr %adr4

%ofs5 = sext i32 %innercount.merge to i64
%adr5 = getelementptr i8, i8* %address, i64 %ofs5
store i8 0, i8* %adr5
%adr5 = getelementptr i8, ptr %address, i64 %ofs5
store i8 0, ptr %adr5

%outerpostcount = add i32 %outercount, 1
%tmp47 = icmp slt i32 %outerpostcount, %limit
Expand Down
26 changes: 13 additions & 13 deletions llvm/test/Transforms/IndVarSimplify/eliminate-backedge.ll
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
; RUN: opt < %s -passes=indvars -S | FileCheck %s
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"

declare i1 @foo(i8*, i8*)
declare i1 @foo(ptr, ptr)
declare i1 @bar()
declare i1 @baz()

define i1 @kill_backedge_and_phis(i8* align 1 %lhs, i8* align 1 %rhs, i32 %len) {
define i1 @kill_backedge_and_phis(ptr align 1 %lhs, ptr align 1 %rhs, i32 %len) {
; CHECK-LABEL: @kill_backedge_and_phis(
; CHECK-NEXT: entry:
; CHECK-NEXT: %length_not_zero = icmp ne i32 %len, 0
; CHECK-NEXT: br i1 %length_not_zero, label %loop_preheader, label %exit
; CHECK: loop_preheader:
; CHECK-NEXT: br label %loop
; CHECK: loop:
; CHECK-NEXT: %result = call i1 @foo(i8* %lhs, i8* %rhs)
; CHECK-NEXT: %result = call i1 @foo(ptr %lhs, ptr %rhs)
; CHECK-NEXT: br i1 %result, label %exiting_1, label %exit.loopexit
; CHECK: exiting_1:
; CHECK-NEXT: br i1 false, label %exiting_2, label %exit.loopexit
Expand Down Expand Up @@ -45,9 +45,9 @@ loop:
%iv.wide = phi i64 [ 0, %loop_preheader ], [ %iv.wide.next, %latch ]
%iv.next = add i32 %iv, 1
%iv.wide.next = add i64 %iv.wide, 1
%left_ptr = getelementptr inbounds i8, i8* %lhs, i32 %iv
%right_ptr = getelementptr inbounds i8, i8* %rhs, i32 %iv
%result = call i1 @foo(i8* %left_ptr, i8* %right_ptr)
%left_ptr = getelementptr inbounds i8, ptr %lhs, i32 %iv
%right_ptr = getelementptr inbounds i8, ptr %rhs, i32 %iv
%result = call i1 @foo(ptr %left_ptr, ptr %right_ptr)
br i1 %result, label %exiting_1, label %exit

exiting_1:
Expand All @@ -73,7 +73,7 @@ exit:
ret i1 %val
}

define i1 @siblings(i8* align 1 %lhs, i8* align 1 %rhs, i32 %len) {
define i1 @siblings(ptr align 1 %lhs, ptr align 1 %rhs, i32 %len) {
; CHECK-LABEL: @siblings(
; CHECK-NEXT: entry:
; CHECK-NEXT: %length_not_zero = icmp ne i32 %len, 0
Expand All @@ -90,9 +90,9 @@ define i1 @siblings(i8* align 1 %lhs, i8* align 1 %rhs, i32 %len) {
; CHECK-NEXT: br label %loop
; CHECK: loop:
; CHECK-NEXT: %iv.next = add i32 %weird.iv.lcssa, 1
; CHECK-NEXT: %left_ptr = getelementptr inbounds i8, i8* %lhs, i32 %weird.iv.lcssa
; CHECK-NEXT: %right_ptr = getelementptr inbounds i8, i8* %rhs, i32 %weird.iv.lcssa
; CHECK-NEXT: %result = call i1 @foo(i8* %left_ptr, i8* %right_ptr)
; CHECK-NEXT: %left_ptr = getelementptr inbounds i8, ptr %lhs, i32 %weird.iv.lcssa
; CHECK-NEXT: %right_ptr = getelementptr inbounds i8, ptr %rhs, i32 %weird.iv.lcssa
; CHECK-NEXT: %result = call i1 @foo(ptr %left_ptr, ptr %right_ptr)
; CHECK-NEXT: br i1 %result, label %exiting_1, label %exit.loopexit
; CHECK: exiting_1:
; CHECK-NEXT: br i1 false, label %exiting_2, label %exit.loopexit
Expand Down Expand Up @@ -127,9 +127,9 @@ loop:
%iv.wide = phi i64 [ %weird.iv.wide, %weird_loop ], [ %iv.wide.next, %latch ]
%iv.next = add i32 %iv, 1
%iv.wide.next = add i64 %iv.wide, 1
%left_ptr = getelementptr inbounds i8, i8* %lhs, i32 %iv
%right_ptr = getelementptr inbounds i8, i8* %rhs, i32 %iv
%result = call i1 @foo(i8* %left_ptr, i8* %right_ptr)
%left_ptr = getelementptr inbounds i8, ptr %lhs, i32 %iv
%right_ptr = getelementptr inbounds i8, ptr %rhs, i32 %iv
%result = call i1 @foo(ptr %left_ptr, ptr %right_ptr)
br i1 %result, label %exiting_1, label %exit

exiting_1:
Expand Down
10 changes: 5 additions & 5 deletions llvm/test/Transforms/IndVarSimplify/eliminate-exit-no-dl.ll
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ define void @foo() {
; CHECK-NEXT: bb:
; CHECK-NEXT: br label [[BB3:%.*]]
; CHECK: bb3:
; CHECK-NEXT: [[TMP6:%.*]] = load i8, i8* getelementptr inbounds ([0 x i8], [0 x i8]* @global, i64 0, i64 1), align 1
; CHECK-NEXT: [[TMP6:%.*]] = load i8, ptr getelementptr inbounds ([0 x i8], ptr @global, i64 0, i64 1), align 1
; CHECK-NEXT: br i1 false, label [[BB7:%.*]], label [[BB11:%.*]]
; CHECK: bb7:
; CHECK-NEXT: [[TMP8:%.*]] = zext i8 [[TMP6]] to i64
Expand All @@ -26,10 +26,10 @@ bb:
br label %bb3

bb3: ; preds = %bb7, %bb2
%tmp = phi i8* [ %tmp4, %bb7 ], [ getelementptr inbounds ([0 x i8], [0 x i8]* @global, i64 0, i64 2), %bb ]
%tmp4 = getelementptr inbounds i8, i8* %tmp, i64 -1
%tmp6 = load i8, i8* %tmp4, align 1
%tmp5 = icmp ugt i8* %tmp4, getelementptr inbounds ([0 x i8], [0 x i8]* @global, i64 0, i64 500)
%tmp = phi ptr [ %tmp4, %bb7 ], [ getelementptr inbounds ([0 x i8], ptr @global, i64 0, i64 2), %bb ]
%tmp4 = getelementptr inbounds i8, ptr %tmp, i64 -1
%tmp6 = load i8, ptr %tmp4, align 1
%tmp5 = icmp ugt ptr %tmp4, getelementptr inbounds ([0 x i8], ptr @global, i64 0, i64 500)
br i1 %tmp5, label %bb7, label %bb11

bb7: ; preds = %bb3
Expand Down
6 changes: 3 additions & 3 deletions llvm/test/Transforms/IndVarSimplify/eliminate-max.ll
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
; cannot eliminate, because it requires analyzing more than just the
; range of the induction variable.

@0 = private constant [4 x i8] c"%d\0A\00", align 1 ; <[4 x i8]*> [#uses=1]
@0 = private constant [4 x i8] c"%d\0A\00", align 1 ; <ptr> [#uses=1]

define i32 @main() nounwind {
; CHECK-LABEL: @main(
Expand Down Expand Up @@ -50,8 +50,8 @@ bb14: ; preds = %bb11, %bb7
br i1 %t20, label %bb1, label %bb21

bb21: ; preds = %bb14
%t22 = call i32 (i8*, ...) @printf(i8* noalias getelementptr inbounds ([4 x i8], [4 x i8]* @0, i32 0, i32 0), i32 %t18) nounwind
%t22 = call i32 (ptr, ...) @printf(ptr noalias @0, i32 %t18) nounwind
ret i32 0
}

declare i32 @printf(i8* noalias nocapture, ...) nounwind
declare i32 @printf(ptr noalias nocapture, ...) nounwind
20 changes: 10 additions & 10 deletions llvm/test/Transforms/IndVarSimplify/eliminate-rem.ll
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
; CHECK-NOT: rem
; CHECK: ret

define void @simple(i64 %arg, double* %arg3) nounwind {
define void @simple(i64 %arg, ptr %arg3) nounwind {
bb:
%t = icmp slt i64 0, %arg ; <i1> [#uses=1]
br i1 %t, label %bb4, label %bb12
Expand All @@ -18,8 +18,8 @@ bb4: ; preds = %bb
bb5: ; preds = %bb4, %bb5
%t6 = phi i64 [ %t9, %bb5 ], [ 0, %bb4 ] ; <i64> [#uses=2]
%t7 = srem i64 %t6, %arg ; <i64> [#uses=1]
%t8 = getelementptr inbounds double, double* %arg3, i64 %t7 ; <double*> [#uses=1]
store double 0.000000e+00, double* %t8
%t8 = getelementptr inbounds double, ptr %arg3, i64 %t7 ; <ptr> [#uses=1]
store double 0.000000e+00, ptr %t8
%t9 = add nsw i64 %t6, 1 ; <i64> [#uses=2]
%t10 = icmp slt i64 %t9, %arg ; <i1> [#uses=1]
br i1 %t10, label %bb5, label %bb11
Expand All @@ -38,7 +38,7 @@ bb12: ; preds = %bb11, %bb
; CHECK-NOT: {{[us]}}rem
; CHECK: ret

define i32 @f(i64* %arg, i64 %arg1, i64 %arg2, i64 %arg3) nounwind {
define i32 @f(ptr %arg, i64 %arg1, i64 %arg2, i64 %arg3) nounwind {
bb:
%t = icmp sgt i64 %arg1, 0 ; <i1> [#uses=1]
br i1 %t, label %bb4, label %bb54
Expand Down Expand Up @@ -78,16 +78,16 @@ bb21: ; preds = %bb21, %bb20
%t26 = add nsw i64 %t24, %t22 ; <i64> [#uses=1]
%t27 = mul i64 %t11, %arg1 ; <i64> [#uses=1]
%t28 = add nsw i64 %t25, %t22 ; <i64> [#uses=1]
%t29 = getelementptr inbounds i64, i64* %arg, i64 %t26 ; <i64*> [#uses=1]
%t29 = getelementptr inbounds i64, ptr %arg, i64 %t26 ; <ptr> [#uses=1]
%t30 = add nsw i64 %t27, %t22 ; <i64> [#uses=1]
%t31 = getelementptr inbounds i64, i64* %arg, i64 %t28 ; <i64*> [#uses=1]
%t31 = getelementptr inbounds i64, ptr %arg, i64 %t28 ; <ptr> [#uses=1]
%t32 = zext i32 %t23 to i64 ; <i64> [#uses=1]
%t33 = load i64, i64* %t29 ; <i64> [#uses=1]
%t34 = getelementptr inbounds i64, i64* %arg, i64 %t30 ; <i64*> [#uses=1]
%t35 = load i64, i64* %t31 ; <i64> [#uses=1]
%t33 = load i64, ptr %t29 ; <i64> [#uses=1]
%t34 = getelementptr inbounds i64, ptr %arg, i64 %t30 ; <ptr> [#uses=1]
%t35 = load i64, ptr %t31 ; <i64> [#uses=1]
%t36 = add nsw i64 %t32, %t33 ; <i64> [#uses=1]
%t37 = add nsw i64 %t36, %t35 ; <i64> [#uses=1]
%t38 = load i64, i64* %t34 ; <i64> [#uses=1]
%t38 = load i64, ptr %t34 ; <i64> [#uses=1]
%t39 = add nsw i64 %t37, %t38 ; <i64> [#uses=1]
%t40 = trunc i64 %t39 to i32 ; <i32> [#uses=2]
%t41 = add nsw i64 %t22, 1 ; <i64> [#uses=2]
Expand Down
24 changes: 12 additions & 12 deletions llvm/test/Transforms/IndVarSimplify/eliminate-sat.ll
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ declare i32 @llvm.sadd.sat.i32(i32, i32)
declare i32 @llvm.usub.sat.i32(i32, i32)
declare i32 @llvm.ssub.sat.i32(i32, i32)

define void @uadd_sat(i32* %p) {
define void @uadd_sat(ptr %p) {
; CHECK-LABEL: @uadd_sat(
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
; CHECK-NEXT: [[I:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_INC:%.*]], [[LOOP]] ]
; CHECK-NEXT: [[SAT1:%.*]] = add nuw nsw i32 [[I]], 1
; CHECK-NEXT: store volatile i32 [[SAT1]], i32* [[P:%.*]]
; CHECK-NEXT: store volatile i32 [[SAT1]], ptr [[P:%.*]]
; CHECK-NEXT: [[I_INC]] = add nuw nsw i32 [[I]], 1
; CHECK-NEXT: [[CMP:%.*]] = icmp ne i32 [[I_INC]], 100
; CHECK-NEXT: br i1 [[CMP]], label [[LOOP]], label [[END:%.*]]
Expand All @@ -26,7 +26,7 @@ entry:
loop:
%i = phi i32 [ 0, %entry ], [ %i.inc, %loop ]
%sat = call i32 @llvm.uadd.sat.i32(i32 %i, i32 1)
store volatile i32 %sat, i32* %p
store volatile i32 %sat, ptr %p
%i.inc = add nuw nsw i32 %i, 1
%cmp = icmp ne i32 %i.inc, 100
br i1 %cmp, label %loop, label %end
Expand All @@ -35,14 +35,14 @@ end:
ret void
}

define void @sadd_sat(i32* %p) {
define void @sadd_sat(ptr %p) {
; CHECK-LABEL: @sadd_sat(
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
; CHECK-NEXT: [[I:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_INC:%.*]], [[LOOP]] ]
; CHECK-NEXT: [[SAT1:%.*]] = add nuw nsw i32 [[I]], 1
; CHECK-NEXT: store volatile i32 [[SAT1]], i32* [[P:%.*]]
; CHECK-NEXT: store volatile i32 [[SAT1]], ptr [[P:%.*]]
; CHECK-NEXT: [[I_INC]] = add nuw nsw i32 [[I]], 1
; CHECK-NEXT: [[CMP:%.*]] = icmp ne i32 [[I_INC]], 100
; CHECK-NEXT: br i1 [[CMP]], label [[LOOP]], label [[END:%.*]]
Expand All @@ -55,7 +55,7 @@ entry:
loop:
%i = phi i32 [ 0, %entry ], [ %i.inc, %loop ]
%sat = call i32 @llvm.sadd.sat.i32(i32 %i, i32 1)
store volatile i32 %sat, i32* %p
store volatile i32 %sat, ptr %p
%i.inc = add nuw nsw i32 %i, 1
%cmp = icmp ne i32 %i.inc, 100
br i1 %cmp, label %loop, label %end
Expand All @@ -64,14 +64,14 @@ end:
ret void
}

define void @usub_sat(i32* %p) {
define void @usub_sat(ptr %p) {
; CHECK-LABEL: @usub_sat(
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
; CHECK-NEXT: [[I:%.*]] = phi i32 [ 1, [[ENTRY:%.*]] ], [ [[I_INC:%.*]], [[LOOP]] ]
; CHECK-NEXT: [[SAT1:%.*]] = sub nuw nsw i32 [[I]], 1
; CHECK-NEXT: store volatile i32 [[SAT1]], i32* [[P:%.*]]
; CHECK-NEXT: store volatile i32 [[SAT1]], ptr [[P:%.*]]
; CHECK-NEXT: [[I_INC]] = add nuw nsw i32 [[I]], 1
; CHECK-NEXT: [[CMP:%.*]] = icmp ne i32 [[I_INC]], 100
; CHECK-NEXT: br i1 [[CMP]], label [[LOOP]], label [[END:%.*]]
Expand All @@ -84,7 +84,7 @@ entry:
loop:
%i = phi i32 [ 1, %entry ], [ %i.inc, %loop ]
%sat = call i32 @llvm.usub.sat.i32(i32 %i, i32 1)
store volatile i32 %sat, i32* %p
store volatile i32 %sat, ptr %p
%i.inc = add nuw nsw i32 %i, 1
%cmp = icmp ne i32 %i.inc, 100
br i1 %cmp, label %loop, label %end
Expand All @@ -93,14 +93,14 @@ end:
ret void
}

define void @ssub_sat(i32* %p) {
define void @ssub_sat(ptr %p) {
; CHECK-LABEL: @ssub_sat(
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
; CHECK-NEXT: [[I:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_INC:%.*]], [[LOOP]] ]
; CHECK-NEXT: [[SAT1:%.*]] = sub nsw i32 [[I]], 1
; CHECK-NEXT: store volatile i32 [[SAT1]], i32* [[P:%.*]]
; CHECK-NEXT: store volatile i32 [[SAT1]], ptr [[P:%.*]]
; CHECK-NEXT: [[I_INC]] = add nuw nsw i32 [[I]], 1
; CHECK-NEXT: [[CMP:%.*]] = icmp ne i32 [[I_INC]], 100
; CHECK-NEXT: br i1 [[CMP]], label [[LOOP]], label [[END:%.*]]
Expand All @@ -113,7 +113,7 @@ entry:
loop:
%i = phi i32 [ 0, %entry ], [ %i.inc, %loop ]
%sat = call i32 @llvm.ssub.sat.i32(i32 %i, i32 1)
store volatile i32 %sat, i32* %p
store volatile i32 %sat, ptr %p
%i.inc = add nuw nsw i32 %i, 1
%cmp = icmp ne i32 %i.inc, 100
br i1 %cmp, label %loop, label %end
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/Transforms/IndVarSimplify/exit_value_test3.ll
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
; CHECK: [[LABEL:^[a-zA-Z0-9_.]+]]:
; CHECK-NOT: br {{.*}} [[LABEL]]

define i32 @_Z3fooPKcjj(i8* nocapture readnone %s, i32 %len, i32 %c) #0 {
define i32 @_Z3fooPKcjj(ptr nocapture readnone %s, i32 %len, i32 %c) #0 {
entry:
br label %while.cond

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ define void @slt_neg_well_defined_infinite(i16 %n) mustprogress {
; CHECK-NEXT: br label [[FOR_BODY:%.*]]
; CHECK: for.body:
; CHECK-NEXT: [[IV:%.*]] = phi i8 [ [[IV_NEXT:%.*]], [[FOR_BODY]] ], [ 0, [[ENTRY:%.*]] ]
; CHECK-NEXT: store volatile i8 [[IV]], i8* @G, align 1
; CHECK-NEXT: store volatile i8 [[IV]], ptr @G, align 1
; CHECK-NEXT: [[IV_NEXT]] = add i8 [[IV]], 1
; CHECK-NEXT: [[ZEXT:%.*]] = zext i8 [[IV_NEXT]] to i16
; CHECK-NEXT: [[CMP:%.*]] = icmp slt i16 [[ZEXT]], [[N:%.*]]
Expand All @@ -233,7 +233,7 @@ entry:

for.body: ; preds = %entry, %for.body
%iv = phi i8 [ %iv.next, %for.body ], [ 0, %entry ]
store volatile i8 %iv, i8* @G
store volatile i8 %iv, ptr @G
%iv.next = add i8 %iv, 1
%zext = zext i8 %iv.next to i16
%cmp = icmp slt i16 %zext, %n
Expand Down
100 changes: 50 additions & 50 deletions llvm/test/Transforms/IndVarSimplify/floating-point-small-iv.ll

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions llvm/test/Transforms/IndVarSimplify/full_widening.ll
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"

; Make sure that we do not insert trunc in the loop.
define i32 @test_01(double* %p, double %x, i32* %np, i32* %mp, i32 %k) {
define i32 @test_01(ptr %p, double %x, ptr %np, ptr %mp, i32 %k) {
; CHECK-LABEL: @test_01(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[SMAX:%.*]] = call i32 @llvm.smax.i32(i32 [[K:%.*]], i32 1)
Expand All @@ -13,11 +13,11 @@ define i32 @test_01(double* %p, double %x, i32* %np, i32* %mp, i32 %k) {
; CHECK: loop:
; CHECK-NEXT: [[IV_WIDE:%.*]] = phi i64 [ [[CANONICAL_IV_NEXT_I:%.*]], [[LOOP]] ], [ 0, [[ENTRY:%.*]] ]
; CHECK-NEXT: [[CANONICAL_IV_NEXT_I]] = add nuw nsw i64 [[IV_WIDE]], 1
; CHECK-NEXT: [[GEP:%.*]] = getelementptr inbounds double, double* [[P:%.*]], i64 [[IV_WIDE]]
; CHECK-NEXT: [[LOAD:%.*]] = load atomic double, double* [[GEP]] unordered, align 8
; CHECK-NEXT: [[GEP:%.*]] = getelementptr inbounds double, ptr [[P:%.*]], i64 [[IV_WIDE]]
; CHECK-NEXT: [[LOAD:%.*]] = load atomic double, ptr [[GEP]] unordered, align 8
; CHECK-NEXT: [[MUL:%.*]] = fmul double [[X:%.*]], [[LOAD]]
; CHECK-NEXT: [[GEP2:%.*]] = getelementptr inbounds double, double* [[P]], i64 [[IV_WIDE]]
; CHECK-NEXT: store atomic double [[MUL]], double* [[GEP2]] unordered, align 8
; CHECK-NEXT: [[GEP2:%.*]] = getelementptr inbounds double, ptr [[P]], i64 [[IV_WIDE]]
; CHECK-NEXT: store atomic double [[MUL]], ptr [[GEP2]] unordered, align 8
; CHECK-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[CANONICAL_IV_NEXT_I]], [[WIDE_TRIP_COUNT]]
; CHECK-NEXT: br i1 [[EXITCOND]], label [[LOOP]], label [[EXIT:%.*]]
; CHECK: exit:
Expand All @@ -31,11 +31,11 @@ loop:
%iv.narrow = phi i32 [ %iv.narrow.next, %loop ], [ 0, %entry ]
%canonical.iv.next.i = add nuw nsw i64 %iv.wide, 1
%zext = zext i32 %iv.narrow to i64
%gep = getelementptr inbounds double, double* %p, i64 %zext
%load = load atomic double, double* %gep unordered, align 8
%gep = getelementptr inbounds double, ptr %p, i64 %zext
%load = load atomic double, ptr %gep unordered, align 8
%mul = fmul double %x, %load
%gep2 = getelementptr inbounds double, double* %p, i64 %zext
store atomic double %mul, double* %gep2 unordered, align 8
%gep2 = getelementptr inbounds double, ptr %p, i64 %zext
store atomic double %mul, ptr %gep2 unordered, align 8
%iv.narrow.next = add nuw nsw i32 %iv.narrow, 1
%loop.cond = icmp slt i32 %iv.narrow.next, %k
br i1 %loop.cond, label %loop, label %exit
Expand Down
8 changes: 4 additions & 4 deletions llvm/test/Transforms/IndVarSimplify/indirectbr.ll
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
; PR5758
define zeroext i1 @foo() nounwind {
entry:
indirectbr i8* undef, [label %"202", label %"133"]
indirectbr ptr undef, [label %"202", label %"133"]

"132": ; preds = %"133"
%0 = add i32 %1, 1 ; <i32> [#uses=1]
Expand All @@ -24,16 +24,16 @@ entry:
; PR7333
define void @__atomvec_module__put_vrml_bonds() nounwind {
bb7.preheader: ; preds = %entry
indirectbr i8* undef, [label %bb14, label %bb16]
indirectbr ptr undef, [label %bb14, label %bb16]

bb14: ; preds = %bb14, %bb7.preheader
br label %bb16

bb16: ; preds = %bb16, %bb14, %bb7.preheader
%S.31.0 = phi i64 [ %3, %bb16 ], [ 1, %bb7.preheader ], [ 1, %bb14 ] ; <i64> [#uses=2]
%0 = add nsw i64 %S.31.0, -1 ; <i64> [#uses=1]
%1 = getelementptr inbounds [3 x double], [3 x double]* undef, i64 0, i64 %0 ; <double*> [#uses=1]
%2 = load double, double* %1, align 8 ; <double> [#uses=0]
%1 = getelementptr inbounds [3 x double], ptr undef, i64 0, i64 %0 ; <ptr> [#uses=1]
%2 = load double, ptr %1, align 8 ; <double> [#uses=0]
%3 = add nsw i64 %S.31.0, 1 ; <i64> [#uses=1]
br label %bb16
}
52 changes: 26 additions & 26 deletions llvm/test/Transforms/IndVarSimplify/infer-poison-flags.ll
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ define void @add_cr_nsw_nuw() {
; CHECK: loop:
; CHECK-NEXT: [[I:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_NEXT:%.*]], [[LOOP]] ]
; CHECK-NEXT: [[I_NEXT]] = add nuw nsw i32 [[I]], 1
; CHECK-NEXT: store i32 [[I]], i32* @A, align 4
; CHECK-NEXT: store i32 [[I]], ptr @A, align 4
; CHECK-NEXT: [[C:%.*]] = icmp ne i32 [[I_NEXT]], 1000
; CHECK-NEXT: br i1 [[C]], label [[LOOP]], label [[LOOPEXIT:%.*]]
; CHECK: loopexit:
Expand All @@ -22,7 +22,7 @@ entry:
loop:
%i = phi i32 [ 0, %entry ], [ %i.next, %loop ]
%i.next = add i32 %i, 1
store i32 %i, i32* @A
store i32 %i, ptr @A
%c = icmp ne i32 %i.next, 1000
br i1 %c, label %loop, label %loopexit

Expand All @@ -37,7 +37,7 @@ define void @add_cr_nuw() {
; CHECK: loop:
; CHECK-NEXT: [[I:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_NEXT:%.*]], [[LOOP]] ]
; CHECK-NEXT: [[I_NEXT]] = add nuw i32 [[I]], 1
; CHECK-NEXT: store i32 [[I]], i32* @A, align 4
; CHECK-NEXT: store i32 [[I]], ptr @A, align 4
; CHECK-NEXT: [[C:%.*]] = icmp ne i32 [[I_NEXT]], -1
; CHECK-NEXT: br i1 [[C]], label [[LOOP]], label [[LOOPEXIT:%.*]]
; CHECK: loopexit:
Expand All @@ -49,7 +49,7 @@ entry:
loop:
%i = phi i32 [ 0, %entry ], [ %i.next, %loop ]
%i.next = add i32 %i, 1
store i32 %i, i32* @A
store i32 %i, ptr @A
%c = icmp ne i32 %i.next, -1
br i1 %c, label %loop, label %loopexit

Expand All @@ -64,7 +64,7 @@ define void @add_cr_nsw() {
; CHECK: loop:
; CHECK-NEXT: [[I:%.*]] = phi i32 [ -10, [[ENTRY:%.*]] ], [ [[I_NEXT:%.*]], [[LOOP]] ]
; CHECK-NEXT: [[I_NEXT]] = add nsw i32 [[I]], 1
; CHECK-NEXT: store i32 [[I]], i32* @A, align 4
; CHECK-NEXT: store i32 [[I]], ptr @A, align 4
; CHECK-NEXT: [[C:%.*]] = icmp ne i32 [[I_NEXT]], 10
; CHECK-NEXT: br i1 [[C]], label [[LOOP]], label [[LOOPEXIT:%.*]]
; CHECK: loopexit:
Expand All @@ -76,7 +76,7 @@ entry:
loop:
%i = phi i32 [ -10, %entry ], [ %i.next, %loop ]
%i.next = add i32 %i, 1
store i32 %i, i32* @A
store i32 %i, ptr @A
%c = icmp ne i32 %i.next, 10
br i1 %c, label %loop, label %loopexit

Expand All @@ -91,7 +91,7 @@ define void @add_cr_none() {
; CHECK: loop:
; CHECK-NEXT: [[I:%.*]] = phi i32 [ 10, [[ENTRY:%.*]] ], [ [[I_NEXT:%.*]], [[LOOP]] ]
; CHECK-NEXT: [[I_NEXT]] = add i32 [[I]], 1
; CHECK-NEXT: store i32 [[I]], i32* @A, align 4
; CHECK-NEXT: store i32 [[I]], ptr @A, align 4
; CHECK-NEXT: [[C:%.*]] = icmp ne i32 [[I_NEXT]], 0
; CHECK-NEXT: br i1 [[C]], label [[LOOP]], label [[LOOPEXIT:%.*]]
; CHECK: loopexit:
Expand All @@ -103,7 +103,7 @@ entry:
loop:
%i = phi i32 [ 10, %entry ], [ %i.next, %loop ]
%i.next = add i32 %i, 1
store i32 %i, i32* @A
store i32 %i, ptr @A
%c = icmp ne i32 %i.next, 0
br i1 %c, label %loop, label %loopexit

Expand All @@ -118,7 +118,7 @@ define void @add_unknown_none(i32 %n) {
; CHECK: loop:
; CHECK-NEXT: [[I:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_NEXT:%.*]], [[LOOP]] ]
; CHECK-NEXT: [[I_NEXT]] = add i32 [[I]], 1
; CHECK-NEXT: store i32 [[I]], i32* @A, align 4
; CHECK-NEXT: store i32 [[I]], ptr @A, align 4
; CHECK-NEXT: [[C:%.*]] = icmp ne i32 [[I_NEXT]], [[N:%.*]]
; CHECK-NEXT: br i1 [[C]], label [[LOOP]], label [[LOOPEXIT:%.*]]
; CHECK: loopexit:
Expand All @@ -130,7 +130,7 @@ entry:
loop:
%i = phi i32 [ 0, %entry ], [ %i.next, %loop ]
%i.next = add i32 %i, 1
store i32 %i, i32* @A
store i32 %i, ptr @A
%c = icmp ne i32 %i.next, %n
br i1 %c, label %loop, label %loopexit

Expand All @@ -145,7 +145,7 @@ define void @sub_cr_nsw_nuw() {
; CHECK: loop:
; CHECK-NEXT: [[I:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_NEXT:%.*]], [[LOOP]] ]
; CHECK-NEXT: [[I_NEXT]] = sub nsw i32 [[I]], -1
; CHECK-NEXT: store i32 [[I]], i32* @A, align 4
; CHECK-NEXT: store i32 [[I]], ptr @A, align 4
; CHECK-NEXT: [[C:%.*]] = icmp ne i32 [[I_NEXT]], 1000
; CHECK-NEXT: br i1 [[C]], label [[LOOP]], label [[LOOPEXIT:%.*]]
; CHECK: loopexit:
Expand All @@ -157,7 +157,7 @@ entry:
loop:
%i = phi i32 [ 0, %entry ], [ %i.next, %loop ]
%i.next = sub i32 %i, -1
store i32 %i, i32* @A
store i32 %i, ptr @A
%c = icmp ne i32 %i.next, 1000
br i1 %c, label %loop, label %loopexit

Expand All @@ -173,7 +173,7 @@ define void @sub_unknown_none(i32 %n) {
; CHECK: loop:
; CHECK-NEXT: [[I:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_NEXT:%.*]], [[LOOP]] ]
; CHECK-NEXT: [[I_NEXT]] = sub i32 [[I]], -1
; CHECK-NEXT: store i32 [[I]], i32* @A, align 4
; CHECK-NEXT: store i32 [[I]], ptr @A, align 4
; CHECK-NEXT: [[C:%.*]] = icmp ne i32 [[I_NEXT]], [[N:%.*]]
; CHECK-NEXT: br i1 [[C]], label [[LOOP]], label [[LOOPEXIT:%.*]]
; CHECK: loopexit:
Expand All @@ -185,7 +185,7 @@ entry:
loop:
%i = phi i32 [ 0, %entry ], [ %i.next, %loop ]
%i.next = sub i32 %i, -1
store i32 %i, i32* @A
store i32 %i, ptr @A
%c = icmp ne i32 %i.next, %n
br i1 %c, label %loop, label %loopexit

Expand All @@ -206,7 +206,7 @@ define void @mul_cr_nsw_nuw() {
; CHECK: loop:
; CHECK-NEXT: [[I:%.*]] = phi i32 [ 1, [[ENTRY:%.*]] ], [ [[I_NEXT:%.*]], [[LOOP]] ]
; CHECK-NEXT: [[I_NEXT]] = mul i32 [[I]], 2
; CHECK-NEXT: store i32 [[I]], i32* @A, align 4
; CHECK-NEXT: store i32 [[I]], ptr @A, align 4
; CHECK-NEXT: [[C:%.*]] = icmp ne i32 [[I_NEXT]], 1024
; CHECK-NEXT: br i1 [[C]], label [[LOOP]], label [[LOOPEXIT:%.*]]
; CHECK: loopexit:
Expand All @@ -218,7 +218,7 @@ entry:
loop:
%i = phi i32 [ 1, %entry ], [ %i.next, %loop ]
%i.next = mul i32 %i, 2
store i32 %i, i32* @A
store i32 %i, ptr @A
%c = icmp ne i32 %i.next, 1024
br i1 %c, label %loop, label %loopexit

Expand All @@ -234,7 +234,7 @@ define void @shl_cr_nsw_nuw() {
; CHECK: loop:
; CHECK-NEXT: [[I:%.*]] = phi i32 [ 1, [[ENTRY:%.*]] ], [ [[I_NEXT:%.*]], [[LOOP]] ]
; CHECK-NEXT: [[I_NEXT]] = shl i32 [[I]], 1
; CHECK-NEXT: store i32 [[I]], i32* @A, align 4
; CHECK-NEXT: store i32 [[I]], ptr @A, align 4
; CHECK-NEXT: [[C:%.*]] = icmp ne i32 [[I_NEXT]], 1024
; CHECK-NEXT: br i1 [[C]], label [[LOOP]], label [[LOOPEXIT:%.*]]
; CHECK: loopexit:
Expand All @@ -246,7 +246,7 @@ entry:
loop:
%i = phi i32 [ 1, %entry ], [ %i.next, %loop ]
%i.next = shl i32 %i, 1
store i32 %i, i32* @A
store i32 %i, ptr @A
%c = icmp ne i32 %i.next, 1024
br i1 %c, label %loop, label %loopexit

Expand All @@ -262,7 +262,7 @@ define void @lshr_cr_nsw_nuw() {
; CHECK: loop:
; CHECK-NEXT: [[I:%.*]] = phi i32 [ 1024, [[ENTRY:%.*]] ], [ [[I_NEXT:%.*]], [[LOOP]] ]
; CHECK-NEXT: [[I_NEXT]] = lshr i32 [[I]], 1
; CHECK-NEXT: store i32 [[I]], i32* @A, align 4
; CHECK-NEXT: store i32 [[I]], ptr @A, align 4
; CHECK-NEXT: [[C:%.*]] = icmp ne i32 [[I_NEXT]], 0
; CHECK-NEXT: br i1 [[C]], label [[LOOP]], label [[LOOPEXIT:%.*]]
; CHECK: loopexit:
Expand All @@ -274,7 +274,7 @@ entry:
loop:
%i = phi i32 [ 1024, %entry ], [ %i.next, %loop ]
%i.next = lshr i32 %i, 1
store i32 %i, i32* @A
store i32 %i, ptr @A
%c = icmp ne i32 %i.next, 0
br i1 %c, label %loop, label %loopexit

Expand All @@ -290,7 +290,7 @@ define void @lshr_cr_nuw() {
; CHECK: loop:
; CHECK-NEXT: [[I:%.*]] = phi i32 [ -1, [[ENTRY:%.*]] ], [ [[I_NEXT:%.*]], [[LOOP]] ]
; CHECK-NEXT: [[I_NEXT]] = lshr i32 [[I]], 1
; CHECK-NEXT: store i32 [[I]], i32* @A, align 4
; CHECK-NEXT: store i32 [[I]], ptr @A, align 4
; CHECK-NEXT: [[C:%.*]] = icmp ne i32 [[I_NEXT]], 0
; CHECK-NEXT: br i1 [[C]], label [[LOOP]], label [[LOOPEXIT:%.*]]
; CHECK: loopexit:
Expand All @@ -302,7 +302,7 @@ entry:
loop:
%i = phi i32 [ -1, %entry ], [ %i.next, %loop ]
%i.next = lshr i32 %i, 1
store i32 %i, i32* @A
store i32 %i, ptr @A
%c = icmp ne i32 %i.next, 0
br i1 %c, label %loop, label %loopexit

Expand All @@ -318,7 +318,7 @@ define void @ashr_cr_nsw_nuw() {
; CHECK: loop:
; CHECK-NEXT: [[I:%.*]] = phi i32 [ 1024, [[ENTRY:%.*]] ], [ [[I_NEXT:%.*]], [[LOOP]] ]
; CHECK-NEXT: [[I_NEXT]] = ashr i32 [[I]], 1
; CHECK-NEXT: store i32 [[I]], i32* @A, align 4
; CHECK-NEXT: store i32 [[I]], ptr @A, align 4
; CHECK-NEXT: [[C:%.*]] = icmp ne i32 [[I_NEXT]], 0
; CHECK-NEXT: br i1 [[C]], label [[LOOP]], label [[LOOPEXIT:%.*]]
; CHECK: loopexit:
Expand All @@ -330,7 +330,7 @@ entry:
loop:
%i = phi i32 [ 1024, %entry ], [ %i.next, %loop ]
%i.next = ashr i32 %i, 1
store i32 %i, i32* @A
store i32 %i, ptr @A
%c = icmp ne i32 %i.next, 0
br i1 %c, label %loop, label %loopexit

Expand All @@ -346,7 +346,7 @@ define void @ashr_cr_nsw() {
; CHECK: loop:
; CHECK-NEXT: [[I:%.*]] = phi i32 [ -1024, [[ENTRY:%.*]] ], [ [[I_NEXT:%.*]], [[LOOP]] ]
; CHECK-NEXT: [[I_NEXT]] = ashr i32 [[I]], 1
; CHECK-NEXT: store i32 [[I]], i32* @A, align 4
; CHECK-NEXT: store i32 [[I]], ptr @A, align 4
; CHECK-NEXT: [[C:%.*]] = icmp ne i32 [[I_NEXT]], 1
; CHECK-NEXT: br i1 [[C]], label [[LOOP]], label [[LOOPEXIT:%.*]]
; CHECK: loopexit:
Expand All @@ -358,7 +358,7 @@ entry:
loop:
%i = phi i32 [ -1024, %entry ], [ %i.next, %loop ]
%i.next = ashr i32 %i, 1
store i32 %i, i32* @A
store i32 %i, ptr @A
%c = icmp ne i32 %i.next, 1
br i1 %c, label %loop, label %loopexit

Expand Down
18 changes: 9 additions & 9 deletions llvm/test/Transforms/IndVarSimplify/interesting-invoke-use.ll
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
target triple = "i386-pc-linux-gnu"
%struct.string___XUB = type { i32, i32 }
%struct.string___XUP = type { [0 x i8]*, %struct.string___XUB* }
@.str7 = external constant [24 x i8] ; <[24 x i8]*> [#uses=1]
@C.17.316 = external constant %struct.string___XUB ; <%struct.string___XUB*> [#uses=1]
%struct.string___XUP = type { ptr, ptr }
@.str7 = external constant [24 x i8] ; <ptr> [#uses=1]
@C.17.316 = external constant %struct.string___XUB ; <ptr> [#uses=1]

define void @_ada_c35503g() personality i32 (...)* @__gxx_personality_v0 {
define void @_ada_c35503g() personality ptr @__gxx_personality_v0 {
entry:
br label %bb

Expand All @@ -32,11 +32,11 @@ invcont127: ; preds = %bb123
br i1 %2, label %bb178, label %bb128

bb128: ; preds = %invcont127
invoke void @system__img_int__image_integer(%struct.string___XUP* noalias sret(%struct.string___XUP) null, i32 %i.0)
invoke void @system__img_int__image_integer(ptr noalias sret(%struct.string___XUP) null, i32 %i.0)
to label %invcont129 unwind label %lpad266

invcont129: ; preds = %bb128
invoke void @system__string_ops__str_concat(%struct.string___XUP* noalias sret(%struct.string___XUP) null, [0 x i8]* bitcast ([24 x i8]* @.str7 to [0 x i8]*), %struct.string___XUB* @C.17.316, [0 x i8]* null, %struct.string___XUB* null)
invoke void @system__string_ops__str_concat(ptr noalias sret(%struct.string___XUP) null, ptr @.str7, ptr @C.17.316, ptr null, ptr null)
to label %invcont138 unwind label %lpad266

invcont138: ; preds = %invcont129
Expand All @@ -47,15 +47,15 @@ bb178: ; preds = %invcont127
br label %bb123

lpad266: ; preds = %invcont129, %bb128, %bb123
%exn = landingpad {i8*, i32}
%exn = landingpad {ptr, i32}
cleanup
unreachable
}

declare i32 @__gxx_personality_v0(...)

declare void @system__img_int__image_integer(%struct.string___XUP* noalias sret(%struct.string___XUP), i32)
declare void @system__img_int__image_integer(ptr noalias sret(%struct.string___XUP), i32)

declare void @system__string_ops__str_concat(%struct.string___XUP* noalias sret(%struct.string___XUP), [0 x i8]*, %struct.string___XUB*, [0 x i8]*, %struct.string___XUB*)
declare void @system__string_ops__str_concat(ptr noalias sret(%struct.string___XUP), ptr, ptr, ptr, ptr)

declare i32 @report__ident_int(i32)
20 changes: 10 additions & 10 deletions llvm/test/Transforms/IndVarSimplify/iv-fold.ll
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
;
; CHECK-LABEL: @foldIncShr(
; CHECK: shr.1 = lshr i32 %0, 5
define i32 @foldIncShr(i32* %bitmap, i32 %bit_addr, i32 %nbits) nounwind {
define i32 @foldIncShr(ptr %bitmap, i32 %bit_addr, i32 %nbits) nounwind {
entry:
br label %while.body

while.body:
%0 = phi i32 [ 0, %entry ], [ %inc.2, %while.body ]
%shr = lshr i32 %0, 5
%arrayidx = getelementptr inbounds i32, i32* %bitmap, i32 %shr
%tmp6 = load i32, i32* %arrayidx, align 4
%arrayidx = getelementptr inbounds i32, ptr %bitmap, i32 %shr
%tmp6 = load i32, ptr %arrayidx, align 4
%inc.1 = add i32 %0, 1
%shr.1 = lshr i32 %inc.1, 5
%arrayidx.1 = getelementptr inbounds i32, i32* %bitmap, i32 %shr.1
%tmp6.1 = load i32, i32* %arrayidx.1, align 4
%arrayidx.1 = getelementptr inbounds i32, ptr %bitmap, i32 %shr.1
%tmp6.1 = load i32, ptr %arrayidx.1, align 4
%inc.2 = add i32 %inc.1, 1
%exitcond.3 = icmp eq i32 %inc.2, 128
br i1 %exitcond.3, label %while.end, label %while.body
Expand All @@ -33,19 +33,19 @@ while.end:
;
; CHECK-LABEL: @noFoldIncShr(
; CHECK: shr.1 = lshr i32 %inc.1, 5
define i32 @noFoldIncShr(i32* %bitmap, i32 %bit_addr, i32 %nbits) nounwind {
define i32 @noFoldIncShr(ptr %bitmap, i32 %bit_addr, i32 %nbits) nounwind {
entry:
br label %while.body

while.body:
%0 = phi i32 [ 0, %entry ], [ %inc.3, %while.body ]
%shr = lshr i32 %0, 5
%arrayidx = getelementptr inbounds i32, i32* %bitmap, i32 %shr
%tmp6 = load i32, i32* %arrayidx, align 4
%arrayidx = getelementptr inbounds i32, ptr %bitmap, i32 %shr
%tmp6 = load i32, ptr %arrayidx, align 4
%inc.1 = add i32 %0, 1
%shr.1 = lshr i32 %inc.1, 5
%arrayidx.1 = getelementptr inbounds i32, i32* %bitmap, i32 %shr.1
%tmp6.1 = load i32, i32* %arrayidx.1, align 4
%arrayidx.1 = getelementptr inbounds i32, ptr %bitmap, i32 %shr.1
%tmp6.1 = load i32, ptr %arrayidx.1, align 4
%inc.3 = add i32 %inc.1, 2
%exitcond.3 = icmp eq i32 %inc.3, 96
br i1 %exitcond.3, label %while.end, label %while.body
Expand Down
32 changes: 16 additions & 16 deletions llvm/test/Transforms/IndVarSimplify/iv-sext.ll
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n32:64"

define void @t(float* %pTmp1, float* %peakWeight, float* %nrgReducePeakrate, i32 %bandEdgeIndex, float %tmp1) nounwind {
define void @t(ptr %pTmp1, ptr %peakWeight, ptr %nrgReducePeakrate, i32 %bandEdgeIndex, float %tmp1) nounwind {
entry:
%tmp = load float, float* %peakWeight, align 4 ; <float> [#uses=1]
%tmp = load float, ptr %peakWeight, align 4 ; <float> [#uses=1]
%tmp2 = icmp sgt i32 %bandEdgeIndex, 0 ; <i1> [#uses=1]
br i1 %tmp2, label %bb.nph22, label %return

Expand All @@ -33,13 +33,13 @@ bb: ; preds = %bb8, %bb.nph22
bb1: ; preds = %bb
%tmp5 = add i32 %part.016, -1 ; <i32> [#uses=1]
%tmp6 = sext i32 %tmp5 to i64 ; <i64> [#uses=1]
%tmp7 = getelementptr float, float* %pTmp1, i64 %tmp6 ; <float*> [#uses=1]
%tmp8 = load float, float* %tmp7, align 4 ; <float> [#uses=1]
%tmp7 = getelementptr float, ptr %pTmp1, i64 %tmp6 ; <ptr> [#uses=1]
%tmp8 = load float, ptr %tmp7, align 4 ; <float> [#uses=1]
%tmp9 = fadd float %tmp8, %distERBlo.120 ; <float> [#uses=1]
%tmp10 = add i32 %part.016, -1 ; <i32> [#uses=1]
%tmp11 = sext i32 %tmp10 to i64 ; <i64> [#uses=1]
%tmp12 = getelementptr float, float* %pTmp1, i64 %tmp11 ; <float*> [#uses=1]
%tmp13 = load float, float* %tmp12, align 4 ; <float> [#uses=1]
%tmp12 = getelementptr float, ptr %pTmp1, i64 %tmp11 ; <ptr> [#uses=1]
%tmp13 = load float, ptr %tmp12, align 4 ; <float> [#uses=1]
%tmp14 = fsub float %distERBhi.121, %tmp13 ; <float> [#uses=1]
br label %bb3.preheader

Expand All @@ -57,12 +57,12 @@ bb2: ; preds = %bb3, %bb.nph
%loPart.02 = phi i32 [ %tmp24, %bb3 ], [ %loPart.118, %bb.nph ] ; <i32> [#uses=3]
%peakCount.01 = phi float [ %tmp23, %bb3 ], [ %peakCount.117, %bb.nph ] ; <float> [#uses=1]
%tmp16 = sext i32 %loPart.02 to i64 ; <i64> [#uses=1]
%tmp17 = getelementptr float, float* %pTmp1, i64 %tmp16 ; <float*> [#uses=1]
%tmp18 = load float, float* %tmp17, align 4 ; <float> [#uses=1]
%tmp17 = getelementptr float, ptr %pTmp1, i64 %tmp16 ; <ptr> [#uses=1]
%tmp18 = load float, ptr %tmp17, align 4 ; <float> [#uses=1]
%tmp19 = fsub float %distERBlo.03, %tmp18 ; <float> [#uses=3]
%tmp20 = sext i32 %loPart.02 to i64 ; <i64> [#uses=1]
%tmp21 = getelementptr float, float* %peakWeight, i64 %tmp20 ; <float*> [#uses=1]
%tmp22 = load float, float* %tmp21, align 4 ; <float> [#uses=1]
%tmp21 = getelementptr float, ptr %peakWeight, i64 %tmp20 ; <ptr> [#uses=1]
%tmp22 = load float, ptr %tmp21, align 4 ; <float> [#uses=1]
%tmp23 = fsub float %peakCount.01, %tmp22 ; <float> [#uses=2]
%tmp24 = add i32 %loPart.02, 1 ; <i32> [#uses=2]
br label %bb3
Expand Down Expand Up @@ -97,13 +97,13 @@ bb4: ; preds = %bb5, %bb.nph12
%hiPart.08 = phi i32 [ %tmp31, %bb5 ], [ %hiPart.119, %bb.nph12 ] ; <i32> [#uses=2]
%peakCount.27 = phi float [ %tmp35, %bb5 ], [ %peakCount.0.lcssa, %bb.nph12 ] ; <float> [#uses=1]
%tmp27 = sext i32 %hiPart.08 to i64 ; <i64> [#uses=1]
%tmp28 = getelementptr float, float* %pTmp1, i64 %tmp27 ; <float*> [#uses=1]
%tmp29 = load float, float* %tmp28, align 4 ; <float> [#uses=1]
%tmp28 = getelementptr float, ptr %pTmp1, i64 %tmp27 ; <ptr> [#uses=1]
%tmp29 = load float, ptr %tmp28, align 4 ; <float> [#uses=1]
%tmp30 = fadd float %tmp29, %distERBhi.29 ; <float> [#uses=3]
%tmp31 = add i32 %hiPart.08, 1 ; <i32> [#uses=4]
%tmp32 = sext i32 %tmp31 to i64 ; <i64> [#uses=1]
%tmp33 = getelementptr float, float* %peakWeight, i64 %tmp32 ; <float*> [#uses=1]
%tmp34 = load float, float* %tmp33, align 4 ; <float> [#uses=1]
%tmp33 = getelementptr float, ptr %peakWeight, i64 %tmp32 ; <ptr> [#uses=1]
%tmp34 = load float, ptr %tmp33, align 4 ; <float> [#uses=1]
%tmp35 = fadd float %tmp34, %peakCount.27 ; <float> [#uses=2]
br label %bb5

Expand Down Expand Up @@ -132,8 +132,8 @@ bb7: ; preds = %bb5.bb7_crit_edge, %bb5.preheader
%tmp42 = fadd float %tmp41, 1.000000e+00 ; <float> [#uses=1]
%tmp43 = fdiv float 1.000000e+00, %tmp42 ; <float> [#uses=1]
%tmp44 = sext i32 %part.016 to i64 ; <i64> [#uses=1]
%tmp45 = getelementptr float, float* %nrgReducePeakrate, i64 %tmp44 ; <float*> [#uses=1]
store float %tmp43, float* %tmp45, align 4
%tmp45 = getelementptr float, ptr %nrgReducePeakrate, i64 %tmp44 ; <ptr> [#uses=1]
store float %tmp43, ptr %tmp45, align 4
%tmp46 = add i32 %part.016, 1 ; <i32> [#uses=2]
br label %bb8

Expand Down
20 changes: 10 additions & 10 deletions llvm/test/Transforms/IndVarSimplify/iv-zext.ll
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@

target datalayout = "p:64:64:64-n32:64"

define void @foo(double* %d, i64 %n) nounwind {
define void @foo(ptr %d, i64 %n) nounwind {
entry:
br label %loop

loop:
%indvar = phi i64 [ 0, %entry ], [ %indvar.next, %loop ]
%indvar.i8 = and i64 %indvar, 255
%t0 = getelementptr double, double* %d, i64 %indvar.i8
%t1 = load double, double* %t0
%t0 = getelementptr double, ptr %d, i64 %indvar.i8
%t1 = load double, ptr %t0
%t2 = fmul double %t1, 0.1
store double %t2, double* %t0
store double %t2, ptr %t0
%indvar.i24 = and i64 %indvar, 16777215
%t3 = getelementptr double, double* %d, i64 %indvar.i24
%t4 = load double, double* %t3
%t3 = getelementptr double, ptr %d, i64 %indvar.i24
%t4 = load double, ptr %t3
%t5 = fmul double %t4, 2.3
store double %t5, double* %t3
%t6 = getelementptr double, double* %d, i64 %indvar
%t7 = load double, double* %t6
store double %t5, ptr %t3
%t6 = getelementptr double, ptr %d, i64 %indvar
%t7 = load double, ptr %t6
%t8 = fmul double %t7, 4.5
store double %t8, double* %t6
store double %t8, ptr %t6
%indvar.next = add i64 %indvar, 1
%exitcond = icmp eq i64 %indvar.next, 10
br i1 %exitcond, label %return, label %loop
Expand Down
68 changes: 34 additions & 34 deletions llvm/test/Transforms/IndVarSimplify/lftr-dead-ivs.ll
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ define void @neg_dynamically_dead_inbounds(i1 %always_false) #0 {
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
; CHECK-NEXT: [[I_0:%.*]] = phi i8 [ 0, [[ENTRY:%.*]] ], [ [[TMP4:%.*]], [[CONT:%.*]] ]
; CHECK-NEXT: [[P_0:%.*]] = phi i8* [ getelementptr inbounds ([240 x i8], [240 x i8]* @data, i64 0, i64 0), [[ENTRY]] ], [ [[TMP3:%.*]], [[CONT]] ]
; CHECK-NEXT: [[TMP3]] = getelementptr inbounds i8, i8* [[P_0]], i64 1
; CHECK-NEXT: [[P_0:%.*]] = phi ptr [ @data, [[ENTRY]] ], [ [[TMP3:%.*]], [[CONT]] ]
; CHECK-NEXT: [[TMP3]] = getelementptr inbounds i8, ptr [[P_0]], i64 1
; CHECK-NEXT: br i1 [[ALWAYS_FALSE:%.*]], label [[NEVER_EXECUTED:%.*]], label [[CONT]]
; CHECK: never_executed:
; CHECK-NEXT: store volatile i8 0, i8* [[TMP3]], align 1
; CHECK-NEXT: store volatile i8 0, ptr [[TMP3]], align 1
; CHECK-NEXT: br label [[CONT]]
; CHECK: cont:
; CHECK-NEXT: [[TMP4]] = add nuw i8 [[I_0]], 1
Expand All @@ -44,12 +44,12 @@ entry:

loop:
%i.0 = phi i8 [ 0, %entry ], [ %tmp4, %cont ]
%p.0 = phi i8* [ getelementptr inbounds ([240 x i8], [240 x i8]* @data, i64 0, i64 0), %entry ], [ %tmp3, %cont ]
%tmp3 = getelementptr inbounds i8, i8* %p.0, i64 1
%p.0 = phi ptr [ @data, %entry ], [ %tmp3, %cont ]
%tmp3 = getelementptr inbounds i8, ptr %p.0, i64 1
br i1 %always_false, label %never_executed, label %cont

never_executed:
store volatile i8 0, i8* %tmp3
store volatile i8 0, ptr %tmp3
br label %cont

cont:
Expand All @@ -63,17 +63,17 @@ exit:

; Similiar to above, but shows how we currently guard non-constant
; memory operands in a manner which hides the latent miscompile.
define void @neg_dynamically_dead_inbounds2(i8* %a, i1 %always_false) #0 {
define void @neg_dynamically_dead_inbounds2(ptr %a, i1 %always_false) #0 {
; CHECK-LABEL: @neg_dynamically_dead_inbounds2(
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
; CHECK-NEXT: [[I_0:%.*]] = phi i8 [ 0, [[ENTRY:%.*]] ], [ [[TMP4:%.*]], [[CONT:%.*]] ]
; CHECK-NEXT: [[P_0:%.*]] = phi i8* [ [[A:%.*]], [[ENTRY]] ], [ [[TMP3:%.*]], [[CONT]] ]
; CHECK-NEXT: [[TMP3]] = getelementptr inbounds i8, i8* [[P_0]], i64 1
; CHECK-NEXT: [[P_0:%.*]] = phi ptr [ [[A:%.*]], [[ENTRY]] ], [ [[TMP3:%.*]], [[CONT]] ]
; CHECK-NEXT: [[TMP3]] = getelementptr inbounds i8, ptr [[P_0]], i64 1
; CHECK-NEXT: br i1 [[ALWAYS_FALSE:%.*]], label [[NEVER_EXECUTED:%.*]], label [[CONT]]
; CHECK: never_executed:
; CHECK-NEXT: store volatile i8 0, i8* [[TMP3]], align 1
; CHECK-NEXT: store volatile i8 0, ptr [[TMP3]], align 1
; CHECK-NEXT: br label [[CONT]]
; CHECK: cont:
; CHECK-NEXT: [[TMP4]] = add nuw i8 [[I_0]], 1
Expand All @@ -87,12 +87,12 @@ entry:

loop:
%i.0 = phi i8 [ 0, %entry ], [ %tmp4, %cont ]
%p.0 = phi i8* [ %a, %entry ], [ %tmp3, %cont ]
%tmp3 = getelementptr inbounds i8, i8* %p.0, i64 1
%p.0 = phi ptr [ %a, %entry ], [ %tmp3, %cont ]
%tmp3 = getelementptr inbounds i8, ptr %p.0, i64 1
br i1 %always_false, label %never_executed, label %cont

never_executed:
store volatile i8 0, i8* %tmp3
store volatile i8 0, ptr %tmp3
br label %cont

cont:
Expand All @@ -109,10 +109,10 @@ define void @dom_store_preinc() #0 {
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
; CHECK-NEXT: [[P_0:%.*]] = phi i8* [ getelementptr inbounds ([240 x i8], [240 x i8]* @data, i64 0, i64 0), [[ENTRY:%.*]] ], [ [[TMP3:%.*]], [[LOOP]] ]
; CHECK-NEXT: store volatile i8 0, i8* [[P_0]], align 1
; CHECK-NEXT: [[TMP3]] = getelementptr inbounds i8, i8* [[P_0]], i64 1
; CHECK-NEXT: [[EXITCOND:%.*]] = icmp ne i8* [[P_0]], getelementptr ([240 x i8], [240 x i8]* @data, i64 1, i64 5)
; CHECK-NEXT: [[P_0:%.*]] = phi ptr [ @data, [[ENTRY:%.*]] ], [ [[TMP3:%.*]], [[LOOP]] ]
; CHECK-NEXT: store volatile i8 0, ptr [[P_0]], align 1
; CHECK-NEXT: [[TMP3]] = getelementptr inbounds i8, ptr [[P_0]], i64 1
; CHECK-NEXT: [[EXITCOND:%.*]] = icmp ne ptr [[P_0]], getelementptr (i8, ptr @data, i64 245)
; CHECK-NEXT: br i1 [[EXITCOND]], label [[LOOP]], label [[EXIT:%.*]]
; CHECK: exit:
; CHECK-NEXT: ret void
Expand All @@ -122,9 +122,9 @@ entry:

loop:
%i.0 = phi i8 [ 0, %entry ], [ %tmp4, %loop ]
%p.0 = phi i8* [ getelementptr inbounds ([240 x i8], [240 x i8]* @data, i64 0, i64 0), %entry ], [ %tmp3, %loop ]
store volatile i8 0, i8* %p.0
%tmp3 = getelementptr inbounds i8, i8* %p.0, i64 1
%p.0 = phi ptr [ @data, %entry ], [ %tmp3, %loop ]
store volatile i8 0, ptr %p.0
%tmp3 = getelementptr inbounds i8, ptr %p.0, i64 1
%tmp4 = add i8 %i.0, 1
%tmp5 = icmp ult i8 %tmp4, -10
br i1 %tmp5, label %loop, label %exit
Expand All @@ -138,10 +138,10 @@ define void @dom_store_postinc() #0 {
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
; CHECK-NEXT: [[P_0:%.*]] = phi i8* [ getelementptr inbounds ([240 x i8], [240 x i8]* @data, i64 0, i64 0), [[ENTRY:%.*]] ], [ [[TMP3:%.*]], [[LOOP]] ]
; CHECK-NEXT: [[TMP3]] = getelementptr inbounds i8, i8* [[P_0]], i64 1
; CHECK-NEXT: store volatile i8 0, i8* [[TMP3]], align 1
; CHECK-NEXT: [[EXITCOND:%.*]] = icmp ne i8* [[TMP3]], getelementptr ([240 x i8], [240 x i8]* @data, i64 1, i64 6)
; CHECK-NEXT: [[P_0:%.*]] = phi ptr [ @data, [[ENTRY:%.*]] ], [ [[TMP3:%.*]], [[LOOP]] ]
; CHECK-NEXT: [[TMP3]] = getelementptr inbounds i8, ptr [[P_0]], i64 1
; CHECK-NEXT: store volatile i8 0, ptr [[TMP3]], align 1
; CHECK-NEXT: [[EXITCOND:%.*]] = icmp ne ptr [[TMP3]], getelementptr (i8, ptr @data, i64 246)
; CHECK-NEXT: br i1 [[EXITCOND]], label [[LOOP]], label [[EXIT:%.*]]
; CHECK: exit:
; CHECK-NEXT: ret void
Expand All @@ -151,9 +151,9 @@ entry:

loop:
%i.0 = phi i8 [ 0, %entry ], [ %tmp4, %loop ]
%p.0 = phi i8* [ getelementptr inbounds ([240 x i8], [240 x i8]* @data, i64 0, i64 0), %entry ], [ %tmp3, %loop ]
%tmp3 = getelementptr inbounds i8, i8* %p.0, i64 1
store volatile i8 0, i8* %tmp3
%p.0 = phi ptr [ @data, %entry ], [ %tmp3, %loop ]
%tmp3 = getelementptr inbounds i8, ptr %p.0, i64 1
store volatile i8 0, ptr %tmp3
%tmp4 = add i8 %i.0, 1
%tmp5 = icmp ult i8 %tmp4, -10
br i1 %tmp5, label %loop, label %exit
Expand All @@ -167,10 +167,10 @@ define i8 @dom_load() #0 {
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
; CHECK-NEXT: [[P_0:%.*]] = phi i8* [ getelementptr inbounds ([240 x i8], [240 x i8]* @data, i64 0, i64 0), [[ENTRY:%.*]] ], [ [[TMP3:%.*]], [[LOOP]] ]
; CHECK-NEXT: [[TMP3]] = getelementptr inbounds i8, i8* [[P_0]], i64 1
; CHECK-NEXT: [[V:%.*]] = load i8, i8* [[TMP3]], align 1
; CHECK-NEXT: [[EXITCOND:%.*]] = icmp ne i8* [[TMP3]], getelementptr ([240 x i8], [240 x i8]* @data, i64 1, i64 6)
; CHECK-NEXT: [[P_0:%.*]] = phi ptr [ @data, [[ENTRY:%.*]] ], [ [[TMP3:%.*]], [[LOOP]] ]
; CHECK-NEXT: [[TMP3]] = getelementptr inbounds i8, ptr [[P_0]], i64 1
; CHECK-NEXT: [[V:%.*]] = load i8, ptr [[TMP3]], align 1
; CHECK-NEXT: [[EXITCOND:%.*]] = icmp ne ptr [[TMP3]], getelementptr (i8, ptr @data, i64 246)
; CHECK-NEXT: br i1 [[EXITCOND]], label [[LOOP]], label [[EXIT:%.*]]
; CHECK: exit:
; CHECK-NEXT: [[V_LCSSA:%.*]] = phi i8 [ [[V]], [[LOOP]] ]
Expand All @@ -181,9 +181,9 @@ entry:

loop:
%i.0 = phi i8 [ 0, %entry ], [ %tmp4, %loop ]
%p.0 = phi i8* [ getelementptr inbounds ([240 x i8], [240 x i8]* @data, i64 0, i64 0), %entry ], [ %tmp3, %loop ]
%tmp3 = getelementptr inbounds i8, i8* %p.0, i64 1
%v = load i8, i8* %tmp3
%p.0 = phi ptr [ @data, %entry ], [ %tmp3, %loop ]
%tmp3 = getelementptr inbounds i8, ptr %p.0, i64 1
%v = load i8, ptr %tmp3
%tmp4 = add i8 %i.0, 1
%tmp5 = icmp ult i8 %tmp4, -10
br i1 %tmp5, label %loop, label %exit
Expand Down
72 changes: 36 additions & 36 deletions llvm/test/Transforms/IndVarSimplify/lftr-multi-exit.ll
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ define void @analyzeable_early_exit(i32 %n) {
; CHECK-NEXT: br i1 [[EXITCOND]], label [[LATCH]], label [[EXIT:%.*]]
; CHECK: latch:
; CHECK-NEXT: [[IV_NEXT]] = add nuw nsw i32 [[IV]], 1
; CHECK-NEXT: store i32 [[IV]], i32* @A, align 4
; CHECK-NEXT: store i32 [[IV]], ptr @A, align 4
; CHECK-NEXT: [[EXITCOND1:%.*]] = icmp ne i32 [[IV_NEXT]], 1000
; CHECK-NEXT: br i1 [[EXITCOND1]], label [[LOOP]], label [[EXIT]]
; CHECK: exit:
Expand All @@ -35,7 +35,7 @@ loop:

latch:
%iv.next = add i32 %iv, 1
store i32 %iv, i32* @A
store i32 %iv, ptr @A
%c = icmp ult i32 %iv.next, 1000
br i1 %c, label %loop, label %exit

Expand All @@ -49,12 +49,12 @@ define void @unanalyzeable_early_exit() {
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
; CHECK-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[LATCH:%.*]] ]
; CHECK-NEXT: [[VOL:%.*]] = load volatile i32, i32* @A, align 4
; CHECK-NEXT: [[VOL:%.*]] = load volatile i32, ptr @A, align 4
; CHECK-NEXT: [[EARLYCND:%.*]] = icmp ne i32 [[VOL]], 0
; CHECK-NEXT: br i1 [[EARLYCND]], label [[LATCH]], label [[EXIT:%.*]]
; CHECK: latch:
; CHECK-NEXT: [[IV_NEXT]] = add nuw nsw i32 [[IV]], 1
; CHECK-NEXT: store i32 [[IV]], i32* @A, align 4
; CHECK-NEXT: store i32 [[IV]], ptr @A, align 4
; CHECK-NEXT: [[EXITCOND:%.*]] = icmp ne i32 [[IV_NEXT]], 1000
; CHECK-NEXT: br i1 [[EXITCOND]], label [[LOOP]], label [[EXIT]]
; CHECK: exit:
Expand All @@ -65,13 +65,13 @@ entry:

loop:
%iv = phi i32 [ 0, %entry], [ %iv.next, %latch]
%vol = load volatile i32, i32* @A
%vol = load volatile i32, ptr @A
%earlycnd = icmp ne i32 %vol, 0
br i1 %earlycnd, label %latch, label %exit

latch:
%iv.next = add i32 %iv, 1
store i32 %iv, i32* @A
store i32 %iv, ptr @A
%c = icmp ult i32 %iv.next, 1000
br i1 %c, label %loop, label %exit

Expand All @@ -89,12 +89,12 @@ define void @multiple_early_exits(i32 %n, i32 %m) {
; CHECK-NEXT: [[EXITCOND:%.*]] = icmp ne i32 [[IV]], [[N:%.*]]
; CHECK-NEXT: br i1 [[EXITCOND]], label [[CONTINUE:%.*]], label [[EXIT:%.*]]
; CHECK: continue:
; CHECK-NEXT: store volatile i32 [[IV]], i32* @A, align 4
; CHECK-NEXT: store volatile i32 [[IV]], ptr @A, align 4
; CHECK-NEXT: [[EXITCOND1:%.*]] = icmp ne i32 [[IV]], [[M:%.*]]
; CHECK-NEXT: br i1 [[EXITCOND1]], label [[LATCH]], label [[EXIT]]
; CHECK: latch:
; CHECK-NEXT: [[IV_NEXT]] = add nuw nsw i32 [[IV]], 1
; CHECK-NEXT: store volatile i32 [[IV]], i32* @A, align 4
; CHECK-NEXT: store volatile i32 [[IV]], ptr @A, align 4
; CHECK-NEXT: [[EXITCOND2:%.*]] = icmp ne i32 [[IV_NEXT]], 1000
; CHECK-NEXT: br i1 [[EXITCOND2]], label [[LOOP]], label [[EXIT]]
; CHECK: exit:
Expand All @@ -109,13 +109,13 @@ loop:
br i1 %earlycnd, label %continue, label %exit

continue:
store volatile i32 %iv, i32* @A
store volatile i32 %iv, ptr @A
%earlycnd2 = icmp ult i32 %iv, %m
br i1 %earlycnd2, label %latch, label %exit

latch:
%iv.next = add i32 %iv, 1
store volatile i32 %iv, i32* @A
store volatile i32 %iv, ptr @A
%c = icmp ult i32 %iv.next, 1000
br i1 %c, label %loop, label %exit

Expand All @@ -136,7 +136,7 @@ define void @compound_early_exit(i32 %n, i32 %m) {
; CHECK-NEXT: br i1 [[EXITCOND]], label [[LATCH]], label [[EXIT:%.*]]
; CHECK: latch:
; CHECK-NEXT: [[IV_NEXT]] = add nuw nsw i32 [[IV]], 1
; CHECK-NEXT: store volatile i32 [[IV]], i32* @A, align 4
; CHECK-NEXT: store volatile i32 [[IV]], ptr @A, align 4
; CHECK-NEXT: [[EXITCOND1:%.*]] = icmp ne i32 [[IV_NEXT]], 1000
; CHECK-NEXT: br i1 [[EXITCOND1]], label [[LOOP]], label [[EXIT]]
; CHECK: exit:
Expand All @@ -154,7 +154,7 @@ loop:

latch:
%iv.next = add i32 %iv, 1
store volatile i32 %iv, i32* @A
store volatile i32 %iv, ptr @A
%c = icmp ult i32 %iv.next, 1000
br i1 %c, label %loop, label %exit

Expand All @@ -173,8 +173,8 @@ define void @unanalyzeable_latch(i32 %n) {
; CHECK-NEXT: br i1 [[EXITCOND]], label [[LATCH]], label [[EXIT:%.*]]
; CHECK: latch:
; CHECK-NEXT: [[IV_NEXT]] = add i32 [[IV]], 1
; CHECK-NEXT: store i32 [[IV]], i32* @A, align 4
; CHECK-NEXT: [[VOL:%.*]] = load volatile i32, i32* @A, align 4
; CHECK-NEXT: store i32 [[IV]], ptr @A, align 4
; CHECK-NEXT: [[VOL:%.*]] = load volatile i32, ptr @A, align 4
; CHECK-NEXT: [[C:%.*]] = icmp ult i32 [[VOL]], 1000
; CHECK-NEXT: br i1 [[C]], label [[LOOP]], label [[EXIT]]
; CHECK: exit:
Expand All @@ -190,8 +190,8 @@ loop:

latch:
%iv.next = add i32 %iv, 1
store i32 %iv, i32* @A
%vol = load volatile i32, i32* @A
store i32 %iv, ptr @A
%vol = load volatile i32, ptr @A
%c = icmp ult i32 %vol, 1000
br i1 %c, label %loop, label %exit

Expand All @@ -209,7 +209,7 @@ define void @single_exit_no_latch(i32 %n) {
; CHECK-NEXT: br i1 [[EXITCOND]], label [[LATCH]], label [[EXIT:%.*]]
; CHECK: latch:
; CHECK-NEXT: [[IV_NEXT]] = add i32 [[IV]], 1
; CHECK-NEXT: store i32 [[IV]], i32* @A, align 4
; CHECK-NEXT: store i32 [[IV]], ptr @A, align 4
; CHECK-NEXT: br label [[LOOP]]
; CHECK: exit:
; CHECK-NEXT: ret void
Expand All @@ -224,7 +224,7 @@ loop:

latch:
%iv.next = add i32 %iv, 1
store i32 %iv, i32* @A
store i32 %iv, ptr @A
br label %loop

exit:
Expand All @@ -242,11 +242,11 @@ define void @no_latch_exit(i32 %n, i32 %m) {
; CHECK-NEXT: [[EXITCOND:%.*]] = icmp ne i32 [[IV]], [[N:%.*]]
; CHECK-NEXT: br i1 [[EXITCOND]], label [[CONTINUE:%.*]], label [[EXIT:%.*]]
; CHECK: continue:
; CHECK-NEXT: store volatile i32 [[IV]], i32* @A, align 4
; CHECK-NEXT: store volatile i32 [[IV]], ptr @A, align 4
; CHECK-NEXT: [[EXITCOND1:%.*]] = icmp ne i32 [[IV]], [[M:%.*]]
; CHECK-NEXT: br i1 [[EXITCOND1]], label [[LATCH]], label [[EXIT]]
; CHECK: latch:
; CHECK-NEXT: store volatile i32 [[IV]], i32* @A, align 4
; CHECK-NEXT: store volatile i32 [[IV]], ptr @A, align 4
; CHECK-NEXT: [[IV_NEXT]] = add i32 [[IV]], 1
; CHECK-NEXT: br label [[LOOP]]
; CHECK: exit:
Expand All @@ -261,12 +261,12 @@ loop:
br i1 %earlycnd, label %continue, label %exit

continue:
store volatile i32 %iv, i32* @A
store volatile i32 %iv, ptr @A
%earlycnd2 = icmp ult i32 %iv, %m
br i1 %earlycnd2, label %latch, label %exit

latch:
store volatile i32 %iv, i32* @A
store volatile i32 %iv, ptr @A
%iv.next = add i32 %iv, 1
br label %loop

Expand All @@ -286,7 +286,7 @@ define void @combine_ivs(i32 %n) {
; CHECK-NEXT: br i1 [[EXITCOND]], label [[LATCH]], label [[EXIT:%.*]]
; CHECK: latch:
; CHECK-NEXT: [[IV_NEXT]] = add nuw nsw i32 [[IV]], 1
; CHECK-NEXT: store volatile i32 [[IV]], i32* @A, align 4
; CHECK-NEXT: store volatile i32 [[IV]], ptr @A, align 4
; CHECK-NEXT: [[EXITCOND1:%.*]] = icmp ne i32 [[IV_NEXT]], 999
; CHECK-NEXT: br i1 [[EXITCOND1]], label [[LOOP]], label [[EXIT]]
; CHECK: exit:
Expand All @@ -304,7 +304,7 @@ loop:
latch:
%iv.next = add i32 %iv, 1
%iv2.next = add i32 %iv2, 1
store volatile i32 %iv, i32* @A
store volatile i32 %iv, ptr @A
%c = icmp ult i32 %iv2.next, 1000
br i1 %c, label %loop, label %exit

Expand All @@ -323,7 +323,7 @@ define void @combine_ivs2(i32 %n) {
; CHECK-NEXT: br i1 [[EXITCOND]], label [[LATCH]], label [[EXIT:%.*]]
; CHECK: latch:
; CHECK-NEXT: [[IV_NEXT]] = add nuw nsw i32 [[IV]], 1
; CHECK-NEXT: store volatile i32 [[IV]], i32* @A, align 4
; CHECK-NEXT: store volatile i32 [[IV]], ptr @A, align 4
; CHECK-NEXT: [[EXITCOND1:%.*]] = icmp ne i32 [[IV_NEXT]], 1000
; CHECK-NEXT: br i1 [[EXITCOND1]], label [[LOOP]], label [[EXIT]]
; CHECK: exit:
Expand All @@ -341,7 +341,7 @@ loop:
latch:
%iv.next = add i32 %iv, 1
%iv2.next = sub i32 %iv2, 1
store volatile i32 %iv, i32* @A
store volatile i32 %iv, ptr @A
%c = icmp ugt i32 %iv2.next, 0
br i1 %c, label %loop, label %exit

Expand All @@ -361,7 +361,7 @@ define void @simplify_exit_test(i32 %n) {
; CHECK-NEXT: br i1 [[EXITCOND]], label [[LATCH]], label [[EXIT:%.*]]
; CHECK: latch:
; CHECK-NEXT: [[IV_NEXT]] = add nuw nsw i32 [[IV]], 1
; CHECK-NEXT: store volatile i32 [[IV]], i32* @A, align 4
; CHECK-NEXT: store volatile i32 [[IV]], ptr @A, align 4
; CHECK-NEXT: [[EXITCOND1:%.*]] = icmp ne i32 [[IV_NEXT]], 65
; CHECK-NEXT: br i1 [[EXITCOND1]], label [[LOOP]], label [[EXIT]]
; CHECK: exit:
Expand All @@ -378,7 +378,7 @@ loop:
latch:
%iv.next = add i32 %iv, 1
%fx = shl i32 %iv, 4
store volatile i32 %iv, i32* @A
store volatile i32 %iv, ptr @A
%c = icmp ult i32 %fx, 1024
br i1 %c, label %loop, label %exit

Expand All @@ -395,13 +395,13 @@ define void @simplify_exit_test2(i32 %n) {
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
; CHECK-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[LATCH:%.*]] ]
; CHECK-NEXT: [[VOL:%.*]] = load volatile i32, i32* @A, align 4
; CHECK-NEXT: [[VOL:%.*]] = load volatile i32, ptr @A, align 4
; CHECK-NEXT: [[EARLYCND:%.*]] = icmp ne i32 [[VOL]], 0
; CHECK-NEXT: br i1 [[EARLYCND]], label [[LATCH]], label [[EXIT:%.*]]
; CHECK: latch:
; CHECK-NEXT: [[IV_NEXT]] = add i32 [[IV]], 1
; CHECK-NEXT: [[FX:%.*]] = udiv i32 [[IV]], 4
; CHECK-NEXT: store volatile i32 [[IV]], i32* @A, align 4
; CHECK-NEXT: store volatile i32 [[IV]], ptr @A, align 4
; CHECK-NEXT: [[C:%.*]] = icmp ult i32 [[FX]], 1024
; CHECK-NEXT: br i1 [[C]], label [[LOOP]], label [[EXIT]]
; CHECK: exit:
Expand All @@ -412,14 +412,14 @@ entry:

loop:
%iv = phi i32 [ 0, %entry], [ %iv.next, %latch]
%vol = load volatile i32, i32* @A
%vol = load volatile i32, ptr @A
%earlycnd = icmp ne i32 %vol, 0
br i1 %earlycnd, label %latch, label %exit

latch:
%iv.next = add i32 %iv, 1
%fx = udiv i32 %iv, 4
store volatile i32 %iv, i32* @A
store volatile i32 %iv, ptr @A
%c = icmp ult i32 %fx, 1024
br i1 %c, label %loop, label %exit

Expand All @@ -441,12 +441,12 @@ define void @nested(i32 %n) {
; CHECK-NEXT: br label [[OUTER:%.*]]
; CHECK: outer:
; CHECK-NEXT: [[IV1:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[IV1_NEXT:%.*]], [[OUTER_LATCH:%.*]] ]
; CHECK-NEXT: store volatile i32 [[IV1]], i32* @A, align 4
; CHECK-NEXT: store volatile i32 [[IV1]], ptr @A, align 4
; CHECK-NEXT: [[IV1_NEXT]] = add nuw nsw i32 [[IV1]], 1
; CHECK-NEXT: br label [[INNER:%.*]]
; CHECK: inner:
; CHECK-NEXT: [[IV2:%.*]] = phi i32 [ 0, [[OUTER]] ], [ [[IV2_NEXT:%.*]], [[INNER_LATCH:%.*]] ]
; CHECK-NEXT: store volatile i32 [[IV2]], i32* @A, align 4
; CHECK-NEXT: store volatile i32 [[IV2]], ptr @A, align 4
; CHECK-NEXT: [[IV2_NEXT]] = add nuw nsw i32 [[IV2]], 1
; CHECK-NEXT: [[EXITCOND:%.*]] = icmp ne i32 [[IV2]], 20
; CHECK-NEXT: br i1 [[EXITCOND]], label [[INNER_LATCH]], label [[EXIT_LOOPEXIT:%.*]]
Expand All @@ -468,13 +468,13 @@ entry:

outer:
%iv1 = phi i32 [ 0, %entry ], [ %iv1.next, %outer_latch ]
store volatile i32 %iv1, i32* @A
store volatile i32 %iv1, ptr @A
%iv1.next = add i32 %iv1, 1
br label %inner

inner:
%iv2 = phi i32 [ 0, %outer ], [ %iv2.next, %inner_latch ]
store volatile i32 %iv2, i32* @A
store volatile i32 %iv2, ptr @A
%iv2.next = add i32 %iv2, 1
%innertest = icmp ult i32 %iv2, 20
br i1 %innertest, label %inner_latch, label %exit
Expand Down
44 changes: 22 additions & 22 deletions llvm/test/Transforms/IndVarSimplify/lftr-pr20680.ll
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ target datalayout = "n8:16:32:64"
define void @f() {
; CHECK-LABEL: @f(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* @a, align 4
; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr @a, align 4
; CHECK-NEXT: [[TOBOOL2:%.*]] = icmp eq i32 [[TMP0]], 0
; CHECK-NEXT: [[TMP1:%.*]] = load i32, i32* @a, align 4
; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr @a, align 4
; CHECK-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[TMP1]], 0
; CHECK-NEXT: br label [[FOR_COND2_PREHEADER:%.*]]
; CHECK: for.cond2.preheader:
Expand All @@ -38,15 +38,15 @@ define void @f() {
; CHECK: cond.false.us.us:
; CHECK-NEXT: br label [[COND_END_US_US]]
; CHECK: cond.end.us.us:
; CHECK-NEXT: [[TMP4:%.*]] = load i32, i32* @b, align 4
; CHECK-NEXT: [[TMP4:%.*]] = load i32, ptr @b, align 4
; CHECK-NEXT: [[CMP91_US_US:%.*]] = icmp slt i32 [[TMP4]], 1
; CHECK-NEXT: br i1 [[CMP91_US_US]], label [[FOR_INC_LR_PH_US_US:%.*]], label [[FOR_COND2_LOOPEXIT_US_US:%.*]]
; CHECK: for.cond2.loopexit.us.us:
; CHECK-NEXT: br i1 true, label [[FOR_COND2_FOR_INC13_CRIT_EDGE_US_LCSSA_US_US_LCSSA_US:%.*]], label [[FOR_BODY3_US_US]]
; CHECK: for.inc.lr.ph.us.us:
; CHECK-NEXT: br label [[FOR_INC_US_US:%.*]]
; CHECK: for.cond8.for.cond2.loopexit_crit_edge.us.us:
; CHECK-NEXT: store i32 1, i32* @b, align 4
; CHECK-NEXT: store i32 1, ptr @b, align 4
; CHECK-NEXT: br label [[FOR_COND2_LOOPEXIT_US_US]]
; CHECK: for.inc.us.us:
; CHECK-NEXT: [[TMP5:%.*]] = phi i32 [ [[TMP4]], [[FOR_INC_LR_PH_US_US]] ], [ [[INC_US_US:%.*]], [[FOR_INC_US_US]] ]
Expand All @@ -62,7 +62,7 @@ define void @f() {
; CHECK: cond.false.us:
; CHECK-NEXT: br label [[COND_END_US]]
; CHECK: cond.end.us:
; CHECK-NEXT: [[TMP6:%.*]] = load i32, i32* @b, align 4
; CHECK-NEXT: [[TMP6:%.*]] = load i32, ptr @b, align 4
; CHECK-NEXT: [[CMP91_US:%.*]] = icmp slt i32 [[TMP6]], 1
; CHECK-NEXT: br i1 [[CMP91_US]], label [[FOR_INC_LR_PH_US:%.*]], label [[FOR_COND2_LOOPEXIT_US:%.*]]
; CHECK: for.inc.us:
Expand All @@ -75,7 +75,7 @@ define void @f() {
; CHECK: for.inc.lr.ph.us:
; CHECK-NEXT: br label [[FOR_INC_US]]
; CHECK: for.cond8.for.cond2.loopexit_crit_edge.us:
; CHECK-NEXT: store i32 1, i32* @b, align 4
; CHECK-NEXT: store i32 1, ptr @b, align 4
; CHECK-NEXT: br label [[FOR_COND2_LOOPEXIT_US]]
; CHECK: for.cond2.for.inc13_crit_edge.us-lcssa.us.us-lcssa:
; CHECK-NEXT: br label [[FOR_COND2_FOR_INC13_CRIT_EDGE_US_LCSSA_US]]
Expand All @@ -93,7 +93,7 @@ define void @f() {
; CHECK: cond.false.us4:
; CHECK-NEXT: br label [[COND_END_US5]]
; CHECK: cond.end.us5:
; CHECK-NEXT: [[TMP8:%.*]] = load i32, i32* @b, align 4
; CHECK-NEXT: [[TMP8:%.*]] = load i32, ptr @b, align 4
; CHECK-NEXT: [[CMP91_US7:%.*]] = icmp slt i32 [[TMP8]], 1
; CHECK-NEXT: br i1 [[CMP91_US7]], label [[FOR_INC_LR_PH_US12:%.*]], label [[FOR_COND2_LOOPEXIT_US11:%.*]]
; CHECK: for.inc.us8:
Expand All @@ -106,14 +106,14 @@ define void @f() {
; CHECK: for.inc.lr.ph.us12:
; CHECK-NEXT: br label [[FOR_INC_US8]]
; CHECK: for.cond8.for.cond2.loopexit_crit_edge.us13:
; CHECK-NEXT: store i32 1, i32* @b, align 4
; CHECK-NEXT: store i32 1, ptr @b, align 4
; CHECK-NEXT: br label [[FOR_COND2_LOOPEXIT_US11]]
; CHECK: for.cond2.for.inc13_crit_edge.us-lcssa.us-lcssa.us:
; CHECK-NEXT: br label [[FOR_COND2_FOR_INC13_CRIT_EDGE_US_LCSSA:%.*]]
; CHECK: for.body3.lr.ph.split.split:
; CHECK-NEXT: br label [[FOR_BODY3:%.*]]
; CHECK: for.cond8.for.cond2.loopexit_crit_edge:
; CHECK-NEXT: store i32 1, i32* @b, align 4
; CHECK-NEXT: store i32 1, ptr @b, align 4
; CHECK-NEXT: br label [[FOR_COND2_LOOPEXIT:%.*]]
; CHECK: for.cond2.loopexit:
; CHECK-NEXT: br i1 false, label [[FOR_COND2_FOR_INC13_CRIT_EDGE_US_LCSSA_US_LCSSA:%.*]], label [[FOR_BODY3]]
Expand All @@ -122,7 +122,7 @@ define void @f() {
; CHECK: cond.false:
; CHECK-NEXT: br label [[COND_END]]
; CHECK: cond.end:
; CHECK-NEXT: [[TMP10:%.*]] = load i32, i32* @b, align 4
; CHECK-NEXT: [[TMP10:%.*]] = load i32, ptr @b, align 4
; CHECK-NEXT: [[CMP91:%.*]] = icmp slt i32 [[TMP10]], 1
; CHECK-NEXT: br i1 [[CMP91]], label [[FOR_INC_LR_PH:%.*]], label [[FOR_COND2_LOOPEXIT]]
; CHECK: for.inc.lr.ph:
Expand All @@ -139,7 +139,7 @@ define void @f() {
; CHECK-NEXT: br label [[FOR_COND2_FOR_INC13_CRIT_EDGE]]
; CHECK: for.cond2.for.inc13_crit_edge:
; CHECK-NEXT: [[COND_LCSSA:%.*]] = phi i32 [ [[COND_LCSSA_PH]], [[FOR_COND2_FOR_INC13_CRIT_EDGE_US_LCSSA]] ], [ [[COND_LCSSA_PH_US]], [[FOR_COND2_FOR_INC13_CRIT_EDGE_US_LCSSA_US]] ]
; CHECK-NEXT: store i32 [[COND_LCSSA]], i32* @c, align 4
; CHECK-NEXT: store i32 [[COND_LCSSA]], ptr @c, align 4
; CHECK-NEXT: br label [[FOR_INC13]]
; CHECK: for.inc13:
; CHECK-NEXT: [[INDVARS_IV_NEXT]] = add nsw i32 [[INDVARS_IV]], 1
Expand All @@ -151,9 +151,9 @@ define void @f() {

; br i1 {{.*}}, label %[[for_inc13]], label %
entry:
%0 = load i32, i32* @a, align 4
%0 = load i32, ptr @a, align 4
%tobool2 = icmp eq i32 %0, 0
%1 = load i32, i32* @a, align 4
%1 = load i32, ptr @a, align 4
%tobool = icmp eq i32 %1, 0
br label %for.cond2.preheader

Expand Down Expand Up @@ -189,7 +189,7 @@ cond.false.us.us: ; preds = %for.body3.us.us

cond.end.us.us: ; preds = %cond.false.us.us, %for.body3.us.us
%cond.us.us = phi i32 [ %div, %cond.false.us.us ], [ %conv7, %for.body3.us.us ]
%4 = load i32, i32* @b, align 4
%4 = load i32, ptr @b, align 4
%cmp91.us.us = icmp slt i32 %4, 1
br i1 %cmp91.us.us, label %for.inc.lr.ph.us.us, label %for.cond2.loopexit.us.us

Expand All @@ -201,7 +201,7 @@ for.inc.lr.ph.us.us: ; preds = %cond.end.us.us

for.cond8.for.cond2.loopexit_crit_edge.us.us: ; preds = %for.inc.us.us
%inc.lcssa.us.us = phi i32 [ %inc.us.us, %for.inc.us.us ]
store i32 %inc.lcssa.us.us, i32* @b, align 4
store i32 %inc.lcssa.us.us, ptr @b, align 4
br label %for.cond2.loopexit.us.us

for.inc.us.us: ; preds = %for.inc.us.us, %for.inc.lr.ph.us.us
Expand All @@ -225,7 +225,7 @@ cond.false.us: ; preds = %for.body3.us

cond.end.us: ; preds = %cond.false.us, %for.body3.us
%cond.us = phi i32 [ %div, %cond.false.us ], [ %conv7, %for.body3.us ]
%6 = load i32, i32* @b, align 4
%6 = load i32, ptr @b, align 4
%cmp91.us = icmp slt i32 %6, 1
br i1 %cmp91.us, label %for.inc.lr.ph.us, label %for.cond2.loopexit.us

Expand All @@ -243,7 +243,7 @@ for.inc.lr.ph.us: ; preds = %cond.end.us

for.cond8.for.cond2.loopexit_crit_edge.us: ; preds = %for.inc.us
%inc.lcssa.us = phi i32 [ %inc.us, %for.inc.us ]
store i32 %inc.lcssa.us, i32* @b, align 4
store i32 %inc.lcssa.us, ptr @b, align 4
br label %for.cond2.loopexit.us

for.cond2.for.inc13_crit_edge.us-lcssa.us.us-lcssa: ; preds = %for.cond2.loopexit.us
Expand Down Expand Up @@ -271,7 +271,7 @@ cond.false.us4: ; preds = %for.body3.us3

cond.end.us5: ; preds = %cond.false.us4, %for.body3.us3
%cond.us6 = phi i32 [ %div, %cond.false.us4 ], [ %conv7, %for.body3.us3 ]
%8 = load i32, i32* @b, align 4
%8 = load i32, ptr @b, align 4
%cmp91.us7 = icmp slt i32 %8, 1
br i1 %cmp91.us7, label %for.inc.lr.ph.us12, label %for.cond2.loopexit.us11

Expand All @@ -289,7 +289,7 @@ for.inc.lr.ph.us12: ; preds = %cond.end.us5

for.cond8.for.cond2.loopexit_crit_edge.us13: ; preds = %for.inc.us8
%inc.lcssa.us14 = phi i32 [ %inc.us9, %for.inc.us8 ]
store i32 %inc.lcssa.us14, i32* @b, align 4
store i32 %inc.lcssa.us14, ptr @b, align 4
br label %for.cond2.loopexit.us11

for.cond2.for.inc13_crit_edge.us-lcssa.us-lcssa.us: ; preds = %for.cond2.loopexit.us11
Expand All @@ -301,7 +301,7 @@ for.body3.lr.ph.split.split: ; preds = %for.body3.lr.ph.spl

for.cond8.for.cond2.loopexit_crit_edge: ; preds = %for.inc
%inc.lcssa = phi i32 [ %inc, %for.inc ]
store i32 %inc.lcssa, i32* @b, align 4
store i32 %inc.lcssa, ptr @b, align 4
br label %for.cond2.loopexit

for.cond2.loopexit: ; preds = %cond.end, %for.cond8.for.cond2.loopexit_crit_edge
Expand All @@ -315,7 +315,7 @@ cond.false: ; preds = %for.body3

cond.end: ; preds = %cond.false, %for.body3
%cond = phi i32 [ %div, %cond.false ], [ %conv7, %for.body3 ]
%10 = load i32, i32* @b, align 4
%10 = load i32, ptr @b, align 4
%cmp91 = icmp slt i32 %10, 1
br i1 %cmp91, label %for.inc.lr.ph, label %for.cond2.loopexit

Expand All @@ -338,7 +338,7 @@ for.cond2.for.inc13_crit_edge.us-lcssa: ; preds = %for.cond2.for.inc13

for.cond2.for.inc13_crit_edge: ; preds = %for.cond2.for.inc13_crit_edge.us-lcssa, %for.cond2.for.inc13_crit_edge.us-lcssa.us
%cond.lcssa = phi i32 [ %cond.lcssa.ph, %for.cond2.for.inc13_crit_edge.us-lcssa ], [ %cond.lcssa.ph.us, %for.cond2.for.inc13_crit_edge.us-lcssa.us ]
store i32 %cond.lcssa, i32* @c, align 4
store i32 %cond.lcssa, ptr @c, align 4
br label %for.inc13

for.inc13: ; preds = %for.cond2.for.inc13_crit_edge, %for.cond2.preheader
Expand Down
22 changes: 11 additions & 11 deletions llvm/test/Transforms/IndVarSimplify/lftr-pr41998.ll
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"

define void @test_int(i32 %start, i32* %p) {
define void @test_int(i32 %start, ptr %p) {
; CHECK-LABEL: @test_int(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[TMP0:%.*]] = trunc i32 [[START:%.*]] to i3
Expand All @@ -12,7 +12,7 @@ define void @test_int(i32 %start, i32* %p) {
; CHECK: loop:
; CHECK-NEXT: [[I2:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I2_INC:%.*]], [[LOOP]] ]
; CHECK-NEXT: [[I2_INC]] = add nuw nsw i32 [[I2]], 1
; CHECK-NEXT: store volatile i32 [[I2_INC]], i32* [[P:%.*]]
; CHECK-NEXT: store volatile i32 [[I2_INC]], ptr [[P:%.*]], align 4
; CHECK-NEXT: [[LFTR_WIDEIV:%.*]] = trunc i32 [[I2_INC]] to i3
; CHECK-NEXT: [[EXITCOND:%.*]] = icmp eq i3 [[LFTR_WIDEIV]], [[TMP1]]
; CHECK-NEXT: br i1 [[EXITCOND]], label [[END:%.*]], label [[LOOP]]
Expand All @@ -27,7 +27,7 @@ loop:
%i2 = phi i32 [ 0, %entry ], [ %i2.inc, %loop ]
%i.inc = add nuw i32 %i, 1
%i2.inc = add nuw i32 %i2, 1
store volatile i32 %i2.inc, i32* %p
store volatile i32 %i2.inc, ptr %p
%and = and i32 %i.inc, 7
%cmp = icmp eq i32 %and, 0
br i1 %cmp, label %end, label %loop
Expand All @@ -45,13 +45,13 @@ define void @test_ptr(i32 %start) {
; CHECK-NEXT: [[TMP1:%.*]] = sub i3 -1, [[TMP0]]
; CHECK-NEXT: [[TMP2:%.*]] = zext i3 [[TMP1]] to i64
; CHECK-NEXT: [[TMP3:%.*]] = add nuw nsw i64 [[TMP2]], 1
; CHECK-NEXT: [[SCEVGEP:%.*]] = getelementptr [256 x i8], [256 x i8]* @data, i64 0, i64 [[TMP3]]
; CHECK-NEXT: [[UGLYGEP:%.*]] = getelementptr i8, ptr @data, i64 [[TMP3]]
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
; CHECK-NEXT: [[P:%.*]] = phi i8* [ getelementptr inbounds ([256 x i8], [256 x i8]* @data, i64 0, i64 0), [[ENTRY:%.*]] ], [ [[P_INC:%.*]], [[LOOP]] ]
; CHECK-NEXT: [[P_INC]] = getelementptr inbounds i8, i8* [[P]], i64 1
; CHECK-NEXT: store volatile i8 0, i8* [[P_INC]]
; CHECK-NEXT: [[EXITCOND:%.*]] = icmp eq i8* [[P_INC]], [[SCEVGEP]]
; CHECK-NEXT: [[P:%.*]] = phi ptr [ @data, [[ENTRY:%.*]] ], [ [[P_INC:%.*]], [[LOOP]] ]
; CHECK-NEXT: [[P_INC]] = getelementptr inbounds i8, ptr [[P]], i64 1
; CHECK-NEXT: store volatile i8 0, ptr [[P_INC]], align 1
; CHECK-NEXT: [[EXITCOND:%.*]] = icmp eq ptr [[P_INC]], [[UGLYGEP]]
; CHECK-NEXT: br i1 [[EXITCOND]], label [[END:%.*]], label [[LOOP]]
; CHECK: end:
; CHECK-NEXT: ret void
Expand All @@ -61,10 +61,10 @@ entry:

loop:
%i = phi i32 [ %start, %entry ], [ %i.inc, %loop ]
%p = phi i8* [ getelementptr inbounds ([256 x i8], [256 x i8]* @data, i64 0, i64 0), %entry ], [ %p.inc, %loop ]
%p = phi ptr [ @data, %entry ], [ %p.inc, %loop ]
%i.inc = add nuw i32 %i, 1
%p.inc = getelementptr inbounds i8, i8* %p, i64 1
store volatile i8 0, i8* %p.inc
%p.inc = getelementptr inbounds i8, ptr %p, i64 1
store volatile i8 0, ptr %p.inc
%and = and i32 %i.inc, 7
%cmp = icmp eq i32 %and, 0
br i1 %cmp, label %end, label %loop
Expand Down
18 changes: 9 additions & 9 deletions llvm/test/Transforms/IndVarSimplify/lftr-promote.ll
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"

define void @foo(double* %p, i32 %n) nounwind {
define void @foo(ptr %p, i32 %n) nounwind {
; CHECK-LABEL: @foo(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[TMP0:%.*]] = icmp sgt i32 [[N:%.*]], 0
Expand All @@ -17,12 +17,12 @@ define void @foo(double* %p, i32 %n) nounwind {
; CHECK: bb2:
; CHECK-NEXT: [[I_01:%.*]] = phi i32 [ [[TMP7:%.*]], [[BB3:%.*]] ], [ 0, [[BB_NPH]] ]
; CHECK-NEXT: [[TMP1:%.*]] = sext i32 [[I_01]] to i64
; CHECK-NEXT: [[TMP2:%.*]] = getelementptr double, double* [[P:%.*]], i64 [[TMP1]]
; CHECK-NEXT: [[TMP3:%.*]] = load double, double* [[TMP2]], align 8
; CHECK-NEXT: [[TMP2:%.*]] = getelementptr double, ptr [[P:%.*]], i64 [[TMP1]]
; CHECK-NEXT: [[TMP3:%.*]] = load double, ptr [[TMP2]], align 8
; CHECK-NEXT: [[TMP4:%.*]] = fmul double [[TMP3]], 1.100000e+00
; CHECK-NEXT: [[TMP5:%.*]] = sext i32 [[I_01]] to i64
; CHECK-NEXT: [[TMP6:%.*]] = getelementptr double, double* [[P]], i64 [[TMP5]]
; CHECK-NEXT: store double [[TMP4]], double* [[TMP6]], align 8
; CHECK-NEXT: [[TMP6:%.*]] = getelementptr double, ptr [[P]], i64 [[TMP5]]
; CHECK-NEXT: store double [[TMP4]], ptr [[TMP6]], align 8
; CHECK-NEXT: [[TMP7]] = add nuw nsw i32 [[I_01]], 1
; CHECK-NEXT: br label [[BB3]]
; CHECK: bb3:
Expand All @@ -44,12 +44,12 @@ bb.nph: ; preds = %entry
bb2: ; preds = %bb3, %bb.nph
%i.01 = phi i32 [ %7, %bb3 ], [ 0, %bb.nph ]
%1 = sext i32 %i.01 to i64
%2 = getelementptr double, double* %p, i64 %1
%3 = load double, double* %2, align 8
%2 = getelementptr double, ptr %p, i64 %1
%3 = load double, ptr %2, align 8
%4 = fmul double %3, 1.100000e+00
%5 = sext i32 %i.01 to i64
%6 = getelementptr double, double* %p, i64 %5
store double %4, double* %6, align 8
%6 = getelementptr double, ptr %p, i64 %5
store double %4, ptr %6, align 8
%7 = add i32 %i.01, 1
br label %bb3

Expand Down
4 changes: 2 additions & 2 deletions llvm/test/Transforms/IndVarSimplify/lftr_disabled.ll
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ define i32 @quadratic_setlt() {
; CHECK: loop:
; CHECK-NEXT: [[I:%.*]] = phi i32 [ 7, [[ENTRY:%.*]] ], [ [[I_NEXT:%.*]], [[LOOP]] ]
; CHECK-NEXT: [[I_NEXT]] = add nuw nsw i32 [[I]], 1
; CHECK-NEXT: store i32 [[I]], i32* @A
; CHECK-NEXT: store i32 [[I]], ptr @A
; CHECK-NEXT: [[I2:%.*]] = mul i32 [[I]], [[I]]
; CHECK-NEXT: [[C:%.*]] = icmp slt i32 [[I2]], 1000
; CHECK-NEXT: br i1 [[C]], label [[LOOP]], label [[LOOPEXIT:%.*]]
Expand All @@ -29,7 +29,7 @@ entry:
loop:
%i = phi i32 [ 7, %entry ], [ %i.next, %loop ]
%i.next = add i32 %i, 1
store i32 %i, i32* @A
store i32 %i, ptr @A
%i2 = mul i32 %i, %i
%c = icmp slt i32 %i2, 1000
br i1 %c, label %loop, label %loopexit
Expand Down
16 changes: 8 additions & 8 deletions llvm/test/Transforms/IndVarSimplify/loop_evaluate7.ll
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
target triple = "i386-pc-linux-gnu"

define i8* @string_expandtabs(i32 %n, i8* %m) nounwind {
define ptr @string_expandtabs(i32 %n, ptr %m) nounwind {
entry:
br i1 undef, label %bb33, label %bb1

Expand All @@ -21,27 +21,27 @@ bb19: ; preds = %bb30
br i1 undef, label %bb20, label %bb29

bb20: ; preds = %bb19
%0 = load i32, i32* undef, align 4 ; <i32> [#uses=1]
%0 = load i32, ptr undef, align 4 ; <i32> [#uses=1]
%1 = sub i32 %0, %n ; <i32> [#uses=1]
br label %bb23

bb21: ; preds = %bb23
%2 = icmp ult i8* %q.0, %m ; <i1> [#uses=1]
%2 = icmp ult ptr %q.0, %m ; <i1> [#uses=1]
br i1 %2, label %bb22, label %overflow2

bb22: ; preds = %bb21
%3 = getelementptr i8, i8* %q.0, i32 1 ; <i8*> [#uses=1]
%3 = getelementptr i8, ptr %q.0, i32 1 ; <ptr> [#uses=1]
br label %bb23

bb23: ; preds = %bb22, %bb20
%i.2 = phi i32 [ %1, %bb20 ], [ %4, %bb22 ] ; <i32> [#uses=1]
%q.0 = phi i8* [ undef, %bb20 ], [ %3, %bb22 ] ; <i8*> [#uses=3]
%q.0 = phi ptr [ undef, %bb20 ], [ %3, %bb22 ] ; <ptr> [#uses=3]
%4 = add i32 %i.2, -1 ; <i32> [#uses=2]
%5 = icmp eq i32 %4, -1 ; <i1> [#uses=1]
br i1 %5, label %bb29, label %bb21

bb29: ; preds = %bb23, %bb19
%q.1 = phi i8* [ undef, %bb19 ], [ %q.0, %bb23 ] ; <i8*> [#uses=0]
%q.1 = phi ptr [ undef, %bb19 ], [ %q.0, %bb23 ] ; <ptr> [#uses=0]
br label %bb30

bb30: ; preds = %bb29, %bb17
Expand All @@ -54,8 +54,8 @@ bb32: ; preds = %overflow2
br label %overflow1

overflow1: ; preds = %bb32, %overflow2, %bb1
ret i8* null
ret ptr null

bb33: ; preds = %bb30, %bb15, %entry
ret i8* undef
ret ptr undef
}
16 changes: 8 additions & 8 deletions llvm/test/Transforms/IndVarSimplify/loop_evaluate8.ll
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
target triple = "i386-pc-linux-gnu"

define i8* @string_expandtabs() nounwind {
define ptr @string_expandtabs() nounwind {
; CHECK-LABEL: @string_expandtabs(
; CHECK-NOT: select
entry:
Expand All @@ -25,27 +25,27 @@ bb19: ; preds = %bb30
br i1 undef, label %bb20, label %bb29

bb20: ; preds = %bb19
%0 = load i32, i32* undef, align 4 ; <i32> [#uses=1]
%0 = load i32, ptr undef, align 4 ; <i32> [#uses=1]
%1 = sub i32 %0, undef ; <i32> [#uses=1]
br label %bb23

bb21: ; preds = %bb23
%2 = icmp ult i8* %q.0, undef ; <i1> [#uses=1]
%2 = icmp ult ptr %q.0, undef ; <i1> [#uses=1]
br i1 %2, label %bb22, label %overflow2

bb22: ; preds = %bb21
%3 = getelementptr i8, i8* %q.0, i32 1 ; <i8*> [#uses=1]
%3 = getelementptr i8, ptr %q.0, i32 1 ; <ptr> [#uses=1]
br label %bb23

bb23: ; preds = %bb22, %bb20
%i.2 = phi i32 [ %1, %bb20 ], [ %4, %bb22 ] ; <i32> [#uses=1]
%q.0 = phi i8* [ undef, %bb20 ], [ %3, %bb22 ] ; <i8*> [#uses=3]
%q.0 = phi ptr [ undef, %bb20 ], [ %3, %bb22 ] ; <ptr> [#uses=3]
%4 = add i32 %i.2, -1 ; <i32> [#uses=2]
%5 = icmp eq i32 %4, -1 ; <i1> [#uses=1]
br i1 %5, label %bb29, label %bb21

bb29: ; preds = %bb23, %bb19
%q.1 = phi i8* [ undef, %bb19 ], [ %q.0, %bb23 ] ; <i8*> [#uses=0]
%q.1 = phi ptr [ undef, %bb19 ], [ %q.0, %bb23 ] ; <ptr> [#uses=0]
br label %bb30

bb30: ; preds = %bb29, %bb17
Expand All @@ -58,8 +58,8 @@ bb32: ; preds = %overflow2
br label %overflow1

overflow1: ; preds = %bb32, %overflow2, %bb1
ret i8* null
ret ptr null

bb33: ; preds = %bb30, %bb15, %entry
ret i8* undef
ret ptr undef
}
Loading