LLVM 24.0.0git
llvm::LibcallLoweringInfo Class Reference

Tracks which library functions to use for a particular subtarget or function. More...

#include "llvm/Analysis/LibcallLoweringInfo.h"

Public Types

using ApplyContextRulesFn = function_ref<void(LibcallLoweringInfo &)>
 Callback applying the caller's context-specific (e.g.

Public Member Functions

LLVM_ABI LibcallLoweringInfo (const RTLIB::RuntimeLibcallsInfo &RTLCI, ApplyContextRulesFn ApplyContextRules={})
 Construct the lowering info from the module-level RTLCI, seeding the default implementation for every available libcall, then applying the optional ApplyContextRules callback for the caller's context-specific libcall rules.
const RTLIB::RuntimeLibcallsInfo & getRuntimeLibcallsInfo () const
const char * getLibcallName (RTLIB::Libcall Call) const
 Get the libcall routine name for the specified libcall.
RTLIB::LibcallImpl getLibcallImpl (RTLIB::Libcall Call) const
 Return the lowering's selection of implementation call for Call.
RTLIB::LibcallImpl getVectorLibcallImplOrMasked (RTLIB::Libcall Call) const
 Return the implementation for Call, or for its masked variant if Call has no implementation.
void setLibcallImpl (RTLIB::Libcall Call, RTLIB::LibcallImpl Impl)
 Remap the default libcall routine name for the specified libcall.
CallingConv::ID getLibcallCallingConv (RTLIB::Libcall Call) const
CallingConv::ID getLibcallImplCallingConv (RTLIB::LibcallImpl Call) const
 Get the CallingConv that should be used for the specified libcall.
RTLIB::LibcallImpl getMemcpyImpl () const
 Return a function impl compatible with RTLIB::MEMCPY, or RTLIB::Unsupported if fully unsupported.

Detailed Description

Tracks which library functions to use for a particular subtarget or function.

Definition at line 28 of file LibcallLoweringInfo.h.

Member Typedef Documentation

◆ ApplyContextRulesFn

Callback applying the caller's context-specific (e.g.

subtarget) libcall rules on top of the module-level defaults.

Definition at line 38 of file LibcallLoweringInfo.h.

Constructor & Destructor Documentation

◆ LibcallLoweringInfo()

LibcallLoweringInfo::LibcallLoweringInfo ( const RTLIB::RuntimeLibcallsInfo & RTLCI,
ApplyContextRulesFn ApplyContextRules = {} )

Construct the lowering info from the module-level RTLCI, seeding the default implementation for every available libcall, then applying the optional ApplyContextRules callback for the caller's context-specific libcall rules.

Definition at line 14 of file LibcallLoweringInfo.cpp.

References llvm::RTLIB::RuntimeLibcallsInfo::getLibcallFromImpl(), and llvm::RTLIB::libcall_impls().

Member Function Documentation

◆ getLibcallCallingConv()

CallingConv::ID llvm::LibcallLoweringInfo::getLibcallCallingConv ( RTLIB::Libcall Call) const
inline

Definition at line 85 of file LibcallLoweringInfo.h.

References Call.

◆ getLibcallImpl()

◆ getLibcallImplCallingConv()

◆ getLibcallName()

const char * llvm::LibcallLoweringInfo::getLibcallName ( RTLIB::Libcall Call) const
inline

Get the libcall routine name for the specified libcall.

Definition at line 53 of file LibcallLoweringInfo.h.

References Call, llvm::StringRef::data(), and llvm::RTLIB::RuntimeLibcallsInfo::getLibcallImplName().

◆ getMemcpyImpl()

RTLIB::LibcallImpl llvm::LibcallLoweringInfo::getMemcpyImpl ( ) const
inline

Return a function impl compatible with RTLIB::MEMCPY, or RTLIB::Unsupported if fully unsupported.

Definition at line 96 of file LibcallLoweringInfo.h.

References getLibcallImpl().

◆ getRuntimeLibcallsInfo()

const RTLIB::RuntimeLibcallsInfo & llvm::LibcallLoweringInfo::getRuntimeLibcallsInfo ( ) const
inline

Definition at line 47 of file LibcallLoweringInfo.h.

◆ getVectorLibcallImplOrMasked()

RTLIB::LibcallImpl llvm::LibcallLoweringInfo::getVectorLibcallImplOrMasked ( RTLIB::Libcall Call) const
inline

Return the implementation for Call, or for its masked variant if Call has no implementation.

FIXME: Callers should explicitly try the masked variant and track whether a mask argument is needed, instead of re-deriving it from the result with hasVectorMaskArgument.

Definition at line 70 of file LibcallLoweringInfo.h.

References Call, getLibcallImpl(), and llvm::RTLIB::RuntimeLibcallsInfo::getMaskedVectorLibcall().

Referenced by llvm::TargetLowering::expandMultipleResultFPLibCall(), and performVselectPowCombine().

◆ setLibcallImpl()

void llvm::LibcallLoweringInfo::setLibcallImpl ( RTLIB::Libcall Call,
RTLIB::LibcallImpl Impl )
inline

Remap the default libcall routine name for the specified libcall.

Definition at line 79 of file LibcallLoweringInfo.h.

References Call.


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