14#ifndef LLVM_LIB_TARGET_PISA_MCTARGETDESC_PISATARGETSTREAMER_H
15#define LLVM_LIB_TARGET_PISA_MCTARGETDESC_PISATARGETSTREAMER_H
52 std::variant<std::vector<uint32_t>, std::string, std::vector<std::string>,
116 std::vector<std::pair<std::string,
unsigned>>>
140 TypeInfoMap TypeInfos;
142 std::tuple<unsigned, unsigned, unsigned> tupleDT(
DataType DT) {
161 if (It == TypeInfos.end())
163 "the TypeInfos map");
173 std::pair<TypeInfoMap::iterator, bool> InsertResult = TypeInfos.try_emplace(
175 return InsertResult.first->second;
178 void insertInfo(
unsigned NumElts,
unsigned EltSize,
unsigned RegType,
183 std::pair<TypeInfoMap::iterator, bool> InsertResult =
184 TypeInfos.try_emplace(tupleDT(DT), std::move(TI));
185 assert(InsertResult.second);
195 Entry.second.RegStart = Entry.second.RegCounter;
272 using RegName = std::tuple<std::string, unsigned>;
278 virtual void addRegDcl(
unsigned NumElts,
unsigned EltSize,
unsigned RegType,
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
Implement a low-level type suitable for MachineInstr level instruction selection.
This file declares definitions shared across the PISA backend.
This file defines the SmallVector class.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Instances of this class represent a uniqued identifier for a section in the current translation unit.
Streaming machine code generation interface.
MCTargetStreamer(MCStreamer &S)
This class implements a map that also provides access to all stored values in a deterministic order.
typename SmallVector< std::pair< std::tuple< unsigned, unsigned, unsigned >, TypeInfo >, 0 >::const_iterator const_iterator
typename SmallVector< std::pair< std::tuple< unsigned, unsigned, unsigned >, TypeInfo >, 0 >::iterator iterator
typename SmallVector< std::pair< std::tuple< unsigned, unsigned, unsigned >, TypeInfo >, 0 >::value_type value_type
virtual void addRegDcl(unsigned NumElts, unsigned EltSize, unsigned RegType, RegNamesRange RegNames, bool MustAdd=true)=0
virtual void emitFuncBodyStart()=0
virtual void emitFunctionDeclaration(const PISA::FunctionDeclaration &)=0
virtual bool isAsmStreamer() const
virtual void emitFuncBodyEnd()=0
virtual void emitRegDcls(const PISA::RegDcls &, const PISA::DataTypes &)=0
~PISATargetStreamer() override
virtual void addLocalVariableDecl(const PISA::LocalVariableDcl &)=0
virtual void emitGlobalVariable(const PISA::GlobalVariableDcl &)=0
std::tuple< std::string, unsigned > RegName
ArrayRef< RegName > RegNamesRange
virtual StringRef emitHeader(const PISA::HeaderDcl &)=0
Emit header directives (.version, .target).
virtual void emitFunctionSignature(const PISA::FunctionSignature &)=0
PISATargetStreamer(MCStreamer &S)
virtual int getCurLine() const
virtual void emitLocalVariableDcls(const PISA::LocalVariableDcls &)=0
void changeSection(const MCSection *CurSection, MCSection *Section, uint32_t SubSection, raw_ostream &OS) override
Update streamer for a new active section.
TypeInfoMap::const_iterator end() const
void insertInfo(DataType DT, TypeInfo TI)
TypeInfo & emplaceInfo(DataType DT)
TypeInfo & getInfo(DataType DT)
static DataType getTypeFromPrefix(StringRef Prefix)
void insertInfo(unsigned NumElts, unsigned EltSize, unsigned RegType, TypeInfo TI)
TypeInfo & emplaceInfo(unsigned NumElts, unsigned EltSize, unsigned RegType)
TypeInfo & getInfo(LLT Ty)
static DataType getTypeFromLLT(LLT Ty)
static LLT getLLTFromType(const DataType &Ty)
TypeInfo & getInfo(unsigned NumElts, unsigned EltSize, unsigned RegType)
TypeInfo & emplaceInfo(LLT Ty)
void finalizeFuncParams()
static std::string getPrefixFromLLT(LLT Ty)
TypeInfoMap::const_iterator begin() const
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Represent a constant reference to a string, i.e.
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
StorageSpace mapAddrSpaceToStorageSpace(unsigned AS)
VariableDcl LocalVariableDcl
VariableDclInit GlobalVariableDcl
StringRef getLinkageTyName(LinkageTy Linkage)
This is an optimization pass for GlobalISel generic memory operations.
This struct is a compact representation of a valid (non-zero power of two) alignment.
DataType(unsigned N, unsigned B, unsigned R)
SmallVector< FunctionDeclParam > FunctionParams
FunctionDirectiveAndName DN
SmallVector< KernelAttribute > KernelAttrs
FunctionDirectiveAndName DN
SmallVector< KernelParameter > KernelParams
SmallVector< FunctionParameter > FunctionParams
SmallVector< GlobalVariableDcl > Vars
KernelAttributeType KernelAttrType
std::variant< std::vector< uint32_t >, std::string, std::vector< std::string >, uint32_t > KernelAttrValues
std::string TypeQualifier
SmallVector< LocalVariableDcl > Vars
MapVector< std::tuple< unsigned, unsigned, unsigned >, std::vector< std::pair< std::string, unsigned > > > Regs
std::string HostAccessName
std::variant< GlobalExpr, Zeros > SpecialEntry
DenseMap< uint64_t, SpecialEntry > Exprs
SmallVector< InitElement > Initializer