Move the complex address expression out of DIVariable and into an extra
[oota-llvm.git] / test / Transforms / SLPVectorizer / X86 / extract_in_tree_user.ll
1 ; RUN: opt < %s -basicaa -slp-vectorizer -S -mtriple=i386-apple-macosx10.9.0 -mcpu=corei7-avx | FileCheck %s
2
3 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
4
5 @a = common global i64* null, align 8
6
7 ; Function Attrs: nounwind ssp uwtable
8 define i32 @fn1() {
9 entry:
10   %0 = load i64** @a, align 8
11   %add.ptr = getelementptr inbounds i64* %0, i64 11
12   %1 = ptrtoint i64* %add.ptr to i64
13   store i64 %1, i64* %add.ptr, align 8
14   %add.ptr1 = getelementptr inbounds i64* %0, i64 56
15   %2 = ptrtoint i64* %add.ptr1 to i64
16   %arrayidx2 = getelementptr inbounds i64* %0, i64 12
17   store i64 %2, i64* %arrayidx2, align 8
18   ret i32 undef
19 ; CHECK-LABEL: @fn1(
20 ; CHECK: extractelement <2 x i64*>
21 ; CHECK: ret
22 }
23
24
25 declare float @llvm.powi.f32(float, i32)
26 define void @fn2(i32* %a, i32* %b, float* %c) {
27 entry:
28   %i0 = load i32* %a, align 4
29   %i1 = load i32* %b, align 4
30   %add1 = add i32 %i0, %i1
31   %fp1 = sitofp i32 %add1 to float
32   %call1 = tail call float @llvm.powi.f32(float %fp1,i32 %add1) nounwind readnone
33
34   %arrayidx2 = getelementptr inbounds i32* %a, i32 1
35   %i2 = load i32* %arrayidx2, align 4
36   %arrayidx3 = getelementptr inbounds i32* %b, i32 1
37   %i3 = load i32* %arrayidx3, align 4
38   %add2 = add i32 %i2, %i3
39   %fp2 = sitofp i32 %add2 to float
40   %call2 = tail call float @llvm.powi.f32(float %fp2,i32 %add1) nounwind readnone
41
42   %arrayidx4 = getelementptr inbounds i32* %a, i32 2
43   %i4 = load i32* %arrayidx4, align 4
44   %arrayidx5 = getelementptr inbounds i32* %b, i32 2
45   %i5 = load i32* %arrayidx5, align 4
46   %add3 = add i32 %i4, %i5
47   %fp3 = sitofp i32 %add3 to float
48   %call3 = tail call float @llvm.powi.f32(float %fp3,i32 %add1) nounwind readnone
49
50   %arrayidx6 = getelementptr inbounds i32* %a, i32 3
51   %i6 = load i32* %arrayidx6, align 4
52   %arrayidx7 = getelementptr inbounds i32* %b, i32 3
53   %i7 = load i32* %arrayidx7, align 4
54   %add4 = add i32 %i6, %i7
55   %fp4 = sitofp i32 %add4 to float
56   %call4 = tail call float @llvm.powi.f32(float %fp4,i32 %add1) nounwind readnone
57
58   store float %call1, float* %c, align 4
59   %arrayidx8 = getelementptr inbounds float* %c, i32 1
60   store float %call2, float* %arrayidx8, align 4
61   %arrayidx9 = getelementptr inbounds float* %c, i32 2
62   store float %call3, float* %arrayidx9, align 4
63   %arrayidx10 = getelementptr inbounds float* %c, i32 3
64   store float %call4, float* %arrayidx10, align 4
65   ret void
66
67 ; CHECK-LABEL: @fn2(
68 ; CHECK: extractelement <4 x i32>
69 ; CHECK: ret
70 }