|
LLVM 24.0.0git
|
A simple container for information about the supported runtime calls. More...
#include "llvm/IR/RuntimeLibcalls.h"
Public Member Functions | |
| RuntimeLibcallsInfo ()=default | |
| LLVM_ABI | RuntimeLibcallsInfo (const Triple &TT, ExceptionHandling ExceptionModel=ExceptionHandling::Default, FloatABI::ABIType FloatABI=FloatABI::Default, std::optional< LongDoubleFormat > LDblFormat=std::nullopt, StringRef ABIName="", VectorLibrary VecLib=VectorLibrary::NoLibrary) |
| LLVM_ABI | RuntimeLibcallsInfo (const Module &M, StringRef ABIName="", VectorLibrary VecLib=VectorLibrary::NoLibrary) |
| LLVM_ABI bool | invalidate (Module &M, const PreservedAnalyses &PA, ModuleAnalysisManager::Invalidator &) |
| void | setLibcallImplCallingConv (RTLIB::LibcallImpl Call, CallingConv::ID CC) |
| Set the CallingConv that should be used for the specified libcall implementation. | |
| CallingConv::ID | getLibcallImplCallingConv (RTLIB::LibcallImpl Call) const |
| Get the CallingConv that should be used for the specified libcall. | |
| unsigned | getNumAvailableLibcallImpls () const |
| bool | isAvailable (RTLIB::LibcallImpl Impl) const |
| void | setAvailable (RTLIB::LibcallImpl Impl) |
| void | setUnavailable (RTLIB::LibcallImpl Impl) |
| RTLIB::LibcallImpl | getSupportedLibcallImpl (StringRef FuncName) const |
| Check if this is valid libcall for the current module, otherwise RTLIB::Unsupported. | |
| unsigned | getIntSize (const Triple &TT) const |
| Get size of a C-level int or unsigned int, in bits. | |
| LLVM_ABI std::pair< FunctionType *, AttributeList > | getDefaultFunctionTy (LLVMContext &Ctx, const Triple &TT, const DataLayout &DL, RTLIB::LibcallImpl LibcallImpl) const |
| Get the C-type function signature of the Libcall if provided, and convert it to IR FunctionType and Attributes. | |
| LLVM_ABI std::pair< FunctionType *, AttributeList > | getFunctionTy (LLVMContext &Ctx, const Triple &TT, const DataLayout &DL, RTLIB::LibcallImpl LibcallImpl) const |
Static Public Member Functions | |
| static StringRef | getLibcallImplName (RTLIB::LibcallImpl CallImpl) |
| Get the libcall routine name for the specified libcall implementation. | |
| static RTLIB::Libcall | getLibcallFromImpl (RTLIB::LibcallImpl Impl) |
Return the libcall provided by Impl. | |
| static LLVM_ABI RTLIB::Libcall | getLibcallForIntrinsic (Intrinsic::ID ID, FunctionType *FTy) |
Return the runtime libcall that the floating-point math intrinsic ID may be lowered to, or RTLIB::UNKNOWN_LIBCALL if there is no such mapping. | |
| static iota_range< RTLIB::LibcallImpl > | lookupLibcallImplName (StringRef Name) |
| Check if a function name is a recognized runtime call of any kind. | |
| static LLVM_ABI RTLIB::Libcall | getUnmaskedVectorLibcall (RTLIB::Libcall LC) |
Return the unmasked variant of the masked vector libcall LC, or RTLIB::UNKNOWN_LIBCALL if LC is not a masked vector libcall. | |
| static LLVM_ABI RTLIB::Libcall | getMaskedVectorLibcall (RTLIB::Libcall LC) |
Return the masked variant of the vector libcall LC, or RTLIB::UNKNOWN_LIBCALL if LC has no masked variant. | |
| static bool | hasVectorMaskArgument (RTLIB::LibcallImpl Impl) |
| Returns true if the function has a vector mask argument, which is assumed to be the last argument. | |
Friends | |
| class | llvm::LibcallLoweringInfo |
A simple container for information about the supported runtime calls.
Definition at line 79 of file RuntimeLibcalls.h.
|
default |
References llvm::Default, llvm::FloatABI::Default, LLVM_ABI, and llvm::NoLibrary.
Referenced by RuntimeLibcallsInfo().
|
explicit |
Definition at line 56 of file RuntimeLibcalls.cpp.
References llvm::Default, getVectorRuntimeLibrary(), and llvm::NoLibrary.
|
explicit |
Definition at line 76 of file RuntimeLibcalls.cpp.
References RuntimeLibcallsInfo().
| std::pair< FunctionType *, AttributeList > RuntimeLibcallsInfo::getDefaultFunctionTy | ( | LLVMContext & | Ctx, |
| const Triple & | TT, | ||
| const DataLayout & | DL, | ||
| RTLIB::LibcallImpl | LibcallImpl ) const |
Get the C-type function signature of the Libcall if provided, and convert it to IR FunctionType and Attributes.
If the C-type function signature is not provided, return nullptr.
Definition at line 234 of file RuntimeLibcalls.cpp.
References assert(), CommonFnAttrs, convertToIRTypeAndAttr(), DL, llvm::FunctionType::get(), getIntSize(), getLibcallFromImpl(), getLongDoubleType(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and RetAttr.
Referenced by getFunctionTy().
| std::pair< FunctionType *, AttributeList > RuntimeLibcallsInfo::getFunctionTy | ( | LLVMContext & | Ctx, |
| const Triple & | TT, | ||
| const DataLayout & | DL, | ||
| RTLIB::LibcallImpl | LibcallImpl ) const |
LibcallImpl, depending on the target TT. If the function has incomplete type information, return nullptr for the function type. Definition at line 293 of file RuntimeLibcalls.cpp.
References llvm::Alloc, llvm::MemoryEffectsBase< IRMemLocation >::argMemOnly(), llvm::MemoryEffectsBase< IRMemLocation >::argumentOrErrnoMemOnly(), llvm::ARM::ARM_ABI_APCS, CommonFnAttrs, llvm::ARM::computeTargetABI(), DL, llvm::enumerate(), llvm::MemoryEffectsBase< IRMemLocation >::errnoMemOnly(), llvm::fcNegInf, llvm::fcNegNormal, llvm::fcNegSubnormal, llvm::Free, llvm::FixedVectorType::get(), llvm::FunctionType::get(), llvm::IntegerType::get(), llvm::PointerType::get(), llvm::StructType::get(), getDefaultFunctionTy(), llvm::Type::getDoubleTy(), llvm::Type::getFloatTy(), getSizeTType(), llvm::Type::getVoidTy(), llvm::Attribute::getWithNoFPClass(), llvm_unreachable, llvm::Mod, llvm::NoModRef, llvm::CaptureInfo::none(), llvm::MemoryEffectsBase< IRMemLocation >::none(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::Uninitialized.
Referenced by llvm::DeclareRuntimeLibcallsPass::run().
Get size of a C-level int or unsigned int, in bits.
Definition at line 186 of file RuntimeLibcalls.h.
Referenced by getDefaultFunctionTy().
|
static |
Return the runtime libcall that the floating-point math intrinsic ID may be lowered to, or RTLIB::UNKNOWN_LIBCALL if there is no such mapping.
FTy must be the intrinsic's call signature.
References LLVM_ABI.
|
inlinestatic |
Return the libcall provided by Impl.
Definition at line 131 of file RuntimeLibcalls.h.
Referenced by getDefaultFunctionTy(), hasVectorMaskArgument(), llvm::MipsSubtarget::initLibcallLoweringInfo(), and llvm::LibcallLoweringInfo::LibcallLoweringInfo().
|
inline |
Get the CallingConv that should be used for the specified libcall.
Definition at line 126 of file RuntimeLibcalls.h.
References Call.
Referenced by llvm::DeclareRuntimeLibcallsPass::run().
|
inlinestatic |
Get the libcall routine name for the specified libcall implementation.
Definition at line 111 of file RuntimeLibcalls.h.
Referenced by llvm::LegalizerHelper::createAtomicLibcall(), CreateFailBB(), llvm::LegalizerHelper::createLibcall(), llvm::LegalizerHelper::createMemLibcall(), llvm::TargetLoweringBase::getDefaultSafeStackPointerLocation(), llvm::SelectionDAG::getExternalSymbol(), llvm::TargetLoweringBase::getLibcallImplName(), llvm::LibcallLoweringInfo::getLibcallName(), llvm::lto::LTO::getRuntimeLibcallSymbols(), llvm::TargetLoweringBase::getSafeStackPointerLocation(), llvm::SelectionDAG::getTargetExternalSymbol(), lowerObjCCall(), peephole(), and llvm::DeclareRuntimeLibcallsPass::run().
|
static |
Return the masked variant of the vector libcall LC, or RTLIB::UNKNOWN_LIBCALL if LC has no masked variant.
References LLVM_ABI.
Referenced by llvm::LibcallLoweringInfo::getVectorLibcallImplOrMasked().
|
inline |
Definition at line 142 of file RuntimeLibcalls.h.
Referenced by llvm::lto::LTO::getRuntimeLibcallSymbols().
|
inline |
Check if this is valid libcall for the current module, otherwise RTLIB::Unsupported.
Definition at line 175 of file RuntimeLibcalls.h.
References isAvailable(), and lookupLibcallImplName().
Referenced by llvm::lto::InputFile::Symbol::isLibcall().
|
static |
Return the unmasked variant of the masked vector libcall LC, or RTLIB::UNKNOWN_LIBCALL if LC is not a masked vector libcall.
References LLVM_ABI.
Referenced by hasVectorMaskArgument().
|
inlinestatic |
Returns true if the function has a vector mask argument, which is assumed to be the last argument.
Definition at line 214 of file RuntimeLibcalls.h.
References getLibcallFromImpl(), and getUnmaskedVectorLibcall().
Referenced by llvm::TargetLowering::expandMultipleResultFPLibCall().
| bool RTLIB::RuntimeLibcallsInfo::invalidate | ( | Module & | M, |
| const PreservedAnalyses & | PA, | ||
| ModuleAnalysisManager::Invalidator & | ) |
Definition at line 41 of file RuntimeLibcallInfo.cpp.
References llvm::PreservedAnalyses::getChecker().
|
inline |
Definition at line 146 of file RuntimeLibcalls.h.
Referenced by llvm::lto::LTO::getRuntimeLibcallSymbols(), getSupportedLibcallImpl(), llvm::ARMSubtarget::initLibcallLoweringInfo(), and llvm::DeclareRuntimeLibcallsPass::run().
|
inlinestatic |
Check if a function name is a recognized runtime call of any kind.
This does not consider if this call is available for any current compilation, just that it is a known call somewhere. This returns the set of all LibcallImpls which match the name; multiple implementations with the same name may exist but differ in interpretation based on the target context.
Generated by tablegen.
Definition at line 166 of file RuntimeLibcalls.h.
Referenced by getSupportedLibcallImpl(), and isMips16HardFloatLibcall().
|
inline |
Definition at line 150 of file RuntimeLibcalls.h.
|
inline |
Set the CallingConv that should be used for the specified libcall implementation.
Definition at line 121 of file RuntimeLibcalls.h.
References Call.
|
inline |
Definition at line 154 of file RuntimeLibcalls.h.
|
friend |
Definition at line 87 of file RuntimeLibcalls.h.