1 ; RUN: opt < %s -disable-output -analyze -lda | FileCheck %s
3 ;; x[5] = x[6] // with x being a pointer passed as argument
5 define void @f1(i32* nocapture %xptr) nounwind {
7 %x.ld.addr = getelementptr i32* %xptr, i64 6
8 %x.st.addr = getelementptr i32* %xptr, i64 5
12 %i = phi i64 [ 0, %entry ], [ %i.next, %for.body ]
13 %x = load i32* %x.ld.addr
14 store i32 %x, i32* %x.st.addr
16 %i.next = add i64 %i, 1
17 %exitcond = icmp eq i64 %i.next, 256
18 br i1 %exitcond, label %for.end, label %for.body
24 ;; x[5] = x[6] // with x being an array on the stack
26 define void @foo(...) nounwind {
28 %xptr = alloca [256 x i32], align 4
29 %x.ld.addr = getelementptr [256 x i32]* %xptr, i64 0, i64 6
30 %x.st.addr = getelementptr [256 x i32]* %xptr, i64 0, i64 5
34 %i = phi i64 [ 0, %entry ], [ %i.next, %for.body ]
35 %x = load i32* %x.ld.addr
36 store i32 %x, i32* %x.st.addr
38 %i.next = add i64 %i, 1
39 %exitcond = icmp eq i64 %i.next, 256
40 br i1 %exitcond, label %for.end, label %for.body