1 ; RUN: opt < %s -disable-output -analyze -lda | FileCheck %s
3 @x = common global [256 x i32] zeroinitializer, align 4
4 @y = common global [256 x i32] zeroinitializer, align 4
6 ;; for (i = 0; i < 256; i++)
9 define void @f1(...) nounwind {
11 %x.ld.addr = getelementptr [256 x i32]* @x, i64 0, i64 42
15 %i = phi i64 [ 0, %entry ], [ %i.next, %for.body ]
16 %x.addr = getelementptr [256 x i32]* @x, i64 0, i64 %i
17 %y.addr = getelementptr [256 x i32]* @y, i64 0, i64 %i
18 %x = load i32* %x.ld.addr ; 0
19 %y = load i32* %y.addr ; 1
21 store i32 %r, i32* %x.addr ; 2
24 %i.next = add i64 %i, 1
25 %exitcond = icmp eq i64 %i.next, 256
26 br i1 %exitcond, label %for.end, label %for.body
32 ;; for (i = 0; i < 250; i++)
33 ;; x[i] = x[255] + y[i]
35 define void @f2(...) nounwind {
37 %x.ld.addr = getelementptr [256 x i32]* @x, i64 0, i64 255
41 %i = phi i64 [ 0, %entry ], [ %i.next, %for.body ]
42 %x.addr = getelementptr [256 x i32]* @x, i64 0, i64 %i
43 %y.addr = getelementptr [256 x i32]* @y, i64 0, i64 %i
44 %x = load i32* %x.ld.addr ; 0
45 %y = load i32* %y.addr ; 1
47 store i32 %r, i32* %x.addr ; 2
50 %i.next = add i64 %i, 1
51 %exitcond = icmp eq i64 %i.next, 250
52 br i1 %exitcond, label %for.end, label %for.body