49 allocateFixedOperandUser(
size_t,
unsigned,
unsigned);
54 void *
operator new(
size_t Size) =
delete;
104 LLVM_ABI void *
operator new(
size_t Size, HungOffOperandsAllocMarker);
110 IntrusiveOperandsAllocMarker allocTrait);
116 operator new(
size_t Size,
117 IntrusiveOperandsAndDescriptorAllocMarker allocTrait);
121 "Too many operands");
124 "Cannot have both hung off uses and a descriptor");
130 "Error in initializing hung off uses for User");
150 LLVM_ABI void operator delete(
void *Usr);
158 User::operator
delete(Usr);
160#ifndef LLVM_ENABLE_EXCEPTIONS
170 User::operator
delete(Usr);
172#ifndef LLVM_ENABLE_EXCEPTIONS
182 User::operator
delete(Usr);
184#ifndef LLVM_ENABLE_EXCEPTIONS
190 template <
int Idx,
typename U>
static Use &
OpFrom(
const U *that) {
197 return OpFrom<Idx>(
this);
199 template <
int Idx>
const Use &
Op()
const {
200 return OpFrom<Idx>(
this);
204 const Use *getHungOffOperands()
const {
205 return *(
reinterpret_cast<const Use *
const *
>(
this) - 1);
208 Use *&getHungOffOperands() {
return *(
reinterpret_cast<Use **
>(
this) - 1); }
210 const Use *getIntrusiveOperands()
const {
214 Use *getIntrusiveOperands() {
218 void setOperandList(Use *NewList) {
220 "Setting operand list only required for hung off uses");
221 getHungOffOperands() = NewList;
226 return HasHungOffUses ? getHungOffOperands() : getIntrusiveOperands();
240 isa<GlobalValue>((
const Value*)
this)) &&
241 "Cannot mutate a constant with setOperand!");
302 std::random_access_iterator_tag, Value *,
303 ptrdiff_t, Value *, Value *> {
322 std::random_access_iterator_tag, const Value *,
323 ptrdiff_t, const Value *, const Value *> {
362 return isa<Instruction>(V) || isa<Constant>(V);
367static_assert(
alignof(Use) >=
alignof(User),
368 "Alignment is insufficient after objects prepended to User");
369static_assert(
alignof(Use *) >=
alignof(User),
370 "Alignment is insufficient after objects prepended to User");
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
BlockVerifier::State From
#define LLVM_PREFERRED_TYPE(T)
\macro LLVM_PREFERRED_TYPE Adjust type of bit-field in debug info.
#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.
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
LLVM_ABI ArrayRef< const uint8_t > getDescriptor() const
Returns the descriptor co-allocated with this User instance.
LLVM_ABI bool replaceUsesOfWith(Value *From, Value *To)
Replace uses of one Value with another.
LLVM_ABI 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
LLVM_ABI bool isDroppable() const
A droppable user is a user for which uses can be dropped without affecting correctness and should be ...
LLVM_ABI 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.
const unsigned HasHungOffUses
constexpr AllocInfo(const IntrusiveOperandsAllocMarker Alloc)
constexpr AllocInfo(const IntrusiveOperandsAndDescriptorAllocMarker Alloc)
const unsigned HasDescriptor
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...