Go to the documentation of this file.
20 #ifndef LLVM_TRANSFORMS_VECTORIZE_VPLAN_VALUE_H
21 #define LLVM_TRANSFORMS_VECTORIZE_VPLAN_VALUE_H
38 class VPWidenMemoryInstructionRecipe;
55 const unsigned char SubclassID;
179 "VPValue is not a live-in; it is defined by a VPDef inside a VPlan");
205 VPUser(std::initializer_list<VPValue *> Operands)
216 Op->removeUser(*
this);
238 Op->removeUser(*
this);
268 const unsigned char SubclassID;
274 void addDefinedValue(
VPValue *V) {
276 "can only add VPValue already linked with this VPDef");
282 void removeDefinedValue(
VPValue *V) {
284 "can only remove VPValue linked with this VPDef");
286 "VPValue to remove must be in DefinedValues");
305 VPWidenCanonicalIVSC,
307 VPWidenIntOrFpInductionSC,
308 VPWidenMemoryInstructionSC,
319 "all defined VPValues should point to the containing VPDef");
320 assert(
D->getNumUsers() == 0 &&
321 "all defined VPValues should have no more users");
329 assert(DefinedValues[
I] &&
"defined value must be non-null");
330 return DefinedValues[
I];
333 assert(DefinedValues[
I] &&
"defined value must be non-null");
334 return DefinedValues[
I];
367 unsigned NextSlot = 0;
372 void assignSlot(
const VPValue *V);
374 void assignSlots(
const VPlan &Plan);
383 auto I = Slots.
find(V);
384 if (
I == Slots.
end())
392 #endif // LLVM_TRANSFORMS_VECTORIZE_VPLAN_VALUE_H
operand_iterator op_end()
This class represents lattice values for constants.
const_user_iterator user_end() const
VPBasicBlock serves as the leaf of the Hierarchical Control-Flow Graph.
SmallVectorImpl< VPUser * >::iterator user_iterator
Value * getLiveInIRValue()
Returns the underlying IR value, if this VPValue is defined outside the scope of VPlan.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
virtual void print(raw_ostream &O, const Twine &Indent, VPSlotTracker &SlotTracker) const =0
Each concrete VPDef prints itself.
iterator_range< user_iterator > user_range
void erase_if(Container &C, UnaryPredicate P)
Provide a container algorithm similar to C++ Library Fundamentals v2's erase_if which is equivalent t...
VPValue & operator=(const VPValue &)=delete
void dump() const
Dump the value to stderr (for debugging).
operand_iterator op_begin()
VPDef(const unsigned char SC)
void print(raw_ostream &OS, VPSlotTracker &Tracker) const
VPValue(const unsigned char SC, Value *UV=nullptr, VPDef *Def=nullptr)
SmallVectorImpl< VPValue * >::const_iterator const_operand_iterator
This class augments a recipe with a set of VPValues defined by the recipe.
VPBlockBase is the building block of the Hierarchical Control-Flow Graph.
This is a concrete Recipe that models a single VPlan-level instruction.
const_operand_iterator op_end() const
@ SC
CHAIN = SC CHAIN, Imm128 - System call.
VPlan-based builder utility analogous to IRBuilder.
void addUser(VPUser &User)
ArrayRef< VPValue * > definedValues() const
Returns an ArrayRef of the values defined by the VPDef.
void push_back(EltTy NewVal)
void replaceAllUsesWith(VPValue *New)
This class implements an extremely fast bulk output stream that can only output to a stream.
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
unsigned getNumDefinedValues() const
Returns the number of values defined by the VPDef.
@ VPVWidenIntOrFpIndcutionSC
const Value * getUnderlyingValue() const
const_user_range users() const
unsigned getNumOperands() const
void erase_value(Container &C, ValueType V)
Wrapper function to remove a value from a container:
VPRegionBlock represents a collection of VPBasicBlocks and VPRegionBlocks which form a Single-Entry-S...
mir Rename Register Operands
void setOperand(unsigned I, VPValue *New)
VPDef * Def
Pointer to the VPDef that defines this VPValue.
unsigned getSlot(const VPValue *V) const
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
VPUser(ArrayRef< VPValue * > Operands)
enum { VPBlendSC, VPBranchOnMaskSC, VPInstructionSC, VPInterleaveSC, VPPredInstPHISC, VPReductionSC, VPReplicateSC, VPWidenCallSC, VPWidenCanonicalIVSC, VPWidenGEPSC, VPWidenIntOrFpInductionSC, VPWidenMemoryInstructionSC, VPWidenPHISC, VPWidenSC, VPWidenSelectSC } VPRecipeTy
An enumeration for keeping track of the concrete subclass of VPRecipeBase that is actually instantiat...
unsigned getNumUsers() const
iterator_range< early_inc_iterator_impl< detail::IterOfRange< RangeT > > > make_early_inc_range(RangeT &&Range)
Make a range that does early increment to allow mutation of the underlying range without disrupting i...
const_operand_iterator op_begin() const
bool is_contained(R &&Range, const E &Element)
Wrapper function around std::find to detect if an element exists in a container.
iterator find(const_arg_type_t< KeyT > Val)
typename SuperClass::const_iterator const_iterator
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
const_user_iterator user_begin() const
DenseMap< Value *, VPValue * > Value2VPValueTy
void printOperands(raw_ostream &O, VPSlotTracker &SlotTracker) const
Print the operands to O.
A Recipe for widening load/store operations.
VPSlotTracker(const VPlan *Plan=nullptr)
VPUser(iterator_range< IterT > Operands)
user_iterator user_begin()
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
void addOperand(VPValue *Operand)
void setUnderlyingValue(Value *Val)
iterator_range< operand_iterator > operand_range
SmallVectorImpl< VPValue * >::iterator operand_iterator
static bool classof(const VPDef *Recipe)
Method to support type inquiry through isa, cast, and dyn_cast.
void dump() const
Dump the VPDef to stderr (for debugging).
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
VPUser(std::initializer_list< VPValue * > Operands)
This class can be used to assign consecutive numbers to all VPValues in a VPlan and allows querying t...
VPRecipeBase is a base class modeling a sequence of one or more output IR instructions.
VPUser & operator=(const VPUser &)=delete
This class provides computation of slot numbers for LLVM Assembly writing.
iterator_range< const_user_iterator > const_user_range
DenseMap< VPValue *, Value * > VPValue2ValueTy
bool hasMoreThanOneUniqueUser()
Returns true if the value has more than one unique user.
const VPValue * getVPValue(unsigned I=0) const
This class augments VPValue with operands which provide the inverse def-use edges from VPValue's user...
typename SuperClass::iterator iterator
VPValue * getOperand(unsigned N) const
iv Induction Variable Users
A range adaptor for a pair of iterators.
ArrayRef< VPValue * > definedValues()
Returns an ArrayRef of the values defined by the VPDef.
unsigned getVPValueID() const
const_operand_range operands() const
void removeUser(VPUser &User)
Remove a single User from the list of users.
VPValue(Value *UV=nullptr, VPDef *Def=nullptr)
TinyPtrVector - This class is specialized for cases where there are normally 0 or 1 element in a vect...
unsigned getVPDefID() const
VPValue * getVPValue(unsigned I=0)
Returns the VPValue with index I defined by the VPDef.
Value * getUnderlyingValue()
Return the underlying Value attached to this VPValue.
SmallVectorImpl< VPUser * >::const_iterator const_user_iterator
VPlan models a candidate for vectorization, encoding various decisions take to produce efficient outp...
LLVM Value Representation.
void printAsOperand(raw_ostream &OS, VPSlotTracker &Tracker) const
Optional< std::vector< StOtherPiece > > Other
iterator_range< const_operand_iterator > const_operand_range