9#ifndef _AMDGPU_LIBFUNC_H_
10#define _AMDGPU_LIBFUNC_H_
312 template <
typename Stream>
316 return static_cast<unsigned>(Id) <=
static_cast<unsigned>(
EI_LAST_MANGLED);
380 std::string
getName()
const {
return Impl->getName(); }
391 return Impl->parseFuncName(MangledName);
399 std::string
mangle()
const {
return Impl->mangle(); }
405 return Impl->getFunctionType(M);
416 std::unique_ptr<AMDGPULibFuncImpl> Impl;
427 bool SignedInts =
true);
429 std::string
getName()
const override;
439 std::string
mangle()
const override;
442 std::string mangleNameItanium()
const;
445 bool parseUnmangledName(
StringRef MangledName);
447 template <
typename Stream>
void writeName(Stream &
OS)
const;
456 Name = std::string(FName);
Machine Check Debug Module
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
@ EI_WORK_GROUP_SCAN_EXCLUSIVE_MIN
@ EI_SUB_GROUP_SCAN_EXCLUSIVE_MIN
@ EI_SUB_GROUP_COMMIT_READ_PIPE
@ EI_ASYNC_WORK_GROUP_COPY
@ EI_WORK_GROUP_COMMIT_WRITE_PIPE
@ EI_SUB_GROUP_REDUCE_ADD
@ EI_SUB_GROUP_SCAN_INCLUSIVE_MAX
@ EI_SUB_GROUP_SCAN_INCLUSIVE_MIN
@ EI_SUB_GROUP_SCAN_EXCLUSIVE_MAX
@ EI_SUB_GROUP_RESERVE_WRITE_PIPE
@ EI_GET_IMAGE_ARRAY_SIZE
@ EI_WORK_GROUP_RESERVE_READ_PIPE
@ EI_WORK_GROUP_REDUCE_MAX
@ EI_WORK_GROUP_SCAN_EXCLUSIVE_ADD
@ EI_SUB_GROUP_COMMIT_WRITE_PIPE
@ EI_SUB_GROUP_SCAN_EXCLUSIVE_ADD
@ EI_WORK_GROUP_SCAN_INCLUSIVE_MAX
@ EI_WORK_GROUP_RESERVE_WRITE_PIPE
@ EI_SUB_GROUP_SCAN_INCLUSIVE_ADD
@ EI_WORK_GROUP_SCAN_EXCLUSIVE_MAX
@ EI_WORK_GROUP_SCAN_INCLUSIVE_ADD
@ EI_WORK_GROUP_REDUCE_MIN
@ EI_WORK_GROUP_COMMIT_READ_PIPE
@ EI_GET_PIPE_NUM_PACKETS
@ EI_GET_PIPE_MAX_PACKETS
@ EI_SUB_GROUP_RESERVE_READ_PIPE
@ EI_ASYNC_WORK_GROUP_STRIDED_COPY
@ EI_GET_IMAGE_CHANNEL_ORDER
@ EI_SUB_GROUP_REDUCE_MIN
@ EI_WORK_GROUP_REDUCE_ADD
@ EI_SUB_GROUP_REDUCE_MAX
@ EI_GET_IMAGE_CHANNEL_DATA_TYPE
@ EI_WORK_GROUP_SCAN_INCLUSIVE_MIN
static unsigned getEPtrKindFromAddrSpace(unsigned AS)
static unsigned getAddrSpaceFromEPtrKind(unsigned Kind)
static bool isMangled(EFuncId Id)
virtual std::string mangle() const =0
AMDGPULibFuncImpl()=default
virtual bool parseFuncName(StringRef &mangledName)=0
virtual unsigned getNumArgs() const =0
ENamePrefix getPrefix() const
virtual FunctionType * getFunctionType(Module &M) const =0
virtual ~AMDGPULibFuncImpl()=default
void setPrefix(ENamePrefix pfx)
void setName(StringRef N)
virtual std::string getName() const =0
Get unmangled name for mangled library function and name for unmangled library function.
Wrapper class for AMDGPULIbFuncImpl.
static Function * getFunction(llvm::Module *M, const AMDGPULibFunc &fInfo)
bool parseFuncName(StringRef &MangledName)
std::string getName() const
Get unmangled name for mangled library function and name for unmangled library function.
static FunctionCallee getOrInsertFunction(llvm::Module *M, const AMDGPULibFunc &fInfo)
void setPrefix(ENamePrefix PFX)
FunctionType * getFunctionType(Module &M) const
void setName(StringRef N)
bool isCompatibleSignature(const FunctionType *FuncTy) const
std::string mangle() const
AMDGPULibFunc & operator=(const AMDGPULibFunc &F)
Param * getLeads()
Get leading parameters for mangled lib functions.
ENamePrefix getPrefix() const
unsigned getNumArgs() const
static StringRef getUnmangledName(StringRef MangledName)
unsigned getNumArgs() const override
FunctionType * getFunctionType(Module &M) const override
bool parseFuncName(StringRef &mangledName) override
std::string getName() const override
Get unmangled name for mangled library function and name for unmangled library function.
static bool classof(const AMDGPULibFuncImpl *F)
std::string mangle() const override
static bool classof(const AMDGPULibFuncImpl *F)
unsigned getNumArgs() const override
std::string mangle() const override
void setFunctionType(FunctionType *FT)
bool parseFuncName(StringRef &Name) override
FunctionType * getFunctionType(Module &M) const override
std::string getName() const override
Get unmangled name for mangled library function and name for unmangled library function.
AMDGPUUnmangledLibFunc(StringRef FName, FunctionType *FT)
A handy container for a FunctionType+Callee-pointer pair, which can be passed around as a single enti...
Class to represent function types.
A Module instance is used to store all the information related to an LLVM module.
StringRef - Represent a constant reference to a string, i.e.
The instances of the Type class are immutable: once they are created, they are never changed.
This is an optimization pass for GlobalISel generic memory operations.
Implement std::hash so that hash_code can be used in STL containers.
void mangleItanium(Stream &os)
static Param getIntN(unsigned char NumElts)
static Param getFromTy(Type *Ty, bool Signed)