52 lines · plain
1; RUN: opt < %s -mcpu=pwr7 -mattr=+vsx -passes=loop-vectorize,instcombine -S | FileCheck %s2target datalayout = "E-m:e-i64:64-n32:64"3target triple = "powerpc64-unknown-linux-gnu"4 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]] }6 7@global_data = external global %struct.GlobalData, align 168@ntimes = external hidden unnamed_addr global i32, align 49 10define signext i32 @s173() #0 {11entry:12 %0 = load i32, ptr @ntimes, align 413 %cmp21 = icmp sgt i32 %0, 014 br i1 %cmp21, label %for.cond1.preheader, label %for.end1215 16for.cond1.preheader: ; preds = %for.end, %entry17 %nl.022 = phi i32 [ %inc11, %for.end ], [ 0, %entry ]18 br label %for.body319 20for.body3: ; preds = %for.body3, %for.cond1.preheader21 %indvars.iv = phi i64 [ 0, %for.cond1.preheader ], [ %indvars.iv.next, %for.body3 ]22 %arrayidx = getelementptr inbounds %struct.GlobalData, ptr @global_data, i64 0, i32 0, i64 %indvars.iv23 %1 = load float, ptr %arrayidx, align 424 %arrayidx5 = getelementptr inbounds %struct.GlobalData, ptr @global_data, i64 0, i32 3, i64 %indvars.iv25 %2 = load float, ptr %arrayidx5, align 426 %add = fadd float %1, %227 %3 = add nsw i64 %indvars.iv, 1600028 %arrayidx8 = getelementptr inbounds %struct.GlobalData, ptr @global_data, i64 0, i32 0, i64 %329 store float %add, ptr %arrayidx8, align 430 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 131 %exitcond = icmp eq i64 %indvars.iv.next, 1600032 br i1 %exitcond, label %for.end, label %for.body333 34for.end: ; preds = %for.body335 %inc11 = add nsw i32 %nl.022, 136 %4 = load i32, ptr @ntimes, align 437 %mul = mul nsw i32 %4, 1038 %cmp = icmp slt i32 %inc11, %mul39 br i1 %cmp, label %for.cond1.preheader, label %for.end1240 41for.end12: ; preds = %for.end, %entry42 ret i32 043 44; CHECK-LABEL: @s17345; CHECK: load <4 x float>, ptr46; CHECK: add nsw i64 %index, 1600047; CHECK: ret i32 048}49 50attributes #0 = { nounwind }51 52