Make opt default to not adding a target data string and update tests that depend...
[oota-llvm.git] / test / Transforms / InstCombine / align-addr.ll
1 ; RUN: opt < %s -instcombine -S | grep {align 16} | count 1
2 target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128"
3
4 ; Instcombine should be able to prove vector alignment in the
5 ; presence of a few mild address computation tricks.
6
7 define void @foo(i8* %b, i64 %n, i64 %u, i64 %y) nounwind  {
8 entry:
9   %c = ptrtoint i8* %b to i64
10   %d = and i64 %c, -16
11   %e = inttoptr i64 %d to double*
12   %v = mul i64 %u, 2
13   %z = and i64 %y, -2
14   %t1421 = icmp eq i64 %n, 0
15   br i1 %t1421, label %return, label %bb
16
17 bb:
18   %i = phi i64 [ %indvar.next, %bb ], [ 20, %entry ]
19   %j = mul i64 %i, %v
20   %h = add i64 %j, %z
21   %t8 = getelementptr double* %e, i64 %h
22   %p = bitcast double* %t8 to <2 x double>*
23   store <2 x double><double 0.0, double 0.0>, <2 x double>* %p, align 8
24   %indvar.next = add i64 %i, 1
25   %exitcond = icmp eq i64 %indvar.next, %n
26   br i1 %exitcond, label %return, label %bb
27
28 return:
29   ret void
30 }
31