1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -basic-aa -slp-vectorizer -S -mtriple=i386-apple-macosx10.9.0 -mcpu=corei7-avx | FileCheck %s
4 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
6 @a = common global i64* null, align 8
8 ; Function Attrs: nounwind ssp uwtable
12 ; CHECK-NEXT: [[TMP0:%.*]] = load i64*, i64** @a, align 8
13 ; CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x i64*> poison, i64* [[TMP0]], i32 0
14 ; CHECK-NEXT: [[TMP2:%.*]] = insertelement <2 x i64*> [[TMP1]], i64* [[TMP0]], i32 1
15 ; CHECK-NEXT: [[TMP3:%.*]] = getelementptr i64, <2 x i64*> [[TMP2]], <2 x i64> <i64 11, i64 56>
16 ; CHECK-NEXT: [[TMP4:%.*]] = ptrtoint <2 x i64*> [[TMP3]] to <2 x i64>
17 ; CHECK-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds i64, i64* [[TMP0]], i64 12
18 ; CHECK-NEXT: [[TMP5:%.*]] = extractelement <2 x i64*> [[TMP3]], i32 0
19 ; CHECK-NEXT: [[TMP6:%.*]] = bitcast i64* [[TMP5]] to <2 x i64>*
20 ; CHECK-NEXT: store <2 x i64> [[TMP4]], <2 x i64>* [[TMP6]], align 8
21 ; CHECK-NEXT: ret i32 undef
24 %0 = load i64*, i64** @a, align 8
25 %add.ptr = getelementptr inbounds i64, i64* %0, i64 11
26 %1 = ptrtoint i64* %add.ptr to i64
27 store i64 %1, i64* %add.ptr, align 8
28 %add.ptr1 = getelementptr inbounds i64, i64* %0, i64 56
29 %2 = ptrtoint i64* %add.ptr1 to i64
30 %arrayidx2 = getelementptr inbounds i64, i64* %0, i64 12
31 store i64 %2, i64* %arrayidx2, align 8
36 declare float @llvm.powi.f32.i32(float, i32)
37 define void @fn2(i32* %a, i32* %b, float* %c) {
40 ; CHECK-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds i32, i32* [[A:%.*]], i32 1
41 ; CHECK-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds i32, i32* [[B:%.*]], i32 1
42 ; CHECK-NEXT: [[ARRAYIDX4:%.*]] = getelementptr inbounds i32, i32* [[A]], i32 2
43 ; CHECK-NEXT: [[ARRAYIDX5:%.*]] = getelementptr inbounds i32, i32* [[B]], i32 2
44 ; CHECK-NEXT: [[ARRAYIDX6:%.*]] = getelementptr inbounds i32, i32* [[A]], i32 3
45 ; CHECK-NEXT: [[TMP0:%.*]] = bitcast i32* [[A]] to <4 x i32>*
46 ; CHECK-NEXT: [[TMP1:%.*]] = load <4 x i32>, <4 x i32>* [[TMP0]], align 4
47 ; CHECK-NEXT: [[ARRAYIDX7:%.*]] = getelementptr inbounds i32, i32* [[B]], i32 3
48 ; CHECK-NEXT: [[TMP2:%.*]] = bitcast i32* [[B]] to <4 x i32>*
49 ; CHECK-NEXT: [[TMP3:%.*]] = load <4 x i32>, <4 x i32>* [[TMP2]], align 4
50 ; CHECK-NEXT: [[TMP4:%.*]] = add <4 x i32> [[TMP1]], [[TMP3]]
51 ; CHECK-NEXT: [[TMP5:%.*]] = sitofp <4 x i32> [[TMP4]] to <4 x float>
52 ; CHECK-NEXT: [[TMP6:%.*]] = extractelement <4 x i32> [[TMP4]], i32 0
53 ; CHECK-NEXT: [[TMP7:%.*]] = call <4 x float> @llvm.powi.v4f32.i32(<4 x float> [[TMP5]], i32 [[TMP6]])
54 ; CHECK-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[C:%.*]], i32 1
55 ; CHECK-NEXT: [[ARRAYIDX9:%.*]] = getelementptr inbounds float, float* [[C]], i32 2
56 ; CHECK-NEXT: [[ARRAYIDX10:%.*]] = getelementptr inbounds float, float* [[C]], i32 3
57 ; CHECK-NEXT: [[TMP8:%.*]] = bitcast float* [[C]] to <4 x float>*
58 ; CHECK-NEXT: store <4 x float> [[TMP7]], <4 x float>* [[TMP8]], align 4
59 ; CHECK-NEXT: ret void
62 %i0 = load i32, i32* %a, align 4
63 %i1 = load i32, i32* %b, align 4
64 %add1 = add i32 %i0, %i1
65 %fp1 = sitofp i32 %add1 to float
66 %call1 = tail call float @llvm.powi.f32.i32(float %fp1,i32 %add1) nounwind readnone
68 %arrayidx2 = getelementptr inbounds i32, i32* %a, i32 1
69 %i2 = load i32, i32* %arrayidx2, align 4
70 %arrayidx3 = getelementptr inbounds i32, i32* %b, i32 1
71 %i3 = load i32, i32* %arrayidx3, align 4
72 %add2 = add i32 %i2, %i3
73 %fp2 = sitofp i32 %add2 to float
74 %call2 = tail call float @llvm.powi.f32.i32(float %fp2,i32 %add1) nounwind readnone
76 %arrayidx4 = getelementptr inbounds i32, i32* %a, i32 2
77 %i4 = load i32, i32* %arrayidx4, align 4
78 %arrayidx5 = getelementptr inbounds i32, i32* %b, i32 2
79 %i5 = load i32, i32* %arrayidx5, align 4
80 %add3 = add i32 %i4, %i5
81 %fp3 = sitofp i32 %add3 to float
82 %call3 = tail call float @llvm.powi.f32.i32(float %fp3,i32 %add1) nounwind readnone
84 %arrayidx6 = getelementptr inbounds i32, i32* %a, i32 3
85 %i6 = load i32, i32* %arrayidx6, align 4
86 %arrayidx7 = getelementptr inbounds i32, i32* %b, i32 3
87 %i7 = load i32, i32* %arrayidx7, align 4
88 %add4 = add i32 %i6, %i7
89 %fp4 = sitofp i32 %add4 to float
90 %call4 = tail call float @llvm.powi.f32.i32(float %fp4,i32 %add1) nounwind readnone
92 store float %call1, float* %c, align 4
93 %arrayidx8 = getelementptr inbounds float, float* %c, i32 1
94 store float %call2, float* %arrayidx8, align 4
95 %arrayidx9 = getelementptr inbounds float, float* %c, i32 2
96 store float %call3, float* %arrayidx9, align 4
97 %arrayidx10 = getelementptr inbounds float, float* %c, i32 3
98 store float %call4, float* %arrayidx10, align 4