1 ; RUN: opt -S -mtriple=powerpc64-linux-gnu -mcpu=pwr9 -mattr=+vsx -slp-vectorizer < %s | FileCheck %s --check-prefix=CHECK-P9
2 ; RUN: opt -S -mtriple=powerpc64-linux-gnu -mcpu=pwr8 -mattr=+vsx -slp-vectorizer < %s | FileCheck %s --check-prefix=CHECK-P8
4 %struct._pp = type { i16, i16, i16, i16 }
6 ; Function Attrs: norecurse nounwind readonly
7 define [5 x double] @foo(double %k, i64 %n, %struct._pp* nocapture readonly %p) local_unnamed_addr #0 {
9 %cmp17 = icmp sgt i64 %n, 0
10 br i1 %cmp17, label %for.body, label %for.cond.cleanup
12 for.cond.cleanup: ; preds = %for.body, %entry
13 %retval.sroa.0.0.lcssa = phi double [ 0.000000e+00, %entry ], [ %add, %for.body ]
14 %retval.sroa.4.0.lcssa = phi double [ 0.000000e+00, %entry ], [ %add10, %for.body ]
15 %.fca.0.insert = insertvalue [5 x double] undef, double %retval.sroa.0.0.lcssa, 0
16 %.fca.1.insert = insertvalue [5 x double] %.fca.0.insert, double %retval.sroa.4.0.lcssa, 1
17 ret [5 x double] %.fca.1.insert
19 for.body: ; preds = %entry, %for.body
20 %i.020 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
21 %retval.sroa.4.019 = phi double [ %add10, %for.body ], [ 0.000000e+00, %entry ]
22 %retval.sroa.0.018 = phi double [ %add, %for.body ], [ 0.000000e+00, %entry ]
23 %r1 = getelementptr inbounds %struct._pp, %struct._pp* %p, i64 %i.020, i32 2
24 %0 = load i16, i16* %r1, align 2
25 %conv2 = uitofp i16 %0 to double
26 %mul = fmul double %conv2, %k
27 %add = fadd double %retval.sroa.0.018, %mul
28 %g5 = getelementptr inbounds %struct._pp, %struct._pp* %p, i64 %i.020, i32 1
29 %1 = load i16, i16* %g5, align 2
30 %conv7 = uitofp i16 %1 to double
31 %mul8 = fmul double %conv7, %k
32 %add10 = fadd double %retval.sroa.4.019, %mul8
33 %inc = add nuw nsw i64 %i.020, 1
34 %exitcond = icmp eq i64 %inc, %n
35 br i1 %exitcond, label %for.cond.cleanup, label %for.body
38 ; CHECK-P8: load <2 x i16>
39 ; CHECK-P9-NOT: load <2 x i16>