1 ; RUN: opt < %s -instcombine -S | grep {align 16} | count 1
3 ; A multi-dimensional array in a nested loop doing vector stores that
4 ; aren't yet aligned. Instcombine can understand the addressing in the
5 ; Nice case to prove 16 byte alignment. In the Awkward case, the inner
6 ; array dimension is not even, so the stores to it won't always be
7 ; aligned. Instcombine should prove alignment in exactly one of the two
10 @Nice = global [1001 x [20000 x double]] zeroinitializer, align 32
11 @Awkward = global [1001 x [20001 x double]] zeroinitializer, align 32
13 define void @foo() nounwind {
18 %i = phi i64 [ 0, %entry ], [ %indvar.next26, %bb11 ]
22 %j = phi i64 [ 0, %bb7.outer ], [ %indvar.next, %bb1 ]
24 %t4 = getelementptr [1001 x [20000 x double]]* @Nice, i64 0, i64 %i, i64 %j
25 %q = bitcast double* %t4 to <2 x double>*
26 store <2 x double><double 0.0, double 0.0>, <2 x double>* %q, align 8
28 %s4 = getelementptr [1001 x [20001 x double]]* @Awkward, i64 0, i64 %i, i64 %j
29 %r = bitcast double* %s4 to <2 x double>*
30 store <2 x double><double 0.0, double 0.0>, <2 x double>* %r, align 8
32 %indvar.next = add i64 %j, 2
33 %exitcond = icmp eq i64 %indvar.next, 557
34 br i1 %exitcond, label %bb11, label %bb1
37 %indvar.next26 = add i64 %i, 1
38 %exitcond27 = icmp eq i64 %indvar.next26, 991
39 br i1 %exitcond27, label %return.split, label %bb7.outer