xref: /llvm-project/llvm/test/Transforms/LoopVectorize/PowerPC/massv-nobuiltin.ll (revision 7d7577256b76e4293f455b8093504d5f7044ab4b)
1; RUN: opt -vector-library=MASSV -passes=inject-tli-mappings,loop-vectorize -force-vector-interleave=1 -S < %s | FileCheck %s
2
3target datalayout = "e-m:e-i64:64-n32:64"
4target triple = "powerpc64le-unknown-linux-gnu"
5
6declare double @atanh(double) #1
7declare float @atanhf(float) #1
8
9; Check that functions marked as nobuiltin are not lowered to massv entries.
10define void @atanh_f64(ptr nocapture %varray) {
11; CHECK-LABEL: @atanh_f64(
12; CHECK-NOT: __atanhd2{{.*}}<2 x double>
13; CHECK: ret void
14;
15entry:
16  br label %for.body
17
18for.body:
19  %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
20  %tmp = trunc i64 %iv to i32
21  %conv = sitofp i32 %tmp to double
22  %call = tail call double @atanh(double %conv)
23  %arrayidx = getelementptr inbounds double, ptr %varray, i64 %iv
24  store double %call, ptr %arrayidx, align 4
25  %iv.next = add nuw nsw i64 %iv, 1
26  %exitcond = icmp eq i64 %iv.next, 1000
27  br i1 %exitcond, label %for.end, label %for.body
28
29for.end:
30  ret void
31}
32
33define void @atanh_f32(ptr nocapture %varray) {
34; CHECK-LABEL: @atanh_f32(
35; CHECK-NOT: __atanhf4{{.*}}<2 x double>
36; CHECK: ret void
37;
38entry:
39  br label %for.body
40
41for.body:
42  %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
43  %tmp = trunc i64 %iv to i32
44  %conv = sitofp i32 %tmp to float
45  %call = tail call float @atanhf(float %conv)
46  %arrayidx = getelementptr inbounds float, ptr %varray, i64 %iv
47  store float %call, ptr %arrayidx, align 4
48  %iv.next = add nuw nsw i64 %iv, 1
49  %exitcond = icmp eq i64 %iv.next, 1000
50  br i1 %exitcond, label %for.end, label %for.body
51
52for.end:
53  ret void
54}
55
56attributes #1 = { nobuiltin nounwind }
57