Go to the documentation of this file.
9 #ifndef _AMDGPU_LIBFUNC_H_
10 #define _AMDGPU_LIBFUNC_H_
306 template <
typename Stream>
332 virtual std::string
getName()
const = 0;
344 virtual std::string
mangle()
const = 0;
372 std::string
getName()
const {
return Impl->getName(); }
383 return Impl->parseFuncName(MangledName);
388 std::string
mangle()
const {
return Impl->mangle(); }
394 return Impl->getFunctionType(
M);
405 std::unique_ptr<AMDGPULibFuncImpl> Impl;
416 std::string
getName()
const override;
426 std::string
mangle()
const override;
429 std::string mangleNameItanium()
const;
432 bool parseUnmangledName(
StringRef MangledName);
434 template <
typename Stream>
void writeName(Stream &OS)
const;
443 Name = std::string(FName);
460 #endif // _AMDGPU_LIBFUNC_H_
@ EI_WORK_GROUP_SCAN_INCLUSIVE_MIN
void setName(StringRef N)
ENamePrefix getPrefix() const
This is an optimization pass for GlobalISel generic memory operations.
@ EI_WORK_GROUP_RESERVE_READ_PIPE
static unsigned getAddrSpaceFromEPtrKind(unsigned Kind)
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
FunctionType * getFunctionType(Module &M) const
bool parseFuncName(StringRef &Name) override
@ EI_GET_PIPE_NUM_PACKETS
@ EI_SUB_GROUP_SCAN_INCLUSIVE_MAX
virtual bool parseFuncName(StringRef &mangledName)=0
static bool isMangled(EFuncId Id)
void setName(StringRef N)
virtual std::string mangle() const =0
@ EI_SUB_GROUP_SCAN_EXCLUSIVE_MIN
static bool classof(const AMDGPULibFuncImpl *F)
static bool parse(StringRef MangledName, AMDGPULibFunc &Ptr)
virtual ~AMDGPULibFuncImpl()=default
@ EI_SUB_GROUP_COMMIT_WRITE_PIPE
bool parseFuncName(StringRef &MangledName)
AMDGPULibFuncImpl()=default
unsigned getNumArgs() const override
AMDGPUUnmangledLibFunc(StringRef FName, FunctionType *FT)
bool parseFuncName(StringRef &mangledName) override
@ EI_WORK_GROUP_RESERVE_WRITE_PIPE
Param * getLeads()
Get leading parameters for mangled lib functions.
static unsigned getEPtrKindFromAddrSpace(unsigned AS)
@ EI_SUB_GROUP_SCAN_EXCLUSIVE_MAX
Wrapper class for AMDGPULIbFuncImpl.
@ EI_WORK_GROUP_COMMIT_WRITE_PIPE
static FunctionCallee getOrInsertFunction(llvm::Module *M, const AMDGPULibFunc &fInfo)
std::string mangle() const override
@ EI_WORK_GROUP_SCAN_EXCLUSIVE_ADD
FunctionType * getFunctionType(Module &M) const override
std::string getName() const override
Get unmangled name for mangled library function and name for unmangled library function.
static StringRef getUnmangledName(StringRef MangledName)
@ EI_SUB_GROUP_REDUCE_MIN
@ EI_WORK_GROUP_REDUCE_MIN
@ EI_ASYNC_WORK_GROUP_STRIDED_COPY
std::string mangle() const override
@ EI_WORK_GROUP_REDUCE_ADD
std::string mangle() const
virtual std::string getName() const =0
Get unmangled name for mangled library function and name for unmangled library function.
unsigned getNumArgs() const
@ EI_GET_IMAGE_CHANNEL_DATA_TYPE
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
@ EI_SUB_GROUP_RESERVE_WRITE_PIPE
unsigned getNumArgs() const override
std::string getName() const override
Get unmangled name for mangled library function and name for unmangled library function.
A Module instance is used to store all the information related to an LLVM module.
@ EI_ASYNC_WORK_GROUP_COPY
virtual FunctionType * getFunctionType(Module &M) const =0
StringRef - Represent a constant reference to a string, i.e.
@ EI_GET_IMAGE_ARRAY_SIZE
Machine Check Debug Module
void setPrefix(ENamePrefix PFX)
@ EI_SUB_GROUP_REDUCE_MAX
AMDGPULibFunc & operator=(const AMDGPULibFunc &F)
@ EI_WORK_GROUP_REDUCE_MAX
@ EI_SUB_GROUP_SCAN_INCLUSIVE_ADD
void setFunctionType(FunctionType *FT)
void mangleItanium(Stream &os)
@ EI_SUB_GROUP_COMMIT_READ_PIPE
@ EI_SUB_GROUP_RESERVE_READ_PIPE
@ EI_WORK_GROUP_SCAN_EXCLUSIVE_MAX
static bool classof(const AMDGPULibFuncImpl *F)
ENamePrefix getPrefix() const
@ EI_GET_PIPE_MAX_PACKETS
virtual unsigned getNumArgs() const =0
@ EI_SUB_GROUP_REDUCE_ADD
FunctionType * getFunctionType(Module &M) const override
std::string getName() const
Get unmangled name for mangled library function and name for unmangled library function.
void setPrefix(ENamePrefix pfx)
A handy container for a FunctionType+Callee-pointer pair, which can be passed around as a single enti...
@ EI_SUB_GROUP_SCAN_EXCLUSIVE_ADD
@ EI_WORK_GROUP_SCAN_EXCLUSIVE_MIN
@ EI_WORK_GROUP_COMMIT_READ_PIPE
@ EI_WORK_GROUP_SCAN_INCLUSIVE_MAX
static Function * getFunction(llvm::Module *M, const AMDGPULibFunc &fInfo)
Class to represent function types.
@ EI_WORK_GROUP_SCAN_INCLUSIVE_ADD
@ EI_SUB_GROUP_SCAN_INCLUSIVE_MIN
@ EI_GET_IMAGE_CHANNEL_ORDER