10 #ifndef _AMDGPU_LIBFUNC_H_ 11 #define _AMDGPU_LIBFUNC_H_ 305 template <
typename Stream>
331 virtual std::string
getName()
const = 0;
332 virtual unsigned getNumArgs()
const = 0;
339 virtual bool parseFuncName(
StringRef &mangledName) = 0;
343 virtual std::string mangle()
const = 0;
371 std::string
getName()
const {
return Impl->getName(); }
377 const Param *getLeads()
const;
382 return Impl->parseFuncName(MangledName);
387 std::string
mangle()
const {
return Impl->mangle(); }
393 return Impl->getFunctionType(M);
404 std::unique_ptr<AMDGPULibFuncImpl> Impl;
415 std::string
getName()
const override;
416 unsigned getNumArgs()
const override;
420 bool parseFuncName(
StringRef &mangledName)
override;
425 std::string mangle()
const override;
428 std::string mangleNameItanium()
const;
431 bool parseUnmangledName(
StringRef MangledName);
433 template <
typename Stream>
void writeName(Stream &OS)
const;
446 unsigned getNumArgs()
const override;
459 #endif // _AMDGPU_LIBFUNC_H_
This class represents lattice values for constants.
ENamePrefix getPrefix() const
A Module instance is used to store all the information related to an LLVM module. ...
AMDGPUUnmangledLibFunc(StringRef FName, FunctionType *FT)
void setPrefix(ENamePrefix PFX)
virtual ~AMDGPULibFuncImpl()
std::string getName() const
Get unmangled name for mangled library function and name for unmangled library function.
amdgpu Simplify well known AMD library false Value Value const Twine & Name
static bool isMangled(EFuncId Id)
static StringRef getName(Value *V)
unsigned getNumArgs() const
std::string getName() const override
Get unmangled name for mangled library function and name for unmangled library function.
Class to represent function types.
static Function * getFunction(Constant *C)
static bool classof(const AMDGPULibFuncImpl *F)
void setName(StringRef N)
Wrapper class for AMDGPULIbFuncImpl.
llvm::Expected< Value > parse(llvm::StringRef JSON)
Parses the provided JSON source, or returns a ParseError.
static unsigned getEPtrKindFromAddrSpace(unsigned AS)
bool parseFuncName(StringRef &MangledName)
void setFunctionType(FunctionType *FT)
void mangleItanium(Stream &os)
FunctionType * getFunctionType(Module &M) const override
static unsigned getAddrSpaceFromEPtrKind(unsigned Kind)
void setPrefix(ENamePrefix pfx)
ENamePrefix getPrefix() const
std::string mangle() const override
void setName(StringRef N)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
std::string mangle() const
StringRef - Represent a constant reference to a string, i.e.
static bool classof(const AMDGPULibFuncImpl *F)
FunctionType * getFunctionType(Module &M) const