llvm/llvm/lib/Analysis/TargetLibraryInfo.cpp

//===-- TargetLibraryInfo.cpp - Runtime library information ----------------==//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file implements the TargetLibraryInfo class.
//
//===----------------------------------------------------------------------===//

#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Module.h"
#include "llvm/InitializePasses.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/TargetParser/Triple.h"
usingnamespacellvm;

static cl::opt<TargetLibraryInfoImpl::VectorLibrary> ClVectorLibrary(
    "vector-library", cl::Hidden, cl::desc("Vector functions library"),
    cl::init(TargetLibraryInfoImpl::NoLibrary),
    cl::values(clEnumValN(TargetLibraryInfoImpl::NoLibrary, "none",
                          "No vector functions library"),
               clEnumValN(TargetLibraryInfoImpl::Accelerate, "Accelerate",
                          "Accelerate framework"),
               clEnumValN(TargetLibraryInfoImpl::DarwinLibSystemM,
                          "Darwin_libsystem_m", "Darwin libsystem_m"),
               clEnumValN(TargetLibraryInfoImpl::LIBMVEC_X86, "LIBMVEC-X86",
                          "GLIBC Vector Math library"),
               clEnumValN(TargetLibraryInfoImpl::MASSV, "MASSV",
                          "IBM MASS vector library"),
               clEnumValN(TargetLibraryInfoImpl::SVML, "SVML",
                          "Intel SVML library"),
               clEnumValN(TargetLibraryInfoImpl::SLEEFGNUABI, "sleefgnuabi",
                          "SIMD Library for Evaluating Elementary Functions"),
               clEnumValN(TargetLibraryInfoImpl::ArmPL, "ArmPL",
                          "Arm Performance Libraries"),
               clEnumValN(TargetLibraryInfoImpl::AMDLIBM, "AMDLIBM",
                          "AMD vector math library")));

StringLiteral const TargetLibraryInfoImpl::StandardNames[LibFunc::NumLibFuncs] =;

std::string VecDesc::getVectorFunctionABIVariantString() const {}

// Recognized types of library function arguments and return types.
enum FuncArgTypeID : char {};

FuncProtoTy;

static const FuncProtoTy Signatures[] =;

static_assert;

static bool hasSinCosPiStret(const Triple &T) {}

static bool hasBcmp(const Triple &TT) {}

static bool isCallingConvCCompatible(CallingConv::ID CC, StringRef TT,
                                     FunctionType *FuncTy) {}

bool TargetLibraryInfoImpl::isCallingConvCCompatible(CallBase *CI) {}

bool TargetLibraryInfoImpl::isCallingConvCCompatible(Function *F) {}

static void initializeBase(TargetLibraryInfoImpl &TLI, const Triple &T) {}

/// Initialize the set of available library functions based on the specified
/// target triple. This should be carefully written so that a missing target
/// triple gets a sane set of defaults.
static void initializeLibCalls(TargetLibraryInfoImpl &TLI, const Triple &T,
                               ArrayRef<StringLiteral> StandardNames) {}

/// Initialize the set of available library functions based on the specified
/// target triple. This should be carefully written so that a missing target
/// triple gets a sane set of defaults.
static void initialize(TargetLibraryInfoImpl &TLI, const Triple &T,
                       ArrayRef<StringLiteral> StandardNames) {}

TargetLibraryInfoImpl::TargetLibraryInfoImpl() {}

TargetLibraryInfoImpl::TargetLibraryInfoImpl(const Triple &T) {}

TargetLibraryInfoImpl::TargetLibraryInfoImpl(const TargetLibraryInfoImpl &TLI)
    :{}

TargetLibraryInfoImpl::TargetLibraryInfoImpl(TargetLibraryInfoImpl &&TLI)
    :{}

TargetLibraryInfoImpl &TargetLibraryInfoImpl::operator=(const TargetLibraryInfoImpl &TLI) {}

TargetLibraryInfoImpl &TargetLibraryInfoImpl::operator=(TargetLibraryInfoImpl &&TLI) {}

static StringRef sanitizeFunctionName(StringRef funcName) {}

static DenseMap<StringRef, LibFunc>
buildIndexMap(ArrayRef<StringLiteral> StandardNames) {}

bool TargetLibraryInfoImpl::getLibFunc(StringRef funcName, LibFunc &F) const {}

// Return true if ArgTy matches Ty.

static bool matchType(FuncArgTypeID ArgTy, const Type *Ty, unsigned IntBits,
                      unsigned SizeTBits) {}

static bool isValidProtoForSizeReturningNew(const FunctionType &FTy, LibFunc F,
                                            const Module &M,
                                            int SizeTSizeBits) {}

bool TargetLibraryInfoImpl::isValidProtoForLibFunc(const FunctionType &FTy,
                                                   LibFunc F,
                                                   const Module &M) const {}

bool TargetLibraryInfoImpl::getLibFunc(const Function &FDecl,
                                       LibFunc &F) const {}

bool TargetLibraryInfoImpl::getLibFunc(unsigned int Opcode, Type *Ty,
                                       LibFunc &F) const {}

void TargetLibraryInfoImpl::disableAllFunctions() {}

static bool compareByScalarFnName(const VecDesc &LHS, const VecDesc &RHS) {}

static bool compareByVectorFnName(const VecDesc &LHS, const VecDesc &RHS) {}

static bool compareWithScalarFnName(const VecDesc &LHS, StringRef S) {}

void TargetLibraryInfoImpl::addVectorizableFunctions(ArrayRef<VecDesc> Fns) {}

static const VecDesc VecFuncs_Accelerate[] =;

static const VecDesc VecFuncs_DarwinLibSystemM[] =;

static const VecDesc VecFuncs_LIBMVEC_X86[] =;

static const VecDesc VecFuncs_MASSV[] =;

static const VecDesc VecFuncs_SVML[] =;

static const VecDesc VecFuncs_SLEEFGNUABI_VF2[] =;
static const VecDesc VecFuncs_SLEEFGNUABI_VF4[] =;
static const VecDesc VecFuncs_SLEEFGNUABI_VFScalable[] =;

static const VecDesc VecFuncs_ArmPL[] =;

const VecDesc VecFuncs_AMDLIBM[] =;

void TargetLibraryInfoImpl::addVectorizableFunctionsFromVecLib(
    enum VectorLibrary VecLib, const llvm::Triple &TargetTriple) {}

bool TargetLibraryInfoImpl::isFunctionVectorizable(StringRef funcName) const {}

StringRef TargetLibraryInfoImpl::getVectorizedFunction(StringRef F,
                                                       const ElementCount &VF,
                                                       bool Masked) const {}

const VecDesc *
TargetLibraryInfoImpl::getVectorMappingInfo(StringRef F, const ElementCount &VF,
                                            bool Masked) const {}

TargetLibraryInfo TargetLibraryAnalysis::run(const Function &F,
                                             FunctionAnalysisManager &) {}

unsigned TargetLibraryInfoImpl::getWCharSize(const Module &M) const {}

unsigned TargetLibraryInfoImpl::getSizeTSize(const Module &M) const {}

TargetLibraryInfoWrapperPass::TargetLibraryInfoWrapperPass()
    :{}

TargetLibraryInfoWrapperPass::TargetLibraryInfoWrapperPass(const Triple &T)
    :{}

TargetLibraryInfoWrapperPass::TargetLibraryInfoWrapperPass(
    const TargetLibraryInfoImpl &TLIImpl)
    :{}

TargetLibraryInfoWrapperPass::TargetLibraryInfoWrapperPass(
    const TargetLibraryInfo &TLIOther)
    :{}

AnalysisKey TargetLibraryAnalysis::Key;

// Register the basic pass.
INITIALIZE_PASS()
char TargetLibraryInfoWrapperPass::ID =;

void TargetLibraryInfoWrapperPass::anchor() {}

void TargetLibraryInfoImpl::getWidestVF(StringRef ScalarF,
                                        ElementCount &FixedVF,
                                        ElementCount &ScalableVF) const {}