49 allocateFixedOperandUser(
size_t,
unsigned,
unsigned);
56 void *
operator new(
size_t Size);
61 void *
operator new(
size_t Size,
unsigned Us);
71 void *
operator new(
size_t Size,
unsigned Us,
unsigned DescBytes);
80 "Error in initializing hung off uses for User");
100 void operator delete(
void *Usr);
107 User::operator
delete(Usr);
109#ifndef LLVM_ENABLE_EXCEPTIONS
119 User::operator
delete(Usr);
121#ifndef LLVM_ENABLE_EXCEPTIONS
127 template <
int Idx,
typename U>
static Use &
OpFrom(
const U *that) {
134 return OpFrom<Idx>(
this);
136 template <
int Idx>
const Use &
Op()
const {
137 return OpFrom<Idx>(
this);
141 const Use *getHungOffOperands()
const {
142 return *(
reinterpret_cast<const Use *
const *
>(
this) - 1);
145 Use *&getHungOffOperands() {
return *(
reinterpret_cast<Use **
>(
this) - 1); }
147 const Use *getIntrusiveOperands()
const {
151 Use *getIntrusiveOperands() {
155 void setOperandList(Use *NewList) {
157 "Setting operand list only required for hung off uses");
158 getHungOffOperands() = NewList;
163 return HasHungOffUses ? getHungOffOperands() : getIntrusiveOperands();
177 isa<GlobalValue>((
const Value*)
this)) &&
178 "Cannot mutate a constant with setOperand!");
208 assert(NumOps <= 1 &&
"GlobalVariable can only have 0 or 1 operands");
252 std::random_access_iterator_tag, Value *,
253 ptrdiff_t, Value *, Value *> {
272 std::random_access_iterator_tag, const Value *,
273 ptrdiff_t, const Value *, const Value *> {
312 return isa<Instruction>(V) || isa<Constant>(V);
317static_assert(
alignof(Use) >=
alignof(User),
318 "Alignment is insufficient after objects prepended to User");
319static_assert(
alignof(Use *) >=
alignof(User),
320 "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.
User(Type *ty, unsigned vty, Use *, unsigned NumOps)
void allocHungoffUses(unsigned N, bool IsPhi=false)
Allocate the array of Uses, followed by a pointer (with bottom bit set) to the User.
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
void setGlobalVariableNumOperands(unsigned NumOps)
Set the number of operands on a GlobalVariable.
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.
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...