; CHECK: ArrayDecl[UnknownSize][%m][%o] with elements of 4 bytes.
; CHECK: ArrayRef[{3,+,2}<nuw><%for.i>][{-4,+,3}<nw><%for.j>][{7,+,5}<nw><%for.k>]
-define void @foo(i64 %n, i64 %m, i64 %o, i32* nocapture %A) #0 {
+define void @foo(i64 %n, i64 %m, i64 %o, ptr nocapture %A) #0 {
entry:
%cmp32 = icmp sgt i64 %n, 0
br i1 %cmp32, label %for.cond1.preheader.lr.ph, label %for.end17
%mul.us.us = mul nsw i64 %k.029.us.us, 5
%arrayidx.sum.us.us = add i64 %mul.us.us, 7
%arrayidx10.sum.us.us = add i64 %arrayidx.sum.us.us, %tmp27.us.us
- %arrayidx11.us.us = getelementptr inbounds i32, i32* %A, i64 %arrayidx10.sum.us.us
- store i32 1, i32* %arrayidx11.us.us, align 4
+ %arrayidx11.us.us = getelementptr inbounds i32, ptr %A, i64 %arrayidx10.sum.us.us
+ store i32 1, ptr %arrayidx11.us.us, align 4
%inc.us.us = add nsw i64 %k.029.us.us, 1
%exitcond = icmp eq i64 %inc.us.us, %o
br i1 %exitcond, label %for.inc12.us.us, label %for.k
; }
; }
-define void @foo(i8* %A, i64 %i2, i64 %arg, i1 %c) {
+define void @foo(ptr %A, i64 %i2, i64 %arg, i1 %c) {
entry:
br label %outer.loop
outer.loop:
%outer.iv = phi i64 [ 0, %entry ], [ %outer.iv.next, %outer.latch ]
%i414 = mul nsw i64 %outer.iv, %i2
- %tmp = getelementptr inbounds i8, i8* %A, i64 %i414
+ %tmp = getelementptr inbounds i8, ptr %A, i64 %i414
br i1 %c, label %inner.preheader, label %outer.latch
inner.preheader:
%unknown = shl i64 %arg, %arg
- %arrayidx = getelementptr inbounds i8, i8* %tmp, i64 %unknown
- %ptr = bitcast i8* %arrayidx to float*
+ %arrayidx = getelementptr inbounds i8, ptr %tmp, i64 %unknown
br label %inner.loop
inner.loop:
- store float 0.000000e+00, float* %ptr, align 4
+ store float 0.000000e+00, ptr %arrayidx, align 4
br label %inner.loop
outer.latch:
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
-; CHECK: Inst: %tmp = load float, float* %arrayidx, align 4
+; CHECK: Inst: %tmp = load float, ptr %arrayidx, align 4
; CHECK-NEXT: In Loop with Header: for.inc
; CHECK-NEXT: AccessFunction: {(4 * %N * %call),+,4}<nsw><%for.inc>
; CHECK-NEXT: Base offset: %A
; CHECK-NEXT: ArrayDecl[UnknownSize][%N] with elements of 4 bytes.
; CHECK-NEXT: ArrayRef[%call][{0,+,1}<nuw><nsw><%for.inc>]
-; CHECK: Inst: %tmp5 = load float, float* %arrayidx4, align 4
+; CHECK: Inst: %tmp5 = load float, ptr %arrayidx4, align 4
; CHECK-NEXT: In Loop with Header: for.inc
; CHECK-NEXT: AccessFunction: {(4 * %call1),+,(4 * %N)}<nsw><%for.inc>
; CHECK-NEXT: Base offset: %B
; CHECK-NEXT: ArrayRef[{0,+,1}<nuw><nsw><%for.inc>][%call1]
; Function Attrs: noinline nounwind uwtable
-define void @mat_mul(float* %C, float* %A, float* %B, i64 %N) #0 !kernel_arg_addr_space !2 !kernel_arg_access_qual !3 !kernel_arg_type !4 !kernel_arg_base_type !4 !kernel_arg_type_qual !5 {
+define void @mat_mul(ptr %C, ptr %A, ptr %B, i64 %N) #0 !kernel_arg_addr_space !2 !kernel_arg_access_qual !3 !kernel_arg_type !4 !kernel_arg_base_type !4 !kernel_arg_type_qual !5 {
entry:
br label %entry.split
%acc.03 = phi float [ 0.000000e+00, %for.inc.lr.ph ], [ %tmp6, %for.inc ]
%m.02 = phi i64 [ 0, %for.inc.lr.ph ], [ %inc, %for.inc ]
%add = add nsw i64 %m.02, %mul
- %arrayidx = getelementptr inbounds float, float* %A, i64 %add
- %tmp = load float, float* %arrayidx, align 4
+ %arrayidx = getelementptr inbounds float, ptr %A, i64 %add
+ %tmp = load float, ptr %arrayidx, align 4
%mul2 = mul nsw i64 %m.02, %N
%add3 = add nsw i64 %mul2, %call1
- %arrayidx4 = getelementptr inbounds float, float* %B, i64 %add3
- %tmp5 = load float, float* %arrayidx4, align 4
+ %arrayidx4 = getelementptr inbounds float, ptr %B, i64 %add3
+ %tmp5 = load float, ptr %arrayidx4, align 4
%tmp6 = tail call float @llvm.fmuladd.f32(float %tmp, float %tmp5, float %acc.03)
%inc = add nuw nsw i64 %m.02, 1
%exitcond = icmp ne i64 %inc, %N
for.end: ; preds = %for.cond.for.end_crit_edge, %entry.split
%acc.0.lcssa = phi float [ %.lcssa, %for.cond.for.end_crit_edge ], [ 0.000000e+00, %entry.split ]
%add7 = add nsw i64 %mul, %call1
- %arrayidx8 = getelementptr inbounds float, float* %C, i64 %add7
- store float %acc.0.lcssa, float* %arrayidx8, align 4
+ %arrayidx8 = getelementptr inbounds float, ptr %C, i64 %add7
+ store float %acc.0.lcssa, ptr %arrayidx8, align 4
ret void
}
; }
; AddRec: {{(-1 + ((1 + %bs) * %stride)),+,(-1 * %stride)}<%for.cond1.preheader>,+,1}<nw><%for.body3>
-; CHECK: Inst: %0 = load i8, i8* %arrayidx, align 1
+; CHECK: Inst: %0 = load i8, ptr %arrayidx, align 1
; CHECK: Base offset: %dst
; CHECK: ArrayDecl[UnknownSize][%stride] with elements of 1 bytes.
; CHECK: ArrayRef[{(1 + %bs),+,-1}<nw><%for.cond1.preheader>][{-1,+,1}<nw><%for.body3>]
-; AddRec: {{(%stride * %bs),+,(-1 * %stride)}<%for.cond1.preheader>,+,1}<nw><%for.body3>
-; CHECK: Inst: store i8 %0, i8* %arrayidx7, align 1
+; AddRec: {{(ptr %bs),+,(-1 * %stride)}<%for.cond1.preheader>,+,1}<nw><%for.body3>
+; CHECK: Inst: store i8 %0, ptr %arrayidx7, align 1
; CHECK: Base offset: %dst
; CHECK: ArrayDecl[UnknownSize][%stride] with elements of 1 bytes.
; CHECK: ArrayRef[{%bs,+,-1}<nsw><%for.cond1.preheader>][{0,+,1}<nuw><nsw><%for.body3>]
-define void @test(i8* nocapture %dst, i32 %stride, i32 %bs) {
+define void @test(ptr nocapture %dst, i32 %stride, i32 %bs) {
entry:
%cmp20 = icmp sgt i32 %bs, -1
br i1 %cmp20, label %for.cond1.preheader.lr.ph, label %for.end9
for.body3:
%c.019 = phi i32 [ 0, %for.body3.lr.ph ], [ %inc, %for.body3 ]
%sub = add i32 %add4, %c.019
- %arrayidx = getelementptr inbounds i8, i8* %dst, i32 %sub
- %0 = load i8, i8* %arrayidx, align 1
+ %arrayidx = getelementptr inbounds i8, ptr %dst, i32 %sub
+ %0 = load i8, ptr %arrayidx, align 1
%add6 = add nsw i32 %c.019, %mul5
- %arrayidx7 = getelementptr inbounds i8, i8* %dst, i32 %add6
- store i8 %0, i8* %arrayidx7, align 1
+ %arrayidx7 = getelementptr inbounds i8, ptr %dst, i32 %add6
+ store i8 %0, ptr %arrayidx7, align 1
%inc = add nsw i32 %c.019, 1
%cmp2 = icmp slt i32 %inc, %bs
br i1 %cmp2, label %for.body3, label %for.cond1.for.inc8_crit_edge
@g = common global i32 0, align 4
@h = common global i32 0, align 4
-@f = common global i8* null, align 4
+@f = common global ptr null, align 4
@a = common global i32 0, align 4
@b = common global i32 0, align 4
@c = common global i32 0, align 4
define i32 @fn2() {
entry:
- %.pr = load i32, i32* @d, align 4
+ %.pr = load i32, ptr @d, align 4
%phitmp = icmp eq i32 %.pr, 0
br label %for.cond
br i1 %0, label %for.cond, label %for.cond2thread-pre-split.preheader.i
for.cond2thread-pre-split.preheader.i:
- %1 = load i32, i32* @g, align 4
- %2 = load i32, i32* @h, align 4
+ %1 = load i32, ptr @g, align 4
+ %2 = load i32, ptr @h, align 4
%mul = mul nsw i32 %2, %1
- %3 = load i8*, i8** @f, align 4
- %.pr.pre.i = load i32, i32* @b, align 4
+ %3 = load ptr, ptr @f, align 4
+ %.pr.pre.i = load i32, ptr @b, align 4
br label %for.cond2thread-pre-split.i
for.cond2thread-pre-split.i:
%.pr.i = phi i32 [ 0, %for.inc5.i ], [ %.pr.pre.i, %for.cond2thread-pre-split.preheader.i ]
%storemerge.i = phi i32 [ %inc6.i, %for.inc5.i ], [ 0, %for.cond2thread-pre-split.preheader.i ]
- store i32 %storemerge.i, i32* @a, align 4
+ store i32 %storemerge.i, ptr @a, align 4
%tobool31.i = icmp eq i32 %.pr.i, 0
br i1 %tobool31.i, label %for.inc5.i, label %for.body4.preheader.i
for.body4.i:
%8 = phi i32 [ %inc.7.i, %for.body4.i ], [ %.pr.i, %for.body4.i.preheader ]
%arrayidx.sum1 = add i32 %add.i, %8
- %arrayidx.i = getelementptr inbounds i8, i8* %3, i32 %arrayidx.sum1
- %9 = load i8, i8* %arrayidx.i, align 1
+ %arrayidx.i = getelementptr inbounds i8, ptr %3, i32 %arrayidx.sum1
+ %9 = load i8, ptr %arrayidx.i, align 1
%conv.i = sext i8 %9 to i32
- store i32 %conv.i, i32* @c, align 4
+ store i32 %conv.i, ptr @c, align 4
%inc.i = add nsw i32 %8, 1
- store i32 %inc.i, i32* @b, align 4
+ store i32 %inc.i, ptr @b, align 4
%arrayidx.sum2 = add i32 %add.i, %inc.i
- %arrayidx.1.i = getelementptr inbounds i8, i8* %3, i32 %arrayidx.sum2
- %10 = load i8, i8* %arrayidx.1.i, align 1
+ %arrayidx.1.i = getelementptr inbounds i8, ptr %3, i32 %arrayidx.sum2
+ %10 = load i8, ptr %arrayidx.1.i, align 1
%conv.1.i = sext i8 %10 to i32
- store i32 %conv.1.i, i32* @c, align 4
+ store i32 %conv.1.i, ptr @c, align 4
%inc.1.i = add nsw i32 %8, 2
- store i32 %inc.1.i, i32* @b, align 4
+ store i32 %inc.1.i, ptr @b, align 4
%arrayidx.sum3 = add i32 %add.i, %inc.1.i
- %arrayidx.2.i = getelementptr inbounds i8, i8* %3, i32 %arrayidx.sum3
- %11 = load i8, i8* %arrayidx.2.i, align 1
+ %arrayidx.2.i = getelementptr inbounds i8, ptr %3, i32 %arrayidx.sum3
+ %11 = load i8, ptr %arrayidx.2.i, align 1
%conv.2.i = sext i8 %11 to i32
- store i32 %conv.2.i, i32* @c, align 4
+ store i32 %conv.2.i, ptr @c, align 4
%inc.2.i = add nsw i32 %8, 3
- store i32 %inc.2.i, i32* @b, align 4
+ store i32 %inc.2.i, ptr @b, align 4
%arrayidx.sum4 = add i32 %add.i, %inc.2.i
- %arrayidx.3.i = getelementptr inbounds i8, i8* %3, i32 %arrayidx.sum4
- %12 = load i8, i8* %arrayidx.3.i, align 1
+ %arrayidx.3.i = getelementptr inbounds i8, ptr %3, i32 %arrayidx.sum4
+ %12 = load i8, ptr %arrayidx.3.i, align 1
%conv.3.i = sext i8 %12 to i32
- store i32 %conv.3.i, i32* @c, align 4
+ store i32 %conv.3.i, ptr @c, align 4
%inc.3.i = add nsw i32 %8, 4
- store i32 %inc.3.i, i32* @b, align 4
+ store i32 %inc.3.i, ptr @b, align 4
%arrayidx.sum5 = add i32 %add.i, %inc.3.i
- %arrayidx.4.i = getelementptr inbounds i8, i8* %3, i32 %arrayidx.sum5
- %13 = load i8, i8* %arrayidx.4.i, align 1
+ %arrayidx.4.i = getelementptr inbounds i8, ptr %3, i32 %arrayidx.sum5
+ %13 = load i8, ptr %arrayidx.4.i, align 1
%conv.4.i = sext i8 %13 to i32
- store i32 %conv.4.i, i32* @c, align 4
+ store i32 %conv.4.i, ptr @c, align 4
%inc.4.i = add nsw i32 %8, 5
- store i32 %inc.4.i, i32* @b, align 4
+ store i32 %inc.4.i, ptr @b, align 4
%arrayidx.sum6 = add i32 %add.i, %inc.4.i
- %arrayidx.5.i = getelementptr inbounds i8, i8* %3, i32 %arrayidx.sum6
- %14 = load i8, i8* %arrayidx.5.i, align 1
+ %arrayidx.5.i = getelementptr inbounds i8, ptr %3, i32 %arrayidx.sum6
+ %14 = load i8, ptr %arrayidx.5.i, align 1
%conv.5.i = sext i8 %14 to i32
- store i32 %conv.5.i, i32* @c, align 4
+ store i32 %conv.5.i, ptr @c, align 4
%inc.5.i = add nsw i32 %8, 6
- store i32 %inc.5.i, i32* @b, align 4
+ store i32 %inc.5.i, ptr @b, align 4
%arrayidx.sum7 = add i32 %add.i, %inc.5.i
- %arrayidx.6.i = getelementptr inbounds i8, i8* %3, i32 %arrayidx.sum7
- %15 = load i8, i8* %arrayidx.6.i, align 1
+ %arrayidx.6.i = getelementptr inbounds i8, ptr %3, i32 %arrayidx.sum7
+ %15 = load i8, ptr %arrayidx.6.i, align 1
%conv.6.i = sext i8 %15 to i32
- store i32 %conv.6.i, i32* @c, align 4
+ store i32 %conv.6.i, ptr @c, align 4
%inc.6.i = add nsw i32 %8, 7
- store i32 %inc.6.i, i32* @b, align 4
+ store i32 %inc.6.i, ptr @b, align 4
%arrayidx.sum8 = add i32 %add.i, %inc.6.i
- %arrayidx.7.i = getelementptr inbounds i8, i8* %3, i32 %arrayidx.sum8
- %16 = load i8, i8* %arrayidx.7.i, align 1
+ %arrayidx.7.i = getelementptr inbounds i8, ptr %3, i32 %arrayidx.sum8
+ %16 = load i8, ptr %arrayidx.7.i, align 1
%conv.7.i = sext i8 %16 to i32
- store i32 %conv.7.i, i32* @c, align 4
+ store i32 %conv.7.i, ptr @c, align 4
%inc.7.i = add nsw i32 %8, 8
- store i32 %inc.7.i, i32* @b, align 4
+ store i32 %inc.7.i, ptr @b, align 4
%tobool3.7.i = icmp sgt i32 %inc.7.i, -8
br i1 %tobool3.7.i, label %for.inc5.loopexit.ur-lcssa.i, label %for.body4.i
for.body4.ur.i:
%20 = phi i32 [ %inc.ur.i, %for.body4.ur.i ], [ %.ph, %for.body4.ur.i.preheader ]
%arrayidx.sum = add i32 %add.i, %20
- %arrayidx.ur.i = getelementptr inbounds i8, i8* %3, i32 %arrayidx.sum
- %21 = load i8, i8* %arrayidx.ur.i, align 1
+ %arrayidx.ur.i = getelementptr inbounds i8, ptr %3, i32 %arrayidx.sum
+ %21 = load i8, ptr %arrayidx.ur.i, align 1
%conv.ur.i = sext i8 %21 to i32
- store i32 %conv.ur.i, i32* @c, align 4
+ store i32 %conv.ur.i, ptr @c, align 4
%inc.ur.i = add nsw i32 %20, 1
- store i32 %inc.ur.i, i32* @b, align 4
+ store i32 %inc.ur.i, ptr @b, align 4
%tobool3.ur.i = icmp eq i32 %inc.ur.i, 0
br i1 %tobool3.ur.i, label %for.inc5.i.loopexit, label %for.body4.ur.i
; CHECK: ArrayDecl[UnknownSize][(sext i32 %a.cols to i64)][(sext i32 %a.deps to i64)] with elements of 4 bytes.
; CHECK: ArrayRef[{1,+,1}<nuw><nsw><%for.i>][{1,+,1}<nuw><nsw><%for.j>][{1,+,1}<nuw><nsw><%for.k>]
-%struct.Mat = type { float*, i32, i32, i32, i32 }
+%struct.Mat = type { ptr, i32, i32, i32, i32 }
-define void @jacobi(i32 %nn, %struct.Mat* nocapture %a, %struct.Mat* nocapture %p) nounwind uwtable {
+define void @jacobi(i32 %nn, ptr nocapture %a, ptr nocapture %p) nounwind uwtable {
entry:
- %p.rows.ptr = getelementptr inbounds %struct.Mat, %struct.Mat* %p, i64 0, i32 2
- %p.rows = load i32, i32* %p.rows.ptr
+ %p.rows.ptr = getelementptr inbounds %struct.Mat, ptr %p, i64 0, i32 2
+ %p.rows = load i32, ptr %p.rows.ptr
%p.rows.sub = add i32 %p.rows, -1
%p.rows.sext = sext i32 %p.rows.sub to i64
- %p.cols.ptr = getelementptr inbounds %struct.Mat, %struct.Mat* %p, i64 0, i32 3
- %p.cols = load i32, i32* %p.cols.ptr
+ %p.cols.ptr = getelementptr inbounds %struct.Mat, ptr %p, i64 0, i32 3
+ %p.cols = load i32, ptr %p.cols.ptr
%p.cols.sub = add i32 %p.cols, -1
%p.cols.sext = sext i32 %p.cols.sub to i64
- %p.deps.ptr = getelementptr inbounds %struct.Mat, %struct.Mat* %p, i64 0, i32 4
- %p.deps = load i32, i32* %p.deps.ptr
+ %p.deps.ptr = getelementptr inbounds %struct.Mat, ptr %p, i64 0, i32 4
+ %p.deps = load i32, ptr %p.deps.ptr
%p.deps.sub = add i32 %p.deps, -1
%p.deps.sext = sext i32 %p.deps.sub to i64
- %a.cols.ptr = getelementptr inbounds %struct.Mat, %struct.Mat* %a, i64 0, i32 3
- %a.cols = load i32, i32* %a.cols.ptr
- %a.deps.ptr = getelementptr inbounds %struct.Mat, %struct.Mat* %a, i64 0, i32 4
- %a.deps = load i32, i32* %a.deps.ptr
- %a.base.ptr = getelementptr inbounds %struct.Mat, %struct.Mat* %a, i64 0, i32 0
- %a.base = load float*, float** %a.base.ptr, align 8
+ %a.cols.ptr = getelementptr inbounds %struct.Mat, ptr %a, i64 0, i32 3
+ %a.cols = load i32, ptr %a.cols.ptr
+ %a.deps.ptr = getelementptr inbounds %struct.Mat, ptr %a, i64 0, i32 4
+ %a.deps = load i32, ptr %a.deps.ptr
+ %a.base = load ptr, ptr %a, align 8
br label %for.i
for.i: ; preds = %for.i.inc, %entry
%tmp2 = add i64 %tmp1, %j
%tmp3 = mul i64 %tmp2, %a.deps.sext
%tmp4 = add nsw i64 %k, %tmp3
- %arrayidx = getelementptr inbounds float, float* %a.base, i64 %tmp4
- store float 1.000000e+00, float* %arrayidx
+ %arrayidx = getelementptr inbounds float, ptr %a.base, i64 %tmp4
+ store float 1.000000e+00, ptr %arrayidx
%k.inc = add nsw i64 %k, 1
%k.exitcond = icmp eq i64 %k.inc, %p.deps.sext
br i1 %k.exitcond, label %for.j.inc, label %for.k
; CHECK: ArrayDecl[UnknownSize][(sext i32 %a.cols to i64)][(sext i32 %a.deps to i64)] with elements of 4 bytes.
; CHECK: ArrayRef[{1,+,1}<nuw><nsw><%for.i>][{1,+,1}<nuw><nsw><%for.j>][{1,+,1}<nuw><nsw><%for.k>]
-%struct.Mat = type { float*, i32, i32, i32, i32 }
+%struct.Mat = type { ptr, i32, i32, i32, i32 }
-define void @jacobi(i32 %nn, %struct.Mat* nocapture %a, %struct.Mat* nocapture %p) nounwind uwtable {
+define void @jacobi(i32 %nn, ptr nocapture %a, ptr nocapture %p) nounwind uwtable {
entry:
- %p.rows.ptr = getelementptr inbounds %struct.Mat, %struct.Mat* %p, i64 0, i32 2
- %p.rows = load i32, i32* %p.rows.ptr
+ %p.rows.ptr = getelementptr inbounds %struct.Mat, ptr %p, i64 0, i32 2
+ %p.rows = load i32, ptr %p.rows.ptr
%p.rows.sub = add i32 %p.rows, -1
%p.rows.sext = sext i32 %p.rows.sub to i64
- %p.cols.ptr = getelementptr inbounds %struct.Mat, %struct.Mat* %p, i64 0, i32 3
- %p.cols = load i32, i32* %p.cols.ptr
+ %p.cols.ptr = getelementptr inbounds %struct.Mat, ptr %p, i64 0, i32 3
+ %p.cols = load i32, ptr %p.cols.ptr
%p.cols.sub = add i32 %p.cols, -1
%p.cols.sext = sext i32 %p.cols.sub to i64
- %p.deps.ptr = getelementptr inbounds %struct.Mat, %struct.Mat* %p, i64 0, i32 4
- %p.deps = load i32, i32* %p.deps.ptr
+ %p.deps.ptr = getelementptr inbounds %struct.Mat, ptr %p, i64 0, i32 4
+ %p.deps = load i32, ptr %p.deps.ptr
%p.deps.sub = add i32 %p.deps, -1
%p.deps.sext = sext i32 %p.deps.sub to i64
- %a.cols.ptr = getelementptr inbounds %struct.Mat, %struct.Mat* %a, i64 0, i32 3
- %a.cols = load i32, i32* %a.cols.ptr
+ %a.cols.ptr = getelementptr inbounds %struct.Mat, ptr %a, i64 0, i32 3
+ %a.cols = load i32, ptr %a.cols.ptr
%a.cols.sext = sext i32 %a.cols to i64
- %a.deps.ptr = getelementptr inbounds %struct.Mat, %struct.Mat* %a, i64 0, i32 4
- %a.deps = load i32, i32* %a.deps.ptr
+ %a.deps.ptr = getelementptr inbounds %struct.Mat, ptr %a, i64 0, i32 4
+ %a.deps = load i32, ptr %a.deps.ptr
%a.deps.sext = sext i32 %a.deps to i64
- %a.base.ptr = getelementptr inbounds %struct.Mat, %struct.Mat* %a, i64 0, i32 0
- %a.base = load float*, float** %a.base.ptr, align 8
+ %a.base = load ptr, ptr %a, align 8
br label %for.i
for.i: ; preds = %for.i.inc, %entry
%tmp2 = add i64 %tmp1, %j
%tmp3 = mul i64 %tmp2, %a.deps.sext
%tmp4 = add nsw i64 %k, %tmp3
- %arrayidx = getelementptr inbounds float, float* %a.base, i64 %tmp4
- store float 1.000000e+00, float* %arrayidx
+ %arrayidx = getelementptr inbounds float, ptr %a.base, i64 %tmp4
+ store float 1.000000e+00, ptr %arrayidx
%k.inc = add nsw i64 %k, 1
%k.exitcond = icmp eq i64 %k.inc, %p.deps.sext
br i1 %k.exitcond, label %for.j.inc, label %for.k
; CHECK: ArrayRef[{%b,+,2}<nsw><%for.i>][{0,+,2}<nuw><%for.j>]
-define void @foo(i64 %n, i64 %m, i64 %b, double* %A) {
+define void @foo(i64 %n, i64 %m, i64 %b, ptr %A) {
entry:
br label %for.i
%j = phi i64 [ 0, %for.i ], [ %j.inc, %for.j ]
%prodj = mul i64 %j, 2
%vlaarrayidx.sum = add i64 %prodj, %tmp
- %arrayidx = getelementptr inbounds double, double* %A, i64 %vlaarrayidx.sum
- store double 1.0, double* %arrayidx
+ %arrayidx = getelementptr inbounds double, ptr %A, i64 %vlaarrayidx.sum
+ store double 1.0, ptr %arrayidx
%j.inc = add nsw i64 %j, 1
%j.exitcond = icmp eq i64 %j.inc, %m
br i1 %j.exitcond, label %for.i.inc, label %for.j
; CHECK: ArrayDecl[UnknownSize][%m][%o] with elements of 8 bytes.
; CHECK: ArrayRef[{3,+,1}<nuw><%for.i>][{-4,+,1}<nsw><%for.j>][{7,+,1}<nuw><nsw><%for.k>]
-define void @foo(i64 %n, i64 %m, i64 %o, double* %A) {
+define void @foo(i64 %n, i64 %m, i64 %o, ptr %A) {
entry:
br label %for.i
%subscript2 = mul i64 %subscript1, %o
%offset2 = add nsw i64 %k, 7
%subscript = add i64 %subscript2, %offset2
- %idx = getelementptr inbounds double, double* %A, i64 %subscript
- store double 1.0, double* %idx
+ %idx = getelementptr inbounds double, ptr %A, i64 %subscript
+ store double 1.0, ptr %idx
br label %for.k.inc
for.k.inc:
; CHECK: ArrayDecl[UnknownSize][%m][(%o + %p)] with elements of 8 bytes.
; CHECK: ArrayRef[{3,+,1}<nuw><%for.cond4.preheader.lr.ph.us>][{-4,+,1}<nw><%for.body6.lr.ph.us.us>][{7,+,1}<nw><%for.body6.us.us>]
-define void @foo(i64 %n, i64 %m, i64 %o, i64 %p, double* nocapture %A) nounwind uwtable {
+define void @foo(i64 %n, i64 %m, i64 %o, i64 %p, ptr nocapture %A) nounwind uwtable {
entry:
%add = add nsw i64 %p, %o
%cmp22 = icmp sgt i64 %n, 0
%k.019.us.us = phi i64 [ 0, %for.body6.lr.ph.us.us ], [ %inc.us.us, %for.body6.us.us ]
%arrayidx.sum.us.us = add i64 %k.019.us.us, 7
%arrayidx9.sum.us.us = add i64 %arrayidx.sum.us.us, %tmp17.us.us
- %arrayidx10.us.us = getelementptr inbounds double, double* %A, i64 %arrayidx9.sum.us.us
- store double 1.000000e+00, double* %arrayidx10.us.us, align 8
+ %arrayidx10.us.us = getelementptr inbounds double, ptr %A, i64 %arrayidx9.sum.us.us
+ store double 1.000000e+00, ptr %arrayidx10.us.us, align 8
%inc.us.us = add nsw i64 %k.019.us.us, 1
%exitcond = icmp eq i64 %inc.us.us, %o
br i1 %exitcond, label %for.inc11.us.us, label %for.body6.us.us
; CHECK: ArrayDecl[UnknownSize][%m][%o] with elements of 8 bytes.
; CHECK: ArrayRef[{%p,+,1}<nw><%for.i>][{%q,+,1}<nsw><%for.j>][{%r,+,1}<nsw><%for.k>]
-define void @foo(i64 %n, i64 %m, i64 %o, double* %A, i64 %p, i64 %q, i64 %r) {
+define void @foo(i64 %n, i64 %m, i64 %o, ptr %A, i64 %p, i64 %q, i64 %r) {
entry:
br label %for.i
%subscript2 = mul i64 %subscript1, %o
%offset2 = add nsw i64 %k, %r
%subscript = add i64 %subscript2, %offset2
- %idx = getelementptr inbounds double, double* %A, i64 %subscript
- store double 1.0, double* %idx
+ %idx = getelementptr inbounds double, ptr %A, i64 %subscript
+ store double 1.0, ptr %idx
br label %for.k.inc
for.k.inc:
; A[i][j] = 1.0;
; }
-; Inst: %val = load double, double* %arrayidx
+; Inst: %val = load double, ptr %arrayidx
; In Loop with Header: for.j
; AddRec: {{0,+,(%m * 8)}<%for.i>,+,8}<%for.j>
; Base offset: %A
; ArrayDecl[UnknownSize][%m] with elements of 8 bytes.
; ArrayRef[{0,+,1}<nuw><nsw><%for.i>][{0,+,1}<nuw><nsw><%for.j>]
-; Inst: store double %val, double* %arrayidx
+; Inst: store double %val, ptr %arrayidx
; In Loop with Header: for.j
; AddRec: {{%A,+,(8 * %m)}<%for.i>,+,8}<%for.j>
; CHECK: Base offset: %A
; CHECK: ArrayDecl[UnknownSize][%m] with elements of 8 bytes.
; CHECK: ArrayRef[{0,+,1}<nuw><nsw><%for.i>][{0,+,1}<nuw><nsw><%for.j>]
-define void @foo(i64 %n, i64 %m, double* %A) {
+define void @foo(i64 %n, i64 %m, ptr %A) {
entry:
br label %for.i
for.j:
%j = phi i64 [ 0, %for.i ], [ %j.inc, %for.j ]
%vlaarrayidx.sum = add i64 %j, %tmp
- %arrayidx = getelementptr inbounds double, double* %A, i64 %vlaarrayidx.sum
- %val = load double, double* %arrayidx
- store double %val, double* %arrayidx
+ %arrayidx = getelementptr inbounds double, ptr %A, i64 %vlaarrayidx.sum
+ %val = load double, ptr %arrayidx
+ store double %val, ptr %arrayidx
%j.inc = add nsw i64 %j, 1
%j.exitcond = icmp eq i64 %j.inc, %m
br i1 %j.exitcond, label %for.i.inc, label %for.j
br i1 %cmp224, label %for.cond7.preheader.lr.ph.split.us.us, label %for.inc17
for.end13.us: ; preds = %for.inc11.us.us
- call void @bar(i64 %indvars.iv51, i64 %indvars.iv48, double* %vla.us) nounwind
- call void @llvm.stackrestore(i8* %1)
+ call void @bar(i64 %indvars.iv51, i64 %indvars.iv48, ptr %vla.us) nounwind
+ call void @llvm.stackrestore(ptr %1)
%indvars.iv.next49 = add i64 %indvars.iv48, 1
%exitcond54 = icmp eq i64 %indvars.iv.next49, %b
br i1 %exitcond54, label %for.inc17, label %for.cond7.preheader.lr.ph.split.us.us
for.body9.us.us: ; preds = %for.body9.us.us, %for.body9.lr.ph.us.us
%j.021.us.us = phi i64 [ 0, %for.body9.lr.ph.us.us ], [ %inc.us.us, %for.body9.us.us ]
%arrayidx.sum.us.us = add i64 %j.021.us.us, %0
- %arrayidx10.us.us = getelementptr inbounds double, double* %vla.us, i64 %arrayidx.sum.us.us
- store double 1.000000e+00, double* %arrayidx10.us.us, align 8
+ %arrayidx10.us.us = getelementptr inbounds double, ptr %vla.us, i64 %arrayidx.sum.us.us
+ store double 1.000000e+00, ptr %arrayidx10.us.us, align 8
%inc.us.us = add nsw i64 %j.021.us.us, 1
%exitcond50 = icmp eq i64 %inc.us.us, %indvars.iv48
br i1 %exitcond50, label %for.inc11.us.us, label %for.body9.us.us
for.cond7.preheader.lr.ph.split.us.us: ; preds = %for.cond1.preheader, %for.end13.us
%indvars.iv48 = phi i64 [ %indvars.iv.next49, %for.end13.us ], [ 1, %for.cond1.preheader ]
- %1 = call i8* @llvm.stacksave()
+ %1 = call ptr @llvm.stacksave()
%2 = mul nuw i64 %indvars.iv48, %indvars.iv51
%vla.us = alloca double, i64 %2, align 16
br label %for.body9.lr.ph.us.us
ret void
}
-declare i8* @llvm.stacksave() nounwind
-declare void @bar(i64, i64, double*)
-declare void @llvm.stackrestore(i8*) nounwind
+declare ptr @llvm.stacksave() nounwind
+declare void @bar(i64, i64, ptr)
+declare void @llvm.stackrestore(ptr) nounwind
; CHECK: ArrayDecl[UnknownSize][%m][%o] with elements of 8 bytes.
; CHECK: ArrayRef[{0,+,1}<nuw><nsw><%for.i>][{0,+,1}<nuw><nsw><%for.j>][{0,+,1}<nuw><nsw><%for.k>]
-define void @foo(i64 %n, i64 %m, i64 %o, double* %A) {
+define void @foo(i64 %n, i64 %m, i64 %o, ptr %A) {
entry:
br label %for.i
%subscript1 = add i64 %j, %subscript0
%subscript2 = mul i64 %subscript1, %o
%subscript = add i64 %subscript2, %k
- %idx = getelementptr inbounds double, double* %A, i64 %subscript
- store double 1.0, double* %idx
+ %idx = getelementptr inbounds double, ptr %A, i64 %subscript
+ store double 1.0, ptr %idx
br label %for.k.inc
for.k.inc:
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-S128"
target triple = "x86_64-unknown-linux-gnu"
-define void @foo(i32 %n, i32 %m, i32 %o, double* %A) {
+define void @foo(i32 %n, i32 %m, i32 %o, ptr %A) {
entry:
%m_zext = zext i32 %m to i64
%n_zext = zext i32 %o to i64
%tmp.us.us = add i64 %j, %tmp
%tmp17.us.us = mul i64 %tmp.us.us, %n_zext
%subscript = add i64 %tmp17.us.us, %k
- %idx = getelementptr inbounds double, double* %A, i64 %subscript
- store double 1.0, double* %idx
+ %idx = getelementptr inbounds double, ptr %A, i64 %subscript
+ store double 1.0, ptr %idx
br label %for.k.inc
for.k.inc:
; *(A + j * m + i) = 2.0;
; }
-define void @foo(i64 %n, i64 %m, double* %A) {
+define void @foo(i64 %n, i64 %m, ptr %A) {
entry:
br label %for.i
%j = phi i64 [ 0, %for.i ], [ %j.inc, %for.j ]
%tmp = mul nsw i64 %i, %m
%vlaarrayidx.sum = add i64 %j, %tmp
- %arrayidx = getelementptr inbounds double, double* %A, i64 %vlaarrayidx.sum
- store double 1.0, double* %arrayidx
+ %arrayidx = getelementptr inbounds double, ptr %A, i64 %vlaarrayidx.sum
+ store double 1.0, ptr %arrayidx
%tmp1 = mul nsw i64 %j, %n
%vlaarrayidx.sum1 = add i64 %i, %tmp1
- %arrayidx1 = getelementptr inbounds double, double* %A, i64 %vlaarrayidx.sum1
- store double 1.0, double* %arrayidx1
+ %arrayidx1 = getelementptr inbounds double, ptr %A, i64 %vlaarrayidx.sum1
+ store double 1.0, ptr %arrayidx1
%j.inc = add nsw i64 %j, 1
%j.exitcond = icmp eq i64 %j.inc, %m
br i1 %j.exitcond, label %for.i.inc, label %for.j
;
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
-define void @foo(float* %A, i64* %p) {
+define void @foo(ptr %A, ptr %p) {
bb:
br label %bb2
bb5: ; preds = %bb4
%tmp = add nuw nsw i64 %i.0, %j.0
%tmp6 = sitofp i64 %tmp to float
- %pval = load i64, i64* %p, align 8
+ %pval = load i64, ptr %p, align 8
%tmp8 = mul nsw i64 %i.0, %pval
%tmp9 = add nsw i64 %tmp8, %j.0
- %tmp10 = getelementptr inbounds float, float* %A, i64 %tmp9
- %tmp11 = load float, float* %tmp10, align 4
+ %tmp10 = getelementptr inbounds float, ptr %A, i64 %tmp9
+ %tmp11 = load float, ptr %tmp10, align 4
%tmp12 = fadd float %tmp11, %tmp6
- store float %tmp12, float* %tmp10, align 4
+ store float %tmp12, ptr %tmp10, align 4
br label %bb13
bb13: ; preds = %bb5
;target triple = "aarch64--linux-gnu"
; CHECK-LABEL: Delinearization on function foo
-; CHECK: Inst: %4 = load i8, i8* %arrayidx.us, align 1
+; CHECK: Inst: %4 = load i8, ptr %arrayidx.us, align 1
; CHECK: Subscripts
; CHECK-NEXT: {0,+,1}<nuw><nsw><%for.body3.lr.ph.us>
; CHECK-NEXT: {0,+,1}<nuw><nsw><%for.body3.us>
; CHECK: succeeded to delinearize
-define void @foo(i32 %m, i32 %n, i8* nocapture %A) #0 {
+define void @foo(i32 %m, i32 %n, ptr nocapture %A) #0 {
entry:
br label %entry.split
for.body3.us: ; preds = %for.body3.us, %for.body3.lr.ph.us
%indvars.iv = phi i64 [ 0, %for.body3.lr.ph.us ], [ %indvars.iv.next, %for.body3.us ]
%3 = add nsw i64 %indvars.iv, %5
- %arrayidx.us = getelementptr inbounds i8, i8* %A, i64 %3
- %4 = load i8, i8* %arrayidx.us, align 1
+ %arrayidx.us = getelementptr inbounds i8, ptr %A, i64 %3
+ %4 = load i8, ptr %arrayidx.us, align 1
%add4.us = add i8 %4, 1
- store i8 %add4.us, i8* %arrayidx.us, align 1
+ store i8 %add4.us, ptr %arrayidx.us, align 1
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%lftr.wideiv = trunc i64 %indvars.iv to i32
%exitcond = icmp eq i32 %lftr.wideiv, %0
define fastcc void @test() {
entry:
- %0 = load i16, i16* undef, align 2
+ %0 = load i16, ptr undef, align 2
%conv21 = zext i16 %0 to i32
br label %for.cond7.preheader
for.cond7.preheader:
- %p1.022 = phi i8* [ undef, %entry ], [ %add.ptr, %for.end ]
+ %p1.022 = phi ptr [ undef, %entry ], [ %add.ptr, %for.end ]
br label %for.body11
for.body11:
- %arrayidx.phi = phi i8* [ %p1.022, %for.cond7.preheader ], [ undef, %for.body11 ]
- store i8 undef, i8* %arrayidx.phi, align 1
+ %arrayidx.phi = phi ptr [ %p1.022, %for.cond7.preheader ], [ undef, %for.body11 ]
+ store i8 undef, ptr %arrayidx.phi, align 1
br i1 undef, label %for.body11, label %for.end
for.end:
- %add.ptr = getelementptr inbounds i8, i8* %p1.022, i32 %conv21
+ %add.ptr = getelementptr inbounds i8, ptr %p1.022, i32 %conv21
br label %for.cond7.preheader
}
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
-define void @foo(double* %Ey) {
+define void @foo(ptr %Ey) {
entry:
br i1 undef, label %for.cond55.preheader, label %for.end324
%tmp5 = add i64 %iy.067, %0
%tmp6 = mul i64 %tmp5, undef
%arrayidx69.sum = add i64 undef, %tmp6
- %arrayidx70 = getelementptr inbounds double, double* %Ey, i64 %arrayidx69.sum
- %1 = load double, double* %arrayidx70, align 8
+ %arrayidx70 = getelementptr inbounds double, ptr %Ey, i64 %arrayidx69.sum
+ %1 = load double, ptr %arrayidx70, align 8
%inc = add nsw i64 %ix.062, 1
br i1 false, label %for.body60, label %for.end