1 ; RUN: llc < %s -mtriple=i686-linux -mcpu=corei7-avx | FileCheck %s
2 ; RUN: opt -instsimplify -disable-output < %s
5 define <4 x i32*> @AGEP0(i32* %ptr) nounwind {
11 %vecinit.i = insertelement <4 x i32*> undef, i32* %ptr, i32 0
12 %vecinit2.i = insertelement <4 x i32*> %vecinit.i, i32* %ptr, i32 1
13 %vecinit4.i = insertelement <4 x i32*> %vecinit2.i, i32* %ptr, i32 2
14 %vecinit6.i = insertelement <4 x i32*> %vecinit4.i, i32* %ptr, i32 3
15 %A2 = getelementptr i32, <4 x i32*> %vecinit6.i, <4 x i32> <i32 1, i32 2, i32 3, i32 4>
16 %A3 = getelementptr i32, <4 x i32*> %A2, <4 x i32> <i32 10, i32 14, i32 19, i32 233>
21 define i32 @AGEP1(<4 x i32*> %param) nounwind {
27 %A2 = getelementptr i32, <4 x i32*> %param, <4 x i32> <i32 1, i32 2, i32 3, i32 4>
28 %k = extractelement <4 x i32*> %A2, i32 3
29 %v = load i32, i32* %k
35 define i32 @AGEP2(<4 x i32*> %param, <4 x i32> %off) nounwind {
40 %A2 = getelementptr i32, <4 x i32*> %param, <4 x i32> %off
41 %k = extractelement <4 x i32*> %A2, i32 3
42 %v = load i32, i32* %k
48 define <4 x i32*> @AGEP3(<4 x i32*> %param, <4 x i32> %off) nounwind {
53 %A2 = getelementptr i32, <4 x i32*> %param, <4 x i32> %off
55 %k = insertelement <4 x i32*> %A2, i32* %v, i32 3
61 define <4 x i16*> @AGEP4(<4 x i16*> %param, <4 x i32> %off) nounwind {
64 ; Multiply offset by two (add it to itself).
66 ; add the base to the offset
68 %A = getelementptr i16, <4 x i16*> %param, <4 x i32> %off
74 define <4 x i8*> @AGEP5(<4 x i8*> %param, <4 x i8> %off) nounwind {
78 %A = getelementptr i8, <4 x i8*> %param, <4 x i8> %off
84 ; The size of each element is 1 byte. No need to multiply by element size.
86 define <4 x i8*> @AGEP6(<4 x i8*> %param, <4 x i32> %off) nounwind {
90 %A = getelementptr i8, <4 x i8*> %param, <4 x i32> %off