9#ifndef LLVM_CODEGEN_LIBCALLLOWERINGINFO_H
10#define LLVM_CODEGEN_LIBCALLLOWERINGINFO_H
27 RTLIB::LibcallImpl LibcallImpls[RTLIB::UNKNOWN_LIBCALL + 1] = {
48 return LibcallImpls[
Call];
53 LibcallImpls[
Call] = Impl;
59 return RTLCI.LibcallImplCallingConvs[LibcallImpls[
Call]];
64 return RTLCI.LibcallImplCallingConvs[
Call];
71 if (Memcpy == RTLIB::Unsupported) {
83 using LibcallLoweringMap =
85 mutable LibcallLoweringMap LoweringMap;
100 operator bool()
const {
return RTLCI !=
nullptr; }
103 ModuleAnalysisManager::Invalidator &);
107 return LoweringMap.try_emplace(&Subtarget, *RTLCI, Subtarget).first->second;
135 return getResult(M).getLibcallLowering(Subtarget);
140 Result.
init(&RuntimeLibcallsWrapper->getRTLCI(M));
144 void initializePass()
override;
146 void releaseMemory()
override;
This file defines the DenseMap class.
Represent the analysis usage information of a pass.
const LibcallLoweringModuleAnalysisResult & getResult(const Module &M)
const LibcallLoweringInfo & getLibcallLowering(const Module &M, const TargetSubtargetInfo &Subtarget)
LibcallLoweringInfoWrapper()
Tracks which library functions to use for a particular subtarget.
const RTLIB::RuntimeLibcallsInfo & getRuntimeLibcallsInfo() const
CallingConv::ID getLibcallImplCallingConv(RTLIB::LibcallImpl Call) const
Get the CallingConv that should be used for the specified libcall.
LLVM_ABI LibcallLoweringInfo(const RTLIB::RuntimeLibcallsInfo &RTLCI, const TargetSubtargetInfo &Subtarget)
const char * getLibcallName(RTLIB::Libcall Call) const
Get the libcall routine name for the specified libcall.
CallingConv::ID getLibcallCallingConv(RTLIB::Libcall Call) const
RTLIB::LibcallImpl getLibcallImpl(RTLIB::Libcall Call) const
Return the lowering's selection of implementation call for Call.
void setLibcallImpl(RTLIB::Libcall Call, RTLIB::LibcallImpl Impl)
Rename the default 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.
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
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.