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