1 ; RUN: opt -mtriple=x86_64-unknown-linux-gnu -vector-library=SVML -passes=inject-tli-mappings -S < %s | FileCheck %s --check-prefixes=COMMON,SVML
2 ; RUN: opt -mtriple=powerpc64-unknown-linux-gnu -vector-library=MASSV -passes=inject-tli-mappings -S < %s | FileCheck %s --check-prefixes=COMMON,MASSV
3 ; RUN: opt -mtriple=x86_64-unknown-linux-gnu -vector-library=LIBMVEC-X86 -passes=inject-tli-mappings -S < %s | FileCheck %s --check-prefixes=COMMON,LIBMVEC-X86
4 ; RUN: opt -mtriple=x86_64-unknown-linux-gnu -vector-library=Accelerate -passes=inject-tli-mappings -S < %s | FileCheck %s --check-prefixes=COMMON,ACCELERATE
5 ; RUN: opt -mtriple=aarch64-unknown-linux-gnu -vector-library=sleefgnuabi -passes=inject-tli-mappings -S < %s | FileCheck %s --check-prefixes=COMMON,SLEEFGNUABI
6 ; RUN: opt -mtriple=aarch64-unknown-linux-gnu -vector-library=ArmPL -passes=inject-tli-mappings -S < %s | FileCheck %s --check-prefixes=COMMON,ARMPL
8 ; COMMON-LABEL: @llvm.compiler.used = appending global
9 ; SVML-SAME: [6 x ptr] [
10 ; SVML-SAME: ptr @__svml_sin2,
11 ; SVML-SAME: ptr @__svml_sin4,
12 ; SVML-SAME: ptr @__svml_sin8,
13 ; SVML-SAME: ptr @__svml_log10f4,
14 ; SVML-SAME: ptr @__svml_log10f8,
15 ; SVML-SAME: ptr @__svml_log10f16
16 ; MASSV-SAME: [2 x ptr] [
17 ; MASSV-SAME: ptr @__sind2,
18 ; MASSV-SAME: ptr @__log10f4
19 ; ACCELERATE-SAME: [1 x ptr] [
20 ; ACCELERATE-SAME: ptr @vlog10f
21 ; LIBMVEC-X86-SAME: [2 x ptr] [
22 ; LIBMVEC-X86-SAME: ptr @_ZGVbN2v_sin,
23 ; LIBMVEC-X86-SAME: ptr @_ZGVdN4v_sin
24 ; SLEEFGNUABI-SAME: [4 x ptr] [
25 ; SLEEFGNUABI-SAME: ptr @_ZGVnN2v_sin,
26 ; SLEEFGNUABI-SAME: ptr @_ZGVsMxv_sin,
27 ; SLEEFGNUABI_SAME; ptr @_ZGVnN4v_log10f,
28 ; SLEEFGNUABI-SAME: ptr @_ZGVsMxv_log10f
29 ; ARMPL-SAME: [4 x ptr] [
30 ; ARMPL-SAME: ptr @armpl_vsinq_f64,
31 ; ARMPL-SAME: ptr @armpl_svsin_f64_x,
32 ; ARMPL-SAME: ptr @armpl_vlog10q_f32,
33 ; ARMPL-SAME: ptr @armpl_svlog10_f32_x
34 ; COMMON-SAME: ], section "llvm.metadata"
36 define double @sin_f64(double %in) {
37 ; COMMON-LABEL: @sin_f64(
38 ; SVML: call double @sin(double %{{.*}}) #[[SIN:[0-9]+]]
39 ; MASSV: call double @sin(double %{{.*}}) #[[SIN:[0-9]+]]
40 ; ACCELERATE: call double @sin(double %{{.*}})
41 ; LIBMVEC-X86: call double @sin(double %{{.*}}) #[[SIN:[0-9]+]]
42 ; SLEEFGNUABI: call double @sin(double %{{.*}}) #[[SIN:[0-9]+]]
43 ; ARMPL: call double @sin(double %{{.*}}) #[[SIN:[0-9]+]]
44 ; No mapping of "sin" to a vector function for Accelerate.
45 ; ACCELERATE-NOT: _ZGV_LLVM_{{.*}}_sin({{.*}})
46 %call = tail call double @sin(double %in)
50 declare double @sin(double) #0
52 define float @call_llvm.log10.f32(float %in) {
53 ; COMMON-LABEL: @call_llvm.log10.f32(
54 ; SVML: call float @llvm.log10.f32(float %{{.*}})
55 ; LIBMVEC-X86: call float @llvm.log10.f32(float %{{.*}})
56 ; MASSV: call float @llvm.log10.f32(float %{{.*}}) #[[LOG10:[0-9]+]]
57 ; ACCELERATE: call float @llvm.log10.f32(float %{{.*}}) #[[LOG10:[0-9]+]]
58 ; SLEEFGNUABI: call float @llvm.log10.f32(float %{{.*}}) #[[LOG10:[0-9]+]]
59 ; ARMPL: call float @llvm.log10.f32(float %{{.*}}) #[[LOG10:[0-9]+]]
60 ; No mapping of "llvm.log10.f32" to a vector function for SVML.
61 ; SVML-NOT: _ZGV_LLVM_{{.*}}_llvm.log10.f32({{.*}})
62 ; LIBMVEC-X86-NOT: _ZGV_LLVM_{{.*}}_llvm.log10.f32({{.*}})
63 %call = tail call float @llvm.log10.f32(float %in)
67 declare float @llvm.log10.f32(float) #0
68 attributes #0 = { nounwind readnone }
70 ; SVML: attributes #[[SIN]] = { "vector-function-abi-variant"=
71 ; SVML-SAME: "_ZGV_LLVM_N2v_sin(__svml_sin2),
72 ; SVML-SAME: _ZGV_LLVM_N4v_sin(__svml_sin4),
73 ; SVML-SAME: _ZGV_LLVM_N8v_sin(__svml_sin8)" }
75 ; MASSV: attributes #[[SIN]] = { "vector-function-abi-variant"=
76 ; MASSV-SAME: "_ZGV_LLVM_N2v_sin(__sind2)" }
77 ; MASSV: attributes #[[LOG10]] = { "vector-function-abi-variant"=
78 ; MASSV-SAME: "_ZGV_LLVM_N4v_llvm.log10.f32(__log10f4)" }
80 ; ACCELERATE: attributes #[[LOG10]] = { "vector-function-abi-variant"=
81 ; ACCELERATE-SAME: "_ZGV_LLVM_N4v_llvm.log10.f32(vlog10f)" }
83 ; LIBMVEC-X86: attributes #[[SIN]] = { "vector-function-abi-variant"=
84 ; LIBMVEC-X86-SAME: "_ZGV_LLVM_N2v_sin(_ZGVbN2v_sin),
85 ; LIBMVEC-X86-SAME: _ZGV_LLVM_N4v_sin(_ZGVdN4v_sin)" }
87 ; SLEEFGNUABI: attributes #[[SIN]] = { "vector-function-abi-variant"=
88 ; SLEEFGNUABI-SAME: "_ZGV_LLVM_N2v_sin(_ZGVnN2v_sin),
89 ; SLEEFGNUABI-SAME: _ZGVsMxv_sin(_ZGVsMxv_sin)" }
90 ; SLEEFGNUABI: attributes #[[LOG10]] = { "vector-function-abi-variant"=
91 ; SLEEFGNUABI-SAME: "_ZGV_LLVM_N4v_llvm.log10.f32(_ZGVnN4v_log10f),
92 ; SLEEFGNUABI-SAME: _ZGVsMxv_llvm.log10.f32(_ZGVsMxv_log10f)" }
94 ; ARMPL: attributes #[[SIN]] = { "vector-function-abi-variant"=
95 ; ARMPL-SAME: "_ZGV_LLVM_N2v_sin(armpl_vsinq_f64),
96 ; ARMPL-SAME _ZGVsMxv_sin(armpl_svsin_f64_x)" }
97 ; ARMPL: attributes #[[LOG10]] = { "vector-function-abi-variant"=
98 ; ARMPL-SAME: "_ZGV_LLVM_N4v_llvm.log10.f32(armpl_vlog10q_f32),
99 ; ARMPL-SAME _ZGVsMxv_llvm.log10.f32(armpl_svlog10_f32_x)" }