1 ; RUN: opt < %s -mcpu=pwr7 -mattr=+vsx -loop-vectorize -instcombine -S | FileCheck %s
2 target datalayout = "E-m:e-i64:64-n32:64"
3 target triple = "powerpc64-unknown-linux-gnu"
5 %struct.GlobalData = type { [32000 x float], [3 x i32], [4 x i8], [32000 x float], [5 x i32], [12 x i8], [32000 x float], [7 x i32], [4 x i8], [32000 x float], [11 x i32], [4 x i8], [32000 x float], [13 x i32], [12 x i8], [256 x [256 x float]], [17 x i32], [12 x i8], [256 x [256 x float]], [19 x i32], [4 x i8], [256 x [256 x float]], [23 x i32], [4 x i8], [256 x [256 x float]] }
7 @global_data = external global %struct.GlobalData, align 16
8 @ntimes = external hidden unnamed_addr global i32, align 4
10 define signext i32 @s173() #0 {
12 %0 = load i32, i32* @ntimes, align 4
13 %cmp21 = icmp sgt i32 %0, 0
14 br i1 %cmp21, label %for.cond1.preheader, label %for.end12
16 for.cond1.preheader: ; preds = %for.end, %entry
17 %nl.022 = phi i32 [ %inc11, %for.end ], [ 0, %entry ]
20 for.body3: ; preds = %for.body3, %for.cond1.preheader
21 %indvars.iv = phi i64 [ 0, %for.cond1.preheader ], [ %indvars.iv.next, %for.body3 ]
22 %arrayidx = getelementptr inbounds %struct.GlobalData, %struct.GlobalData* @global_data, i64 0, i32 0, i64 %indvars.iv
23 %1 = load float, float* %arrayidx, align 4
24 %arrayidx5 = getelementptr inbounds %struct.GlobalData, %struct.GlobalData* @global_data, i64 0, i32 3, i64 %indvars.iv
25 %2 = load float, float* %arrayidx5, align 4
26 %add = fadd float %1, %2
27 %3 = add nsw i64 %indvars.iv, 16000
28 %arrayidx8 = getelementptr inbounds %struct.GlobalData, %struct.GlobalData* @global_data, i64 0, i32 0, i64 %3
29 store float %add, float* %arrayidx8, align 4
30 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
31 %exitcond = icmp eq i64 %indvars.iv.next, 16000
32 br i1 %exitcond, label %for.end, label %for.body3
34 for.end: ; preds = %for.body3
35 %inc11 = add nsw i32 %nl.022, 1
36 %4 = load i32, i32* @ntimes, align 4
37 %mul = mul nsw i32 %4, 10
38 %cmp = icmp slt i32 %inc11, %mul
39 br i1 %cmp, label %for.cond1.preheader, label %for.end12
41 for.end12: ; preds = %for.end, %entry
45 ; CHECK: load <4 x float>, <4 x float>*
46 ; CHECK: add nsw i64 %index, 16000
50 attributes #0 = { nounwind }