9#ifndef LLVM_CODEGEN_LIBCALLLOWERINGINFO_H
10#define LLVM_CODEGEN_LIBCALLLOWERINGINFO_H
26 RTLIB::LibcallImpl LibcallImpls[RTLIB::UNKNOWN_LIBCALL + 1] = {
47 return LibcallImpls[
Call];
52 LibcallImpls[
Call] = Impl;
58 return RTLCI.LibcallImplCallingConvs[LibcallImpls[
Call]];
64 return RTLCI.LibcallImplCallingConvs[
Call];
71 if (Memcpy == RTLIB::Unsupported) {
83 using LibcallLoweringMap =
85 mutable LibcallLoweringMap LoweringMap;
101 ModuleAnalysisManager::Invalidator &);
105 return LoweringMap.try_emplace(&Subtarget, *RTLCI, Subtarget).first->second;
132 return Result.getLibcallLowering(Subtarget);
139 bool doInitialization(
Module &M)
override;
141 void releaseMemory()
override;
This file defines the DenseMap class.
Represent the analysis usage information of a pass.
const LibcallLoweringInfo & getLibcallLowering(const TargetSubtargetInfo &Subtarget) const
LibcallLoweringInfoWrapper()
const LibcallLoweringModuleAnalysisResult & getResult() const
Tracks which library functions to use for a particular subtarget.
const RTLIB::RuntimeLibcallsInfo & getRuntimeLibcallsInfo() const
LLVM_ABI LibcallLoweringInfo(const RTLIB::RuntimeLibcallsInfo &RTLCI, const TargetSubtargetInfo &Subtarget)
LLVM_ABI void setLibcallImpl(RTLIB::Libcall Call, RTLIB::LibcallImpl Impl)
Rename the default libcall routine name for the specified libcall.
LLVM_ABI CallingConv::ID getLibcallImplCallingConv(RTLIB::LibcallImpl Call) const
Get the CallingConv that should be used for the specified libcall.
LLVM_ABI const char * getLibcallName(RTLIB::Libcall Call) const
Get the libcall routine name for the specified libcall.
RTLIB::LibcallImpl getMemcpyImpl() const
Return a function impl compatible with RTLIB::MEMCPY, or RTLIB::Unsupported if fully unsupported.
LLVM_ABI RTLIB::LibcallImpl getLibcallImpl(RTLIB::Libcall Call) const
Return the lowering's selection of implementation call for Call.
LLVM_ABI CallingConv::ID getLibcallCallingConv(RTLIB::Libcall Call) const
Record a mapping from subtarget to LibcallLoweringInfo.
LibcallLoweringModuleAnalysisResult()=default
void init(const RTLIB::RuntimeLibcallsInfo *RT)
const LibcallLoweringInfo & getLibcallLowering(const TargetSubtargetInfo &Subtarget) const
LibcallLoweringModuleAnalysisResult(RTLIB::RuntimeLibcallsInfo &RTLCI)
LLVM_ABI bool invalidate(Module &, const PreservedAnalyses &, ModuleAnalysisManager::Invalidator &)
LibcallLoweringModuleAnalysisResult Result
LLVM_ABI Result run(Module &M, ModuleAnalysisManager &)
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.
constexpr const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
Primary interface to the complete machine description for the target machine.
TargetSubtargetInfo - Generic base class for all target subtargets.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
This is an optimization pass for GlobalISel generic memory operations.
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
A CRTP mix-in that provides informational APIs needed for analysis passes.
A special type used by analysis passes to provide an address that identifies that particular analysis...
A simple container for information about the supported runtime calls.
static StringRef getLibcallImplName(RTLIB::LibcallImpl CallImpl)
Get the libcall routine name for the specified libcall implementation.