]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Transforms/LoopVectorize/PowerPC/vsx-tsvc-s173.ll
Vendor import of llvm RELEASE_350/final tag r216957 (effectively, 3.5.0 release):
[FreeBSD/FreeBSD.git] / test / Transforms / LoopVectorize / PowerPC / vsx-tsvc-s173.ll
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"
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
10 define signext i32 @s173() #0 {
11 entry:
12   %0 = load i32* @ntimes, align 4
13   %cmp21 = icmp sgt i32 %0, 0
14   br i1 %cmp21, label %for.cond1.preheader, label %for.end12
15
16 for.cond1.preheader:                              ; preds = %for.end, %entry
17   %nl.022 = phi i32 [ %inc11, %for.end ], [ 0, %entry ]
18   br label %for.body3
19
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* @global_data, i64 0, i32 0, i64 %indvars.iv
23   %1 = load float* %arrayidx, align 4
24   %arrayidx5 = getelementptr inbounds %struct.GlobalData* @global_data, i64 0, i32 3, i64 %indvars.iv
25   %2 = load float* %arrayidx5, align 4
26   %add = fadd float %1, %2
27   %3 = add nsw i64 %indvars.iv, 16000
28   %arrayidx8 = getelementptr inbounds %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
34 for.end:                                          ; preds = %for.body3
35   %inc11 = add nsw i32 %nl.022, 1
36   %4 = load 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
41 for.end12:                                        ; preds = %for.end, %entry
42   ret i32 0
43
44 ; CHECK-LABEL: @s173
45 ; CHECK: load <4 x float>*
46 ; CHECK: add i64 %index, 16000
47 ; CHECK: ret i32 0
48 }
49
50 attributes #0 = { nounwind }
51