• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt < %s -mcpu=pwr7 -mattr=+vsx -loop-vectorize -instcombine -S | FileCheck %s
2target 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 16
8@ntimes = external hidden unnamed_addr global i32, align 4
9
10define signext i32 @s173() #0 {
11entry:
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
15
16for.cond1.preheader:                              ; preds = %for.end, %entry
17  %nl.022 = phi i32 [ %inc11, %for.end ], [ 0, %entry ]
18  br label %for.body3
19
20for.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
33
34for.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
40
41for.end12:                                        ; preds = %for.end, %entry
42  ret i32 0
43
44; CHECK-LABEL: @s173
45; CHECK: load <4 x float>, <4 x float>*
46; CHECK: add nsw i64 %1, 16000
47; CHECK: ret i32 0
48}
49
50attributes #0 = { nounwind }
51
52