1 ; RUN: opt -vector-library=SVML -inject-tli-mappings -S < %s | FileCheck %s --check-prefixes=COMMON,SVML
2 ; RUN: opt -vector-library=SVML -passes=inject-tli-mappings -S < %s | FileCheck %s --check-prefixes=COMMON,SVML
3 ; RUN: opt -vector-library=MASSV -inject-tli-mappings -S < %s | FileCheck %s --check-prefixes=COMMON,MASSV
4 ; RUN: opt -vector-library=MASSV -passes=inject-tli-mappings -S < %s | FileCheck %s --check-prefixes=COMMON,MASSV
5 ; RUN: opt -vector-library=Accelerate -inject-tli-mappings -S < %s | FileCheck %s --check-prefixes=COMMON,ACCELERATE
6 ; RUN: opt -vector-library=LIBMVEC-X86 -inject-tli-mappings -S < %s | FileCheck %s --check-prefixes=COMMON,LIBMVEC-X86
7 ; RUN: opt -vector-library=LIBMVEC-X86 -passes=inject-tli-mappings -S < %s | FileCheck %s --check-prefixes=COMMON,LIBMVEC-X86
8 ; RUN: opt -vector-library=Accelerate -passes=inject-tli-mappings -S < %s | FileCheck %s --check-prefixes=COMMON,ACCELERATE
10 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
11 target triple = "x86_64-unknown-linux-gnu"
13 ; COMMON-LABEL: @llvm.compiler.used = appending global
14 ; SVML-SAME: [6 x i8*] [
15 ; SVML-SAME: i8* bitcast (<2 x double> (<2 x double>)* @__svml_sin2 to i8*),
16 ; SVML-SAME: i8* bitcast (<4 x double> (<4 x double>)* @__svml_sin4 to i8*),
17 ; SVML-SAME: i8* bitcast (<8 x double> (<8 x double>)* @__svml_sin8 to i8*),
18 ; SVML-SAME: i8* bitcast (<4 x float> (<4 x float>)* @__svml_log10f4 to i8*),
19 ; SVML-SAME: i8* bitcast (<8 x float> (<8 x float>)* @__svml_log10f8 to i8*),
20 ; SVML-SAME: i8* bitcast (<16 x float> (<16 x float>)* @__svml_log10f16 to i8*)
21 ; MASSV-SAME: [2 x i8*] [
22 ; MASSV-SAME: i8* bitcast (<2 x double> (<2 x double>)* @__sind2 to i8*),
23 ; MASSV-SAME: i8* bitcast (<4 x float> (<4 x float>)* @__log10f4 to i8*)
24 ; ACCELERATE-SAME: [1 x i8*] [
25 ; ACCELERATE-SAME: i8* bitcast (<4 x float> (<4 x float>)* @vlog10f to i8*)
26 ; LIBMVEC-X86-SAME: [2 x i8*] [
27 ; LIBMVEC-X86-SAME: i8* bitcast (<2 x double> (<2 x double>)* @_ZGVbN2v_sin to i8*),
28 ; LIBMVEC-X86-SAME: i8* bitcast (<4 x double> (<4 x double>)* @_ZGVdN4v_sin to i8*)
29 ; COMMON-SAME: ], section "llvm.metadata"
31 define double @sin_f64(double %in) {
32 ; COMMON-LABEL: @sin_f64(
33 ; SVML: call double @sin(double %{{.*}}) #[[SIN:[0-9]+]]
34 ; MASSV: call double @sin(double %{{.*}}) #[[SIN:[0-9]+]]
35 ; ACCELERATE: call double @sin(double %{{.*}})
36 ; LIBMVEC-X86: call double @sin(double %{{.*}}) #[[SIN:[0-9]+]]
37 ; No mapping of "sin" to a vector function for Accelerate.
38 ; ACCELERATE-NOT: _ZGV_LLVM_{{.*}}_sin({{.*}})
39 %call = tail call double @sin(double %in)
43 declare double @sin(double) #0
45 define float @call_llvm.log10.f32(float %in) {
46 ; COMMON-LABEL: @call_llvm.log10.f32(
47 ; SVML: call float @llvm.log10.f32(float %{{.*}})
48 ; LIBMVEC-X86: call float @llvm.log10.f32(float %{{.*}})
49 ; MASSV: call float @llvm.log10.f32(float %{{.*}}) #[[LOG10:[0-9]+]]
50 ; ACCELERATE: call float @llvm.log10.f32(float %{{.*}}) #[[LOG10:[0-9]+]]
51 ; No mapping of "llvm.log10.f32" to a vector function for SVML.
52 ; SVML-NOT: _ZGV_LLVM_{{.*}}_llvm.log10.f32({{.*}})
53 ; LIBMVEC-X86-NOT: _ZGV_LLVM_{{.*}}_llvm.log10.f32({{.*}})
54 %call = tail call float @llvm.log10.f32(float %in)
58 declare float @llvm.log10.f32(float) #0
59 attributes #0 = { nounwind readnone }
61 ; SVML: attributes #[[SIN]] = { "vector-function-abi-variant"=
62 ; SVML-SAME: "_ZGV_LLVM_N2v_sin(__svml_sin2),
63 ; SVML-SAME: _ZGV_LLVM_N4v_sin(__svml_sin4),
64 ; SVML-SAME: _ZGV_LLVM_N8v_sin(__svml_sin8)" }
66 ; MASSV: attributes #[[SIN]] = { "vector-function-abi-variant"=
67 ; MASSV-SAME: "_ZGV_LLVM_N2v_sin(__sind2)" }
68 ; MASSV: attributes #[[LOG10]] = { "vector-function-abi-variant"=
69 ; MASSV-SAME: "_ZGV_LLVM_N4v_llvm.log10.f32(__log10f4)" }
71 ; ACCELERATE: attributes #[[LOG10]] = { "vector-function-abi-variant"=
72 ; ACCELERATE-SAME: "_ZGV_LLVM_N4v_llvm.log10.f32(vlog10f)" }
74 ; LIBMVEC-X86: attributes #[[SIN]] = { "vector-function-abi-variant"=
75 ; LIBMVEC-X86-SAME: "_ZGV_LLVM_N2v_sin(_ZGVbN2v_sin),
76 ; LIBMVEC-X86-SAME: _ZGV_LLVM_N4v_sin(_ZGVdN4v_sin)" }