16#ifndef LLVM_IR_RUNTIME_LIBCALLS_H
17#define LLVM_IR_RUNTIME_LIBCALLS_H
35#define GET_RUNTIME_LIBCALL_ENUM
36#include "llvm/IR/RuntimeLibcalls.inc"
54 return enum_seq(
static_cast<RTLIB::Libcall
>(0), RTLIB::UNKNOWN_LIBCALL);
58 return enum_seq(
static_cast<RTLIB::LibcallImpl
>(1),
59 static_cast<RTLIB::LibcallImpl
>(RTLIB::NumLibcallImpls));
67 const std::array<
uint64_t, (RTLIB::NumLibcallImpls + 63) / 64> &Src)
92 ExceptionModel = TT.getDefaultExceptionHandling();
94 initLibcalls(TT, ExceptionModel,
FloatABI, EABIVersion, ABIName);
100 ModuleAnalysisManager::Invalidator &);
104 if (CallImpl == RTLIB::Unsupported)
106 return StringRef(RuntimeLibcallImplNameTable.getCString(
107 RuntimeLibcallNameOffsetTable[CallImpl]),
108 RuntimeLibcallNameSizeTable[CallImpl]);
114 LibcallImplCallingConvs[
Call] = CC;
119 return LibcallImplCallingConvs[
Call];
124 return ImplToLibcall[Impl];
128 return AvailableLibcallImpls.count();
132 return AvailableLibcallImpls.test(Impl);
136 AvailableLibcallImpls.set(Impl);
150#define GET_LOOKUP_LIBCALL_IMPL_NAME_BODY
151#include "llvm/IR/RuntimeLibcalls.inc"
163 return RTLIB::Unsupported;
169 std::pair<FunctionType *, AttributeList>
171 RTLIB::LibcallImpl LibcallImpl)
const;
175 lookupLibcallImplNameImpl(
StringRef Name);
178 "default calling conv should be encoded as 0");
186 LLVM_ABI static const char RuntimeLibcallImplNameTableStorage[];
192 LLVM_ABI static const RTLIB::Libcall ImplToLibcall[RTLIB::NumLibcallImpls];
200 static bool darwinHasSinCosStret(
const Triple &TT) {
201 if (!TT.isOSDarwin())
209 return !TT.isMacOSXVersionLT(10, 9) && TT.isArch64Bit();
212 return !TT.isOSVersionLT(7, 0);
217 static bool hasAEABILibcalls(
const Triple &TT) {
218 return TT.isTargetAEABI() || TT.isTargetGNUAEABI() ||
219 TT.isTargetMuslAEABI() || TT.isOSFuchsia() || TT.isAndroid();
223 static bool isAAPCS_ABI(
const Triple &TT, StringRef ABIName);
225 static bool darwinHasExp10(
const Triple &TT);
228 static bool hasSinCos(
const Triple &TT) {
229 return TT.isGNUEnvironment() ||
TT.isOSFuchsia() ||
TT.isAndroid();
232 static bool hasSinCos_f32_f64(
const Triple &TT) {
233 return hasSinCos(TT) ||
TT.isPS();
237 void setTargetRuntimeLibcallSets(
const Triple &TT,
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Atomic ordering constants.
This header defines various interfaces for pass management in LLVM.
Provides some synthesis utilities to produce sequences of values.
constexpr Bitset(const std::array< uint64_t,(NumBits+63)/64 > &B)
A parsed version of the target data layout string in and methods for querying it.
This is an important class for using LLVM in a threaded context.
A Module instance is used to store all the information related to an LLVM module.
A set of analyses that are preserved following a run of a transformation pass.
Manage a bitset representing the list of available libcalls for a module.
constexpr LibcallImplBitset(const std::array< uint64_t,(RTLIB::NumLibcallImpls+63)/64 > &Src)
constexpr LibcallImplBitset()=default
StringRef - Represent a constant reference to a string, i.e.
A table of densely packed, null-terminated strings indexed by offset.
Triple - Helper class for working with autoconf configuration names.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
@ C
The default llvm calling convention, compatible with C.
static auto libcall_impls()
This is an optimization pass for GlobalISel generic memory operations.
auto enum_seq(EnumT Begin, EnumT End)
Iterate over an enum type from Begin up to - but not including - End.
@ None
No exception support.
static LLVM_ABI iota_range< RTLIB::LibcallImpl > lookupLibcallImplName(StringRef Name)
Check if a function name is a recognized runtime call of any kind.
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
std::pair< FunctionType *, AttributeList > getFunctionTy(LLVMContext &Ctx, const Triple &TT, const DataLayout &DL, RTLIB::LibcallImpl LibcallImpl) const
void setAvailable(RTLIB::LibcallImpl Impl)
LLVM_ABI RTLIB::LibcallImpl getSupportedLibcallImpl(StringRef FuncName) const
Check if this is valid libcall for the current module, otherwise RTLIB::Unsupported.
RuntimeLibcallsInfo(const Triple &TT, ExceptionHandling ExceptionModel=ExceptionHandling::None, FloatABI::ABIType FloatABI=FloatABI::Default, EABI EABIVersion=EABI::Default, StringRef ABIName="")
RuntimeLibcallsInfo()=default
static StringRef getLibcallImplName(RTLIB::LibcallImpl CallImpl)
Get the libcall routine name for the specified libcall implementation.
void setLibcallImplCallingConv(RTLIB::LibcallImpl Call, CallingConv::ID CC)
Set the CallingConv that should be used for the specified libcall implementation.
static RTLIB::Libcall getLibcallFromImpl(RTLIB::LibcallImpl Impl)
Return the libcall provided by Impl.
bool invalidate(Module &M, const PreservedAnalyses &PA, ModuleAnalysisManager::Invalidator &)
static constexpr bool is_iterable
static constexpr bool is_iterable