Change memcpy/memset/memmove to have dest and source alignments.
[oota-llvm.git] / test / Analysis / DependenceAnalysis / Preliminary.ll
index c9de0573e829840803a691326d46060f5c90d76c..31bd5712af80e15b1813bb9c7f4e1d72b7a3d218 100644 (file)
@@ -13,12 +13,12 @@ define i32 @p0(i32 %n, i32* %A, i32* %B) nounwind uwtable ssp {
 entry:
   store i32 %n, i32* %A, align 4
 
-; CHECK: da analyze - consistent output!
+; CHECK: da analyze - none!
 ; CHECK: da analyze - confused!
-; CHECK: da analyze - consistent input!
+; CHECK: da analyze - none!
 
-  %arrayidx1 = getelementptr inbounds i32* %B, i64 1
-  %0 = load i32* %arrayidx1, align 4
+  %arrayidx1 = getelementptr inbounds i32, i32* %B, i64 1
+  %0 = load i32, i32* %arrayidx1, align 4
   ret i32 %0
 }
 
@@ -31,12 +31,12 @@ define i32 @p1(i32 %n, i32* noalias %A, i32* noalias %B) nounwind uwtable ssp {
 entry:
   store i32 %n, i32* %A, align 4
 
-; CHECK: da analyze - consistent output!
 ; CHECK: da analyze - none!
-; CHECK: da analyze - consistent input!
+; CHECK: da analyze - none!
+; CHECK: da analyze - none!
 
-  %arrayidx1 = getelementptr inbounds i32* %B, i64 1
-  %0 = load i32* %arrayidx1, align 4
+  %arrayidx1 = getelementptr inbounds i32, i32* %B, i64 1
+  %0 = load i32, i32* %arrayidx1, align 4
   ret i32 %0
 }
 
@@ -54,10 +54,10 @@ entry:
   %cmp10 = icmp sgt i64 %n, 0
   br i1 %cmp10, label %for.cond1.preheader.preheader, label %for.end26
 
-; CHECK: da analyze - consistent output [0 0 0]!
+; CHECK: da analyze - none!
 ; CHECK: da analyze - flow [-3 -2]!
 ; CHECK: da analyze - confused!
-; CHECK: da analyze - consistent input [0 0 0]!
+; CHECK: da analyze - none!
 ; CHECK: da analyze - confused!
 ; CHECK: da analyze - output [* * *]!
 
@@ -84,7 +84,7 @@ for.body6.preheader:                              ; preds = %for.cond4.preheader
 
 for.body6:                                        ; preds = %for.body6.preheader, %for.body6
   %k.02 = phi i64 [ %inc, %for.body6 ], [ 0, %for.body6.preheader ]
-  %arrayidx8 = getelementptr inbounds [100 x [100 x i64]]* %A, i64 %i.011, i64 %j.07, i64 %k.02
+  %arrayidx8 = getelementptr inbounds [100 x [100 x i64]], [100 x [100 x i64]]* %A, i64 %i.011, i64 %j.07, i64 %k.02
   store i64 %i.011, i64* %arrayidx8, align 8
   %inc = add nsw i64 %k.02, 1
   %exitcond13 = icmp ne i64 %inc, %n
@@ -106,16 +106,16 @@ for.body12:                                       ; preds = %for.body12.preheade
   %add = add nsw i64 %k9.05, 1
   %add13 = add nsw i64 %j.07, 2
   %add14 = add nsw i64 %i.011, 3
-  %arrayidx17 = getelementptr inbounds [100 x [100 x i64]]* %A, i64 %add14, i64 %add13, i64 %add
-  %0 = load i64* %arrayidx17, align 8
-  %incdec.ptr = getelementptr inbounds i64* %B.addr.24, i64 1
+  %arrayidx17 = getelementptr inbounds [100 x [100 x i64]], [100 x [100 x i64]]* %A, i64 %add14, i64 %add13, i64 %add
+  %0 = load i64, i64* %arrayidx17, align 8
+  %incdec.ptr = getelementptr inbounds i64, i64* %B.addr.24, i64 1
   store i64 %0, i64* %B.addr.24, align 8
   %inc19 = add nsw i64 %k9.05, 1
   %exitcond = icmp ne i64 %inc19, %n
   br i1 %exitcond, label %for.body12, label %for.inc21.loopexit
 
 for.inc21.loopexit:                               ; preds = %for.body12
-  %scevgep = getelementptr i64* %B.addr.18, i64 %n
+  %scevgep = getelementptr i64, i64* %B.addr.18, i64 %n
   br label %for.inc21
 
 for.inc21:                                        ; preds = %for.inc21.loopexit, %for.cond10.loopexit
@@ -281,7 +281,7 @@ for.body33:                                       ; preds = %for.body33.preheade
   %add3547 = or i64 %mul, 1
   %sub = add nsw i64 %k.037, -1
   %sub36 = add nsw i64 %i.045, -3
-  %arrayidx43 = getelementptr inbounds [100 x [100 x [100 x [100 x [100 x [100 x [100 x i64]]]]]]]* %A, i64 %sub36, i64 %j.041, i64 2, i64 %sub, i64 %add3547, i64 %m.029, i64 %add34, i64 %add
+  %arrayidx43 = getelementptr inbounds [100 x [100 x [100 x [100 x [100 x [100 x [100 x i64]]]]]]], [100 x [100 x [100 x [100 x [100 x [100 x [100 x i64]]]]]]]* %A, i64 %sub36, i64 %j.041, i64 2, i64 %sub, i64 %add3547, i64 %m.029, i64 %add34, i64 %add
   store i64 %i.045, i64* %arrayidx43, align 8
   %add44 = add nsw i64 %t.03, 2
   %add45 = add nsw i64 %n, 1
@@ -289,16 +289,16 @@ for.body33:                                       ; preds = %for.body33.preheade
   %sub47 = add nsw i64 %mul46, -1
   %sub48 = sub nsw i64 1, %k.037
   %add49 = add nsw i64 %i.045, 3
-  %arrayidx57 = getelementptr inbounds [100 x [100 x [100 x [100 x [100 x [100 x [100 x i64]]]]]]]* %A, i64 %add49, i64 2, i64 %u.06, i64 %sub48, i64 %sub47, i64 %o.025, i64 %add45, i64 %add44
-  %0 = load i64* %arrayidx57, align 8
-  %incdec.ptr = getelementptr inbounds i64* %B.addr.112, i64 1
+  %arrayidx57 = getelementptr inbounds [100 x [100 x [100 x [100 x [100 x [100 x [100 x i64]]]]]]], [100 x [100 x [100 x [100 x [100 x [100 x [100 x i64]]]]]]]* %A, i64 %add49, i64 2, i64 %u.06, i64 %sub48, i64 %sub47, i64 %o.025, i64 %add45, i64 %add44
+  %0 = load i64, i64* %arrayidx57, align 8
+  %incdec.ptr = getelementptr inbounds i64, i64* %B.addr.112, i64 1
   store i64 %0, i64* %B.addr.112, align 8
   %inc = add nsw i64 %t.03, 1
   %exitcond = icmp ne i64 %inc, %n
   br i1 %exitcond, label %for.body33, label %for.inc58.loopexit
 
 for.inc58.loopexit:                               ; preds = %for.body33
-  %scevgep = getelementptr i64* %B.addr.105, i64 %n
+  %scevgep = getelementptr i64, i64* %B.addr.105, i64 %n
   br label %for.inc58
 
 for.inc58:                                        ; preds = %for.inc58.loopexit, %for.cond31.preheader
@@ -428,9 +428,9 @@ entry:
 ; CHECK: da analyze - output [*]!
 ; CHECK: da analyze - flow [*|<]!
 ; CHECK: da analyze - confused!
-; CHECK: da analyze - consistent input [0]!
+; CHECK: da analyze - none!
 ; CHECK: da analyze - confused!
-; CHECK: da analyze - consistent output [0]!
+; CHECK: da analyze - none!
 
 for.body.preheader:                               ; preds = %entry
   br label %for.body
@@ -441,12 +441,12 @@ for.body:                                         ; preds = %for.body.preheader,
   %conv2 = sext i8 %i.03 to i32
   %conv3 = sext i8 %i.03 to i64
   %add = add i64 %conv3, 2
-  %arrayidx = getelementptr inbounds i32* %A, i64 %add
+  %arrayidx = getelementptr inbounds i32, i32* %A, i64 %add
   store i32 %conv2, i32* %arrayidx, align 4
   %idxprom4 = sext i8 %i.03 to i64
-  %arrayidx5 = getelementptr inbounds i32* %A, i64 %idxprom4
-  %0 = load i32* %arrayidx5, align 4
-  %incdec.ptr = getelementptr inbounds i32* %B.addr.02, i64 1
+  %arrayidx5 = getelementptr inbounds i32, i32* %A, i64 %idxprom4
+  %0 = load i32, i32* %arrayidx5, align 4
+  %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.02, i64 1
   store i32 %0, i32* %B.addr.02, align 4
   %inc = add i8 %i.03, 1
   %conv = sext i8 %inc to i64
@@ -474,9 +474,9 @@ entry:
 ; CHECK: da analyze - output [*]!
 ; CHECK: da analyze - flow [*|<]!
 ; CHECK: da analyze - confused!
-; CHECK: da analyze - consistent input [0]!
+; CHECK: da analyze - none!
 ; CHECK: da analyze - confused!
-; CHECK: da analyze - consistent output [0]!
+; CHECK: da analyze - none!
 
 for.body.preheader:                               ; preds = %entry
   br label %for.body
@@ -487,12 +487,12 @@ for.body:                                         ; preds = %for.body.preheader,
   %conv2 = sext i16 %i.03 to i32
   %conv3 = sext i16 %i.03 to i64
   %add = add i64 %conv3, 2
-  %arrayidx = getelementptr inbounds i32* %A, i64 %add
+  %arrayidx = getelementptr inbounds i32, i32* %A, i64 %add
   store i32 %conv2, i32* %arrayidx, align 4
   %idxprom4 = sext i16 %i.03 to i64
-  %arrayidx5 = getelementptr inbounds i32* %A, i64 %idxprom4
-  %0 = load i32* %arrayidx5, align 4
-  %incdec.ptr = getelementptr inbounds i32* %B.addr.02, i64 1
+  %arrayidx5 = getelementptr inbounds i32, i32* %A, i64 %idxprom4
+  %0 = load i32, i32* %arrayidx5, align 4
+  %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.02, i64 1
   store i32 %0, i32* %B.addr.02, align 4
   %inc = add i16 %i.03, 1
   %conv = sext i16 %inc to i64
@@ -517,12 +517,12 @@ entry:
   %cmp1 = icmp sgt i64 %n, 0
   br i1 %cmp1, label %for.body.preheader, label %for.end
 
-; CHECK: da analyze - consistent output [0]!
+; CHECK: da analyze - none!
 ; CHECK: da analyze - consistent flow [2]!
 ; CHECK: da analyze - confused!
-; CHECK: da analyze - consistent input [0]!
+; CHECK: da analyze - none!
 ; CHECK: da analyze - confused!
-; CHECK: da analyze - consistent output [0]!
+; CHECK: da analyze - none!
 
 for.body.preheader:                               ; preds = %entry
   br label %for.body
@@ -531,12 +531,12 @@ for.body:                                         ; preds = %for.body.preheader,
   %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
   %B.addr.02 = phi i32* [ %incdec.ptr, %for.body ], [ %B, %for.body.preheader ]
   %0 = add nsw i64 %indvars.iv, 2
-  %arrayidx = getelementptr inbounds i32* %A, i64 %0
+  %arrayidx = getelementptr inbounds i32, i32* %A, i64 %0
   %1 = trunc i64 %indvars.iv to i32
   store i32 %1, i32* %arrayidx, align 4
-  %arrayidx3 = getelementptr inbounds i32* %A, i64 %indvars.iv
-  %2 = load i32* %arrayidx3, align 4
-  %incdec.ptr = getelementptr inbounds i32* %B.addr.02, i64 1
+  %arrayidx3 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv
+  %2 = load i32, i32* %arrayidx3, align 4
+  %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.02, i64 1
   store i32 %2, i32* %B.addr.02, align 4
   %indvars.iv.next = add i64 %indvars.iv, 1
   %exitcond = icmp ne i64 %indvars.iv.next, %n
@@ -557,20 +557,20 @@ for.end:                                          ; preds = %for.end.loopexit, %
 define void @p7(i32* %A, i32* %B, i8 signext %n) nounwind uwtable ssp {
 entry:
   %idxprom = sext i8 %n to i64
-  %arrayidx = getelementptr inbounds i32* %A, i64 %idxprom
+  %arrayidx = getelementptr inbounds i32, i32* %A, i64 %idxprom
 
-; CHECK: da analyze - consistent output!
+; CHECK: da analyze - none!
 ; CHECK: da analyze - none!
 ; CHECK: da analyze - confused!
-; CHECK: da analyze - consistent input!
+; CHECK: da analyze - none!
 ; CHECK: da analyze - confused!
-; CHECK: da analyze - consistent output!
+; CHECK: da analyze - none!
 
   store i32 0, i32* %arrayidx, align 4
   %conv = sext i8 %n to i64
   %add = add i64 %conv, 1
-  %arrayidx2 = getelementptr inbounds i32* %A, i64 %add
-  %0 = load i32* %arrayidx2, align 4
+  %arrayidx2 = getelementptr inbounds i32, i32* %A, i64 %add
+  %0 = load i32, i32* %arrayidx2, align 4
   store i32 %0, i32* %B, align 4
   ret void
 }
@@ -583,20 +583,20 @@ entry:
 define void @p8(i32* %A, i32* %B, i16 signext %n) nounwind uwtable ssp {
 entry:
   %idxprom = sext i16 %n to i64
-  %arrayidx = getelementptr inbounds i32* %A, i64 %idxprom
+  %arrayidx = getelementptr inbounds i32, i32* %A, i64 %idxprom
   store i32 0, i32* %arrayidx, align 4
 
-; CHECK: da analyze - consistent output!
+; CHECK: da analyze - none!
 ; CHECK: da analyze - none!
 ; CHECK: da analyze - confused!
-; CHECK: da analyze - consistent input!
+; CHECK: da analyze - none!
 ; CHECK: da analyze - confused!
-; CHECK: da analyze - consistent output!
+; CHECK: da analyze - none!
 
   %conv = sext i16 %n to i64
   %add = add i64 %conv, 1
-  %arrayidx2 = getelementptr inbounds i32* %A, i64 %add
-  %0 = load i32* %arrayidx2, align 4
+  %arrayidx2 = getelementptr inbounds i32, i32* %A, i64 %add
+  %0 = load i32, i32* %arrayidx2, align 4
   store i32 %0, i32* %B, align 4
   ret void
 }
@@ -609,20 +609,20 @@ entry:
 define void @p9(i32* %A, i32* %B, i32 %n) nounwind uwtable ssp {
 entry:
   %idxprom = sext i32 %n to i64
-  %arrayidx = getelementptr inbounds i32* %A, i64 %idxprom
+  %arrayidx = getelementptr inbounds i32, i32* %A, i64 %idxprom
   store i32 0, i32* %arrayidx, align 4
 
-; CHECK: da analyze - consistent output!
+; CHECK: da analyze - none!
 ; CHECK: da analyze - none!
 ; CHECK: da analyze - confused!
-; CHECK: da analyze - consistent input!
+; CHECK: da analyze - none!
 ; CHECK: da analyze - confused!
-; CHECK: da analyze - consistent output!
+; CHECK: da analyze - none!
 
   %add = add nsw i32 %n, 1
   %idxprom1 = sext i32 %add to i64
-  %arrayidx2 = getelementptr inbounds i32* %A, i64 %idxprom1
-  %0 = load i32* %arrayidx2, align 4
+  %arrayidx2 = getelementptr inbounds i32, i32* %A, i64 %idxprom1
+  %0 = load i32, i32* %arrayidx2, align 4
   store i32 %0, i32* %B, align 4
   ret void
 }
@@ -635,20 +635,20 @@ entry:
 define void @p10(i32* %A, i32* %B, i32 %n) nounwind uwtable ssp {
 entry:
   %idxprom = zext i32 %n to i64
-  %arrayidx = getelementptr inbounds i32* %A, i64 %idxprom
+  %arrayidx = getelementptr inbounds i32, i32* %A, i64 %idxprom
   store i32 0, i32* %arrayidx, align 4
 
-; CHECK: da analyze - consistent output!
+; CHECK: da analyze - none!
 ; CHECK: da analyze - none!
 ; CHECK: da analyze - confused!
-; CHECK: da analyze - consistent input!
+; CHECK: da analyze - none!
 ; CHECK: da analyze - confused!
-; CHECK: da analyze - consistent output!
+; CHECK: da analyze - none!
 
   %add = add i32 %n, 1
   %idxprom1 = zext i32 %add to i64
-  %arrayidx2 = getelementptr inbounds i32* %A, i64 %idxprom1
-  %0 = load i32* %arrayidx2, align 4
+  %arrayidx2 = getelementptr inbounds i32, i32* %A, i64 %idxprom1
+  %0 = load i32, i32* %arrayidx2, align 4
   store i32 %0, i32* %B, align 4
   ret void
 }
@@ -668,24 +668,24 @@ define void @f(%struct.S* %s, i32 %size) nounwind uwtable ssp {
 entry:
   %idx.ext = zext i32 %size to i64
   %add.ptr.sum = add i64 %idx.ext, -1
-  %add.ptr1 = getelementptr inbounds %struct.S* %s, i64 %add.ptr.sum
+  %add.ptr1 = getelementptr inbounds %struct.S, %struct.S* %s, i64 %add.ptr.sum
   %cmp1 = icmp eq i64 %add.ptr.sum, 0
   br i1 %cmp1, label %while.end, label %while.body.preheader
 
-; CHECK: da analyze - consistent input [0]!
+; CHECK: da analyze - none!
 ; CHECK: da analyze - consistent anti [1]!
-; CHECK: da analyze - consistent output [0]!
+; CHECK: da analyze - none!
 
 while.body.preheader:                             ; preds = %entry
   br label %while.body
 
 while.body:                                       ; preds = %while.body.preheader, %while.body
   %i.02 = phi %struct.S* [ %incdec.ptr, %while.body ], [ %s, %while.body.preheader ]
-  %0 = getelementptr inbounds %struct.S* %i.02, i64 1, i32 0
-  %1 = load i32* %0, align 4
-  %2 = getelementptr inbounds %struct.S* %i.02, i64 0, i32 0
+  %0 = getelementptr inbounds %struct.S, %struct.S* %i.02, i64 1, i32 0
+  %1 = load i32, i32* %0, align 4
+  %2 = getelementptr inbounds %struct.S, %struct.S* %i.02, i64 0, i32 0
   store i32 %1, i32* %2, align 4
-  %incdec.ptr = getelementptr inbounds %struct.S* %i.02, i64 1
+  %incdec.ptr = getelementptr inbounds %struct.S, %struct.S* %i.02, i64 1
   %cmp = icmp eq %struct.S* %incdec.ptr, %add.ptr1
   br i1 %cmp, label %while.end.loopexit, label %while.body
 
@@ -696,4 +696,4 @@ while.end:                                        ; preds = %while.end.loopexit,
   ret void
 }
 
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
+declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1) nounwind