15 #ifndef LLVM_IR_GLOBALOBJECT_H 16 #define LLVM_IR_GLOBALOBJECT_H 53 static const unsigned AlignmentMask = (1 << AlignmentBits) - 1;
61 unsigned AlignmentData = Data & AlignmentMask;
62 return (1u << AlignmentData) >> 1;
74 (Val << GlobalObjectBits));
169 return V->
getValueID() == Value::FunctionVal ||
176 void setGlobalObjectFlag(
unsigned Bit,
bool Val) {
182 bool hasMetadataHashEntry()
const {
185 void setHasMetadataHashEntry(
bool HasEntry) {
194 #endif // LLVM_IR_GLOBALOBJECT_H
StringRef getSection() const
Get the custom section of this global if it has one.
unsigned getAlignment() const
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
unsigned getValueID() const
Return an ID for the concrete type of this object.
This class represents lattice values for constants.
void getAllMetadata(SmallVectorImpl< std::pair< unsigned, MDNode *>> &MDs) const
Appends all attachments for the global to MDs, sorting by attachment ID.
void setAlignment(unsigned Align)
void copyMetadata(const GlobalObject *Src, unsigned Offset)
Copy metadata from Src, adjusting offsets by Offset.
amdgpu Simplify well known AMD library false Value Value const Twine & Name
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
A Use represents the edge between a Value definition and its users.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
MDNode * getMetadata(unsigned KindID) const
Get the current metadata attachments for the given kind, if any.
static const unsigned GlobalObjectSubClassDataBits
void setComdat(Comdat *C)
GlobalObject(Type *Ty, ValueTy VTy, Use *Ops, unsigned NumOps, LinkageTypes Linkage, const Twine &Name, unsigned AddressSpace=0)
void addTypeMetadata(unsigned Offset, Metadata *TypeID)
The instances of the Type class are immutable: once they are created, they are never changed...
unsigned getGlobalObjectSubClassData() const
unsigned getGlobalValueSubClassData() const
bool hasSection() const
Check if this global has a custom object file section.
void addMetadata(unsigned KindID, MDNode &MD)
Add a metadata attachment.
void setGlobalObjectSubClassData(unsigned Val)
ValueTy
Concrete subclass of this.
LinkageTypes
An enumeration for the kinds of linkage for global values.
void setGlobalValueSubClassData(unsigned V)
static bool classof(const Value *V)
void setMetadata(unsigned KindID, MDNode *MD)
Set a particular kind of metadata attachment.
const Comdat * getComdat() const
static const unsigned GlobalValueSubClassDataBits
bool hasMetadata(StringRef Kind) const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
bool hasMetadata() const
Check if this has any metadata.
std::underlying_type< E >::type Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
StringRef - Represent a constant reference to a string, i.e.
bool eraseMetadata(unsigned KindID)
Erase all metadata attachments with the given kind.
bool hasMetadata(unsigned KindID) const
Check if this has any metadata of the given kind.
void copyAttributesFrom(const GlobalObject *Src)
void setSection(StringRef S)
Change the section for this global.
std::vector< uint32_t > Metadata
PAL metadata represented as a vector.