LLVM  8.0.1
Public Member Functions | Friends | List of all members
llvm::TargetLibraryInfo Class Reference

Provides information about what library functions are available for the current target. More...

#include "llvm/Analysis/TargetLibraryInfo.h"

Public Member Functions

 TargetLibraryInfo (const TargetLibraryInfoImpl &Impl)
 
 TargetLibraryInfo (const TargetLibraryInfo &TLI)
 
 TargetLibraryInfo (TargetLibraryInfo &&TLI)
 
TargetLibraryInfooperator= (const TargetLibraryInfo &TLI)
 
TargetLibraryInfooperator= (TargetLibraryInfo &&TLI)
 
bool getLibFunc (StringRef funcName, LibFunc &F) const
 Searches for a particular function name. More...
 
bool getLibFunc (const Function &FDecl, LibFunc &F) const
 
bool getLibFunc (ImmutableCallSite CS, LibFunc &F) const
 If a callsite does not have the 'nobuiltin' attribute, return if the called function is a known library function and set F to that function. More...
 
bool has (LibFunc F) const
 Tests whether a library function is available. More...
 
bool isFunctionVectorizable (StringRef F, unsigned VF) const
 
bool isFunctionVectorizable (StringRef F) const
 
StringRef getVectorizedFunction (StringRef F, unsigned VF) const
 
bool hasOptimizedCodeGen (LibFunc F) const
 Tests if the function is both available and a candidate for optimized code generation. More...
 
StringRef getName (LibFunc F) const
 
Attribute::AttrKind getExtAttrForI32Param (bool Signed=true) const
 Returns extension attribute kind to be used for i32 parameters corresponding to C-level int or unsigned int. More...
 
Attribute::AttrKind getExtAttrForI32Return (bool Signed=true) const
 Returns extension attribute kind to be used for i32 return values corresponding to C-level int or unsigned int. More...
 
unsigned getWCharSize (const Module &M) const
 Returns the size of the wchar_t type in bytes or 0 if the size is unknown. More...
 
bool invalidate (Module &, const PreservedAnalyses &, ModuleAnalysisManager::Invalidator &)
 Handle invalidation from the pass manager. More...
 
bool invalidate (Function &, const PreservedAnalyses &, FunctionAnalysisManager::Invalidator &)
 

Friends

class TargetLibraryAnalysis
 
class TargetLibraryInfoWrapperPass
 

Detailed Description

Provides information about what library functions are available for the current target.

This both allows optimizations to handle them specially and frontends to disable such optimizations through -fno-builtin etc.

Definition at line 206 of file TargetLibraryInfo.h.

Constructor & Destructor Documentation

◆ TargetLibraryInfo() [1/3]

llvm::TargetLibraryInfo::TargetLibraryInfo ( const TargetLibraryInfoImpl Impl)
inlineexplicit

Definition at line 213 of file TargetLibraryInfo.h.

◆ TargetLibraryInfo() [2/3]

llvm::TargetLibraryInfo::TargetLibraryInfo ( const TargetLibraryInfo TLI)
inline

Definition at line 216 of file TargetLibraryInfo.h.

◆ TargetLibraryInfo() [3/3]

llvm::TargetLibraryInfo::TargetLibraryInfo ( TargetLibraryInfo &&  TLI)
inline

Definition at line 217 of file TargetLibraryInfo.h.

Member Function Documentation

◆ getExtAttrForI32Param()

Attribute::AttrKind llvm::TargetLibraryInfo::getExtAttrForI32Param ( bool  Signed = true) const
inline

Returns extension attribute kind to be used for i32 parameters corresponding to C-level int or unsigned int.

May be zeroext, signext, or none.

Definition at line 305 of file TargetLibraryInfo.h.

References llvm::Attribute::None, llvm::Attribute::SExt, Signed, and llvm::Attribute::ZExt.

Referenced by getOrInsertValueProfilingCall(), and shouldKeepInEntry().

◆ getExtAttrForI32Return()

Attribute::AttrKind llvm::TargetLibraryInfo::getExtAttrForI32Return ( bool  Signed = true) const
inline

Returns extension attribute kind to be used for i32 return values corresponding to C-level int or unsigned int.

May be zeroext, signext, or none.

Definition at line 316 of file TargetLibraryInfo.h.

References llvm::Attribute::None, llvm::Attribute::SExt, Signed, and llvm::Attribute::ZExt.

◆ getLibFunc() [1/3]

bool llvm::TargetLibraryInfo::getLibFunc ( StringRef  funcName,
LibFunc F 
) const
inline

◆ getLibFunc() [2/3]

bool llvm::TargetLibraryInfo::getLibFunc ( const Function FDecl,
LibFunc F 
) const
inline

Definition at line 235 of file TargetLibraryInfo.h.

References llvm::TargetLibraryInfoImpl::getLibFunc().

◆ getLibFunc() [3/3]

bool llvm::TargetLibraryInfo::getLibFunc ( ImmutableCallSite  CS,
LibFunc F 
) const
inline

If a callsite does not have the 'nobuiltin' attribute, return if the called function is a known library function and set F to that function.

Definition at line 241 of file TargetLibraryInfo.h.

References llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getCalledFunction(), and llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::isNoBuiltin().

◆ getName()

StringRef llvm::TargetLibraryInfo::getName ( LibFunc  F) const
inline

◆ getVectorizedFunction()

StringRef llvm::TargetLibraryInfo::getVectorizedFunction ( StringRef  F,
unsigned  VF 
) const
inline

◆ getWCharSize()

unsigned llvm::TargetLibraryInfo::getWCharSize ( const Module M) const
inline

Returns the size of the wchar_t type in bytes or 0 if the size is unknown.

This queries the 'wchar_size' metadata.

Definition at line 323 of file TargetLibraryInfo.h.

References llvm::TargetLibraryInfoImpl::getWCharSize().

◆ has()

bool llvm::TargetLibraryInfo::has ( LibFunc  F) const
inline

◆ hasOptimizedCodeGen()

bool llvm::TargetLibraryInfo::hasOptimizedCodeGen ( LibFunc  F) const
inline

Tests if the function is both available and a candidate for optimized code generation.

Definition at line 262 of file TargetLibraryInfo.h.

Referenced by llvm::maybeMarkSanitizerLibraryCallNoBuiltin().

◆ invalidate() [1/2]

bool llvm::TargetLibraryInfo::invalidate ( Module ,
const PreservedAnalyses ,
ModuleAnalysisManager::Invalidator  
)
inline

Handle invalidation from the pass manager.

If we try to invalidate this info, just return false. It cannot become invalid even if the module or function changes.

Definition at line 331 of file TargetLibraryInfo.h.

◆ invalidate() [2/2]

bool llvm::TargetLibraryInfo::invalidate ( Function ,
const PreservedAnalyses ,
FunctionAnalysisManager::Invalidator  
)
inline

Definition at line 335 of file TargetLibraryInfo.h.

◆ isFunctionVectorizable() [1/2]

bool llvm::TargetLibraryInfo::isFunctionVectorizable ( StringRef  F,
unsigned  VF 
) const
inline

◆ isFunctionVectorizable() [2/2]

bool llvm::TargetLibraryInfo::isFunctionVectorizable ( StringRef  F) const
inline

◆ operator=() [1/2]

TargetLibraryInfo& llvm::TargetLibraryInfo::operator= ( const TargetLibraryInfo TLI)
inline

Definition at line 218 of file TargetLibraryInfo.h.

◆ operator=() [2/2]

TargetLibraryInfo& llvm::TargetLibraryInfo::operator= ( TargetLibraryInfo &&  TLI)
inline

Definition at line 222 of file TargetLibraryInfo.h.

Friends And Related Function Documentation

◆ TargetLibraryAnalysis

friend class TargetLibraryAnalysis
friend

Definition at line 207 of file TargetLibraryInfo.h.

◆ TargetLibraryInfoWrapperPass

friend class TargetLibraryInfoWrapperPass
friend

Definition at line 208 of file TargetLibraryInfo.h.


The documentation for this class was generated from the following file: