49 allocateFixedOperandUser(
size_t,
unsigned,
unsigned);
54 void *
operator new(
size_t Size) =
delete;
102 void *
operator new(
size_t Size, HungOffOperandsAllocMarker);
107 void *
operator new(
size_t Size, IntrusiveOperandsAllocMarker allocTrait);
112 void *
operator new(
size_t Size,
113 IntrusiveOperandsAndDescriptorAllocMarker allocTrait);
117 "Too many operands");
120 "Cannot have both hung off uses and a descriptor");
126 "Error in initializing hung off uses for User");
146 void operator delete(
void *Usr);
154 User::operator
delete(Usr);
156#ifndef LLVM_ENABLE_EXCEPTIONS
166 User::operator
delete(Usr);
168#ifndef LLVM_ENABLE_EXCEPTIONS
178 User::operator
delete(Usr);
180#ifndef LLVM_ENABLE_EXCEPTIONS
186 template <
int Idx,
typename U>
static Use &
OpFrom(
const U *that) {
193 return OpFrom<Idx>(
this);
195 template <
int Idx>
const Use &
Op()
const {
196 return OpFrom<Idx>(
this);
200 const Use *getHungOffOperands()
const {
201 return *(
reinterpret_cast<const Use *
const *
>(
this) - 1);
204 Use *&getHungOffOperands() {
return *(
reinterpret_cast<Use **
>(
this) - 1); }
206 const Use *getIntrusiveOperands()
const {
210 Use *getIntrusiveOperands() {
214 void setOperandList(Use *NewList) {
216 "Setting operand list only required for hung off uses");
217 getHungOffOperands() = NewList;
222 return HasHungOffUses ? getHungOffOperands() : getIntrusiveOperands();
236 isa<GlobalValue>((
const Value*)
this)) &&
237 "Cannot mutate a constant with setOperand!");
298 std::random_access_iterator_tag, Value *,
299 ptrdiff_t, Value *, Value *> {
318 std::random_access_iterator_tag, const Value *,
319 ptrdiff_t, const Value *, const Value *> {
358 return isa<Instruction>(V) || isa<Constant>(V);
363static_assert(
alignof(Use) >=
alignof(User),
364 "Alignment is insufficient after objects prepended to User");
365static_assert(
alignof(Use *) >=
alignof(User),
366 "Alignment is insufficient after objects prepended to User");
BlockVerifier::State From
#define LLVM_ATTRIBUTE_ALWAYS_INLINE
LLVM_ATTRIBUTE_ALWAYS_INLINE - On compilers where we have a directive to do so, mark a method "always...
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
This defines the Use class.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
The instances of the Type class are immutable: once they are created, they are never changed.
A Use represents the edge between a Value definition and its users.
iterator_range< const_op_iterator > const_op_range
const Use * getOperandList() const
ArrayRef< const uint8_t > getDescriptor() const
Returns the descriptor co-allocated with this User instance.
bool replaceUsesOfWith(Value *From, Value *To)
Replace uses of one Value with another.
void allocHungoffUses(unsigned N, bool IsPhi=false)
Allocate the array of Uses, followed by a pointer (with bottom bit set) to the User.
User(Type *ty, unsigned vty, AllocInfo AllocInfo)
const Use & getOperandUse(unsigned i) const
const_op_iterator op_begin() const
void dropAllReferences()
Drop all references to operands.
const_op_iterator op_end() const
value_op_iterator value_op_end()
void setOperand(unsigned i, Value *Val)
Use & getOperandUse(unsigned i)
const_value_op_iterator value_op_begin() const
void setNumHungOffUseOperands(unsigned NumOps)
Subclasses with hung off uses need to manage the operand count themselves.
static bool classof(const Value *V)
iterator_range< op_iterator > op_range
static Use & OpFrom(const U *that)
Value * getOperand(unsigned i) const
User(const User &)=delete
iterator_range< const_value_op_iterator > operand_values() const
const_op_range operands() const
value_op_iterator value_op_begin()
unsigned getNumOperands() const
iterator_range< value_op_iterator > operand_values()
const_value_op_iterator value_op_end() const
bool isDroppable() const
A droppable user is a user for which uses can be dropped without affecting correctness and should be ...
void growHungoffUses(unsigned N, bool IsPhi=false)
Grow the number of hung off uses.
LLVM Value Representation.
CRTP base class for adapting an iterator to a different type.
A range adaptor for a pair of iterators.
This provides a very simple, boring adaptor for a begin and end iterator into a range type.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
NodeAddr< UseNode * > Use
This is an optimization pass for GlobalISel generic memory operations.
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
MutableArrayRef(T &OneElt) -> MutableArrayRef< T >
ArrayRef(const T &OneElt) -> ArrayRef< T >
HungoffOperandTraits - determine the allocation regime of the Use array when it is not a prefix to th...
Compile-time customization of User operands.
Information about how a User object was allocated, to be passed into the User constructor.
constexpr AllocInfo(const IntrusiveOperandsAllocMarker Alloc)
constexpr AllocInfo(const IntrusiveOperandsAndDescriptorAllocMarker Alloc)
const bool HasHungOffUses
constexpr AllocInfo(const HungOffOperandsAllocMarker)
Indicates this User has operands "hung off" in another allocation.
Indicates this User has operands co-allocated.
const unsigned NumOps
The number of operands for this User.
Indicates this User has operands and a descriptor co-allocated .
const unsigned NumOps
The number of operands for this User.
const unsigned DescBytes
The number of bytes to allocate for the descriptor.
const_value_op_iterator(const Use *U=nullptr)
const Value * operator*() const
const Value * operator->() const
Iterator for directly iterating over the operand Values.
Value * operator->() const
Value * operator*() const
value_op_iterator(Use *U=nullptr)
static SimpleType getSimplifiedValue(User::const_op_iterator &Val)
static SimpleType getSimplifiedValue(User::op_iterator &Val)
Define a template that can be specialized by smart pointers to reflect the fact that they are automat...