25 #ifndef LLVM_TRANSFORMS_VECTORIZE_VPLAN_H 26 #define LLVM_TRANSFORMS_VECTORIZE_VPLAN_H 51 class LoopVectorizationLegality;
52 class LoopVectorizationCostModel;
55 class InnerLoopVectorizer;
56 template <
class T>
class InterleaveGroup;
124 std::map<Value *, VectorParts> VectorMapStorage;
125 std::map<Value *, ScalarParts> ScalarMapStorage;
133 return VectorMapStorage.count(Key);
138 assert(Part < UF &&
"Queried Vector Part is too large.");
139 if (!hasAnyVectorValue(Key))
142 assert(Entry.
size() == UF &&
"VectorParts has wrong dimensions.");
143 return Entry[Part] !=
nullptr;
148 return ScalarMapStorage.count(Key);
153 assert(Instance.
Part < UF &&
"Queried Scalar Part is too large.");
154 assert(Instance.
Lane < VF &&
"Queried Scalar Lane is too large.");
155 if (!hasAnyScalarValue(Key))
158 assert(Entry.
size() == UF &&
"ScalarParts has wrong dimensions.");
160 "ScalarParts has wrong dimensions.");
161 return Entry[Instance.
Part][Instance.
Lane] !=
nullptr;
167 assert(hasVectorValue(Key, Part) &&
"Getting non-existent value.");
168 return VectorMapStorage[
Key][Part];
174 assert(hasScalarValue(Key, Instance) &&
"Getting non-existent value.");
175 return ScalarMapStorage[
Key][Instance.
Part][Instance.
Lane];
181 assert(!hasVectorValue(Key, Part) &&
"Vector value already set for part");
182 if (!VectorMapStorage.count(Key)) {
184 VectorMapStorage[
Key] = Entry;
192 assert(!hasScalarValue(Key, Instance) &&
"Scalar value already set");
193 if (!ScalarMapStorage.count(Key)) {
197 for (
unsigned Part = 0; Part < UF; ++Part)
198 Entry[Part].resize(VF,
nullptr);
199 ScalarMapStorage[
Key] = Entry;
209 assert(hasVectorValue(Key, Part) &&
"Vector value not set for part");
219 assert(hasScalarValue(Key, Instance) &&
220 "Scalar value not set for part and lane");
229 virtual Value *getOrCreateVectorValues(
Value *V,
unsigned Part) = 0;
230 virtual Value *getOrCreateScalarValue(
Value *V,
240 : VF(VF), UF(UF), Instance(), LI(LI), DT(DT), Builder(Builder),
241 ValueMap(ValueMap), ILV(ILV), Callback(Callback) {}
268 if (
Data.PerPartOutput.count(Def))
269 return Data.PerPartOutput[Def][Part];
271 return Callback.getOrCreateVectorValues(VPValue2Value[Def], Part);
278 return Callback.getOrCreateScalarValue(VPValue2Value[Def], Instance);
283 if (!
Data.PerPartOutput.count(Def)) {
285 Data.PerPartOutput[
Def] = Entry;
287 Data.PerPartOutput[
Def][Part] = V;
347 const unsigned char SubclassID;
370 assert(Successor &&
"Cannot add nullptr successor!");
376 assert(Predecessor &&
"Cannot add nullptr predecessor!");
383 assert(Pos &&
"Predecessor does not exist");
384 Predecessors.
erase(Pos);
390 assert(Pos &&
"Successor does not exist");
391 Successors.
erase(Pos);
396 : SubclassID(SC), Name(N) {}
403 using VPBlockTy =
enum { VPBasicBlockSC, VPRegionBlockSC };
444 return (Successors.
size() == 1 ? *Successors.
begin() :
nullptr);
450 return (Predecessors.
size() == 1 ? *Predecessors.
begin() :
nullptr);
516 assert(Successors.
empty() &&
"Setting one successor when others exist.");
517 appendSuccessor(Successor);
526 assert(Successors.
empty() &&
"Setting two successors when others exist.");
527 assert(Condition &&
"Setting two successors without condition!");
529 appendSuccessor(IfTrue);
530 appendSuccessor(IfFalse);
537 assert(Predecessors.
empty() &&
"Block predecessors already set.");
538 for (
auto *Pred : NewPreds)
539 appendPredecessor(Pred);
565 printAsOperand(OS,
false);
583 const unsigned char SubclassID;
601 VPWidenIntOrFpInductionSC,
602 VPWidenMemoryInstructionSC,
640 void removeFromParent();
658 Not = Instruction::OtherOpsEnd + 1,
665 typedef unsigned char OpcodeTy;
674 return cast_or_null<Instruction>(getUnderlyingValue());
720 Opcode == Instruction::Invoke || Opcode == SLPStore;
766 bool IsPtrLoopInvariant;
772 IsIndexLoopInvariant(GEP->getNumIndices(),
false) {
775 IsIndexLoopInvariant[
Index.index()] =
801 :
VPRecipeBase(VPWidenIntOrFpInductionSC), IV(IV), Trunc(Trunc) {}
806 return V->
getVPRecipeID() == VPRecipeBase::VPWidenIntOrFpInductionSC;
845 std::unique_ptr<VPUser>
User;
852 "Expected the same number of incoming values and masks");
854 User.reset(
new VPUser(Masks));
931 :
VPRecipeBase(VPReplicateSC), Ingredient(I), IsUniform(IsUniform),
932 IsPredicated(IsPredicated) {
938 AlsoPack = IsPredicated && !I->
use_empty();
962 std::unique_ptr<VPUser>
User;
967 User.reset(
new VPUser({BlockInMask}));
981 O <<
" +\n" << Indent <<
"\"BRANCH-ON-MASK ";
983 O << *User->getOperand(0);
1029 :
VPRecipeBase(VPWidenMemoryInstructionSC), Instr(Instr), User({Addr}) {
1036 return V->
getVPRecipeID() == VPRecipeBase::VPWidenMemoryInstructionSC;
1073 appendRecipe(Recipe);
1097 inline size_t size()
const {
return Recipes.size(); }
1098 inline bool empty()
const {
return Recipes.empty(); }
1109 return &VPBasicBlock::Recipes;
1114 return V->
getVPBlockID() == VPBlockBase::VPBasicBlockSC;
1118 assert(Recipe &&
"No recipe to append.");
1119 assert(!Recipe->Parent &&
"Recipe already in VPlan");
1120 Recipe->Parent =
this;
1121 Recipes.
insert(InsertPt, Recipe);
1160 const std::string &Name =
"",
bool IsReplicator =
false)
1161 :
VPBlockBase(VPRegionBlockSC, Name), Entry(Entry), Exit(Exit),
1162 IsReplicator(IsReplicator) {
1169 :
VPBlockBase(VPRegionBlockSC, Name), Entry(nullptr), Exit(nullptr),
1170 IsReplicator(IsReplicator) {}
1179 return V->
getVPBlockID() == VPBlockBase::VPRegionBlockSC;
1189 "Entry block cannot have predecessors.");
1207 "Exit block cannot have successors.");
1329 return N.
Graph->getExit();
1370 VPValue *BackedgeTakenCount =
nullptr;
1388 for (
auto &MapEntry : Value2VPValue)
1389 if (MapEntry.second != BackedgeTakenCount)
1390 delete MapEntry.second;
1391 if (BackedgeTakenCount)
1392 delete BackedgeTakenCount;
1409 if (!BackedgeTakenCount)
1410 BackedgeTakenCount =
new VPValue();
1411 return BackedgeTakenCount;
1425 VPExternalDefs.
insert(VPVal);
1434 assert(V &&
"Trying to add a null Value to VPlan");
1435 assert(!Value2VPValue.
count(V) &&
"Value already exists in VPlan");
1436 Value2VPValue[V] =
new VPValue();
1440 assert(V &&
"Trying to get the VPValue of a null Value");
1441 assert(Value2VPValue.
count(V) &&
"Value does not exist in VPlan");
1442 return Value2VPValue[V];
1446 assert(V &&
"Trying to get or add the VPValue of a null Value");
1447 if (!Value2VPValue.
count(V))
1449 return getVPValue(V);
1478 unsigned TabWidth = 2;
1486 void bumpIndent(
int b) { Indent = std::string((Depth += b) * TabWidth,
' '); }
1502 unsigned getOrCreateBID(
const VPBlockBase *Block) {
1503 return BlockID.
count(Block) ? BlockID[Block] : BlockID[Block] = BID++;
1512 const Twine &Label);
1526 VPlanPrinter::printAsIngredient(OS, I.
V);
1552 "Can't insert new block with successors.");
1570 "Can't insert IfTrue with successors.");
1572 "Can't insert IfFalse with successors.");
1586 "Can't connect two block with different parents");
1588 "Blocks can't have more than two successors.");
1589 From->appendSuccessor(To);
1590 To->appendPredecessor(From);
1596 assert(To &&
"Successor to disconnect is null.");
1597 From->removeSuccessor(To);
1598 To->removePredecessor(From);
1605 FromBlock->
getParent() &&
"Must be in same region");
1608 if (!FromLoop || !ToLoop || FromLoop != ToLoop)
1619 return ParentVPL->isLoopLatch(Block);
1662 for (
auto &
I : InterleaveGroupMap)
1664 for (
auto *Ptr : DelSet)
1671 InterleaveGroup<VPInstruction> *
1673 if (InterleaveGroupMap.
count(Instr))
1674 return InterleaveGroupMap.
find(Instr)->second;
1687 struct BundleDenseMapInfo {
1689 return {
reinterpret_cast<VPValue *
>(-1)};
1693 return {
reinterpret_cast<VPValue *
>(-2)};
1717 bool CompletelySLP =
true;
1720 unsigned WidestBundleBits = 0;
1722 using MultiNodeOpTy =
1723 typename std::pair<VPInstruction *, SmallVector<VPValue *, 4>>;
1732 bool MultiNodeActive =
false;
1741 VPInstruction *markFailed();
1750 std::pair<OpMode, VPValue *> getBest(OpMode
Mode,
VPValue *Last,
1761 for (
auto &KV : BundleToCombined)
1777 #endif // LLVM_TRANSFORMS_VECTORIZE_VPLAN_H const std::string & getName() const
VPWidenMemoryInstructionRecipe(Instruction &Instr, VPValue *Addr, VPValue *Mask)
VPWidenRecipe(Instruction *I)
const_iterator end(StringRef path)
Get end iterator over path.
Value * getPointerOperand()
const VPRegionBlock * getParent() const
bool appendInstruction(Instruction *Instr)
Augment the recipe to include Instr, if it lies at its End.
static NodeRef getEntryNode(Inverse< GraphRef > N)
void setAlsoPack(bool Pack)
static bool classof(const VPRecipeBase *V)
Method to support type inquiry through isa, cast, and dyn_cast.
enum { VPBasicBlockSC, VPRegionBlockSC } VPBlockTy
An enumeration for keeping track of the concrete subclass of VPBlockBase that are actually instantiat...
const_iterator begin(StringRef path, Style style=Style::native)
Get begin iterator over path.
VectorizerValueMap(unsigned UF, unsigned VF)
Construct an empty map with the given unroll and vectorization factors.
This is a 'bitvector' (really, a variable-sized bit array), optimized for the case when the array is ...
SmallVectorImpl< VPBlockBase * >::const_iterator ChildIteratorType
This class represents lattice values for constants.
InnerLoopVectorizer vectorizes loops which contain only one basic block to a specified vectorization ...
VPRegionBlock(VPBlockBase *Entry, VPBlockBase *Exit, const std::string &Name="", bool IsReplicator=false)
const_reverse_iterator rbegin() const
static NodeRef getEntryNode(GraphRef N)
VPRegionBlock * getParent()
VPlan models a candidate for vectorization, encoding various decisions take to produce efficient outp...
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
VPInstruction(unsigned Opcode, ArrayRef< VPValue *> Operands)
static bool isBackEdge(const VPBlockBase *FromBlock, const VPBlockBase *ToBlock, const VPLoopInfo *VPLI)
Returns true if the edge FromBlock -> ToBlock is a back-edge.
Value * getScalarValue(Value *Key, const VPIteration &Instance)
Retrieve the existing scalar value that corresponds to Key and Instance.
void push_back(const T &Elt)
void setEntry(VPBlockBase *EntryBlock)
Set EntryBlock as the entry VPBlockBase of this VPRegionBlock.
VPlanIngredient(Value *V)
VPRegionBlock represents a collection of VPBasicBlocks and VPRegionBlocks which form a Single-Entry-S...
This is a helper struct for maintaining vectorization state.
bool mayWriteToMemory() const
Return true if this instruction may modify memory.
void setPredicate(VPValue *Pred)
A Recipe for widening load/store operations.
VPValue * getAddr() const
Return the address accessed by this recipe.
VPValue * getAddr() const
Return the address accessed by this recipe.
Instruction * getUnderlyingInstr()
void print(raw_ostream &O, const Twine &Indent) const override
Print the recipe.
void clearSuccessors()
Remove all the successors of this block and set to null its condition bit.
bool hasAnyScalarValue(Value *Key) const
void addExternalDef(VPValue *VPVal)
Add VPVal to the pool of external definitions if it's not already in the pool.
VPBlockBase * getSingleSuccessor() const
void addVPValue(Value *V)
VPValue * getOperand(unsigned N) const
print alias Alias Set Printer
static bool classof(const VPRecipeBase *V)
Method to support type inquiry through isa, cast, and dyn_cast.
VPlanSlp(VPInterleavedAccessInfo &IAI, VPBasicBlock &BB)
A recipe for handling GEP instructions.
VPRecipeBase is a base class modeling a sequence of one or more output IR instructions.
unsigned getVPRecipeID() const
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
VPValue * getVPValue(Value *V)
void clearPredecessors()
Remove all the predecessor of this block.
bool hasAnyVectorValue(Value *Key) const
static bool classof(const VPRecipeBase *R)
Method to support type inquiry through isa, cast, and dyn_cast.
VPPredInstPHIRecipe is a recipe for generating the phi nodes needed when control converges back from ...
const VPBlocksTy & getHierarchicalSuccessors()
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
LoopT * getLoopFor(const BlockT *BB) const
Return the inner most loop that BB lives in.
static void insertBlockAfter(VPBlockBase *NewBlock, VPBlockBase *BlockPtr)
Insert disconnected VPBlockBase NewBlock after BlockPtr.
bool hasVectorValue(Value *Key, unsigned Part) const
VPBlocksTy & getSuccessors()
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
static StringRef getName(Value *V)
A recipe for handling all phi nodes except for integer and FP inductions.
~VPRegionBlock() override
void setName(const Twine &newName)
mir Rename Register Operands
void insert(VPRecipeBase *Recipe, iterator InsertPt)
const std::string & getName() const
VPBlocksTy & getPredecessors()
static RecipeListTy VPBasicBlock::* getSublistAccess(VPRecipeBase *)
Returns a pointer to a member of the recipe list.
BlockT * getHeader() const
static ChildIteratorType child_end(NodeRef N)
void setName(const Twine &newName)
VPWidenPHIRecipe(PHINode *Phi)
static ChildIteratorType child_begin(NodeRef N)
static unsigned countSuccessorsNoBE(VPBlockBase *PredBlock, VPLoopInfo *VPLI)
Count and return the number of succesors of PredBlock excluding any backedges.
VPBlockBase * getSinglePredecessor() const
Drive the analysis of interleaved memory accesses in the loop.
VPlanPrinter prints a given VPlan to a given output stream.
static ChildIteratorType child_end(NodeRef N)
bool isReplicator() const
An indicator whether this region is to generate multiple replicated instances of output IR correspond...
InterleaveGroup< VPInstruction > * getInterleaveGroup(VPInstruction *Instr) const
Get the interleave group that Instr belongs to.
static nodes_iterator nodes_begin(GraphRef N)
static NodeRef getEntryNode(GraphRef N)
static bool classof(const VPRecipeBase *V)
Method to support type inquiry through isa, cast, and dyn_cast.
This class is used to enable the VPlan to invoke a method of ILV.
The group of interleaved loads/stores sharing the same stride and close to each other.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
const VPBlockBase * getExit() const
Hold analysis information for every loop detected by VPLoopInfo.
VPBlockBase * getSingleHierarchicalSuccessor()
VPBlockBase * getSingleHierarchicalPredecessor()
unsigned getVPBlockID() const
static bool classof(const VPValue *V)
Method to support type inquiry through isa, cast, and dyn_cast.
unsigned getVPValueID() const
VPInstruction(unsigned Opcode, std::initializer_list< VPValue *> Operands)
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree...
This class represents a truncation of integer types.
iterator begin()
Recipe iterator methods.
void resetScalarValue(Value *Key, const VPIteration &Instance, Value *Scalar)
Reset the scalar value associated with Key for Part and Lane.
bool isLegalToHoistInto()
Return true if it is legal to hoist instructions into this block.
iterator find(const_arg_type_t< KeyT > Val)
SmallVectorImpl< VPBlockBase * >::iterator ChildIteratorType
void appendRecipe(VPRecipeBase *Recipe)
Augment the existing recipes of a VPBasicBlock with an additional Recipe as the last recipe...
an instruction for type-safe pointer arithmetic to access elements of arrays and structs ...
const VPBlocksTy & getHierarchicalPredecessors()
static nodes_iterator nodes_end(GraphRef N)
bool isCompletelySLP() const
Return true if all visited instruction can be combined.
This class augments VPValue with operands which provide the inverse def-use edges from VPValue's user...
An ilist node that can access its parent list.
typename VPBlockBase *::UnknownGraphTypeError NodeRef
void setOneSuccessor(VPBlockBase *Successor)
Set a given VPBlockBase Successor as the single successor of this VPBlockBase.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
void dump(const SparseBitVector< ElementSize > &LHS, raw_ostream &out)
static bool classof(const VPRecipeBase *V)
Method to support type inquiry through isa, cast, and dyn_cast.
static ChildIteratorType child_begin(NodeRef N)
VPBlendRecipe(PHINode *Phi, ArrayRef< VPValue *> Masks)
void setExit(VPBlockBase *ExitBlock)
Set ExitBlock as the exit VPBlockBase of this VPRegionBlock.
This file defines VPLoopInfo analysis and VPLoop class.
reverse_iterator rbegin()
LLVM Basic Block Representation.
const VPValue * getCondBit() const
size_t size() const
size - Get the array size.
bool hasScalarValue(Value *Key, const VPIteration &Instance) const
VPWidenIntOrFpInductionRecipe(PHINode *IV, TruncInst *Trunc=nullptr)
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
size_t getNumPredecessors() const
static NodeRef getEntryNode(NodeRef N)
void addCBV(VPValue *CBV)
Add CBV to the vector of condition bit values.
VPInstruction * clone() const
std::unique_ptr< VPlan > VPlanPtr
static ChildIteratorType child_end(NodeRef N)
Class that maps (parts of) an existing VPlan to trees of combined VPInstructions. ...
void printAsOperand(raw_ostream &OS, bool PrintType) const
~VPInterleavedAccessInfo()
size_t getNumSuccessors() const
VPBlockBase * setEntry(VPBlockBase *Block)
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
self_iterator getIterator()
std::pair< NoneType, bool > insert(const T &V)
insert - Insert an element into the set if it isn't already there.
void setUnderlyingInstr(Instruction *I)
static bool classof(const VPBlockBase *V)
Method to support type inquiry through isa, cast, and dyn_cast.
VPBlockBase & front() const
SmallVectorImpl< VPBlockBase * >::iterator ChildIteratorType
iterator erase(const_iterator CI)
static void connectBlocks(VPBlockBase *From, VPBlockBase *To)
Connect VPBlockBases From and To bi-directionally.
auto find(R &&Range, const T &Val) -> decltype(adl_begin(Range))
Provide wrappers to std::find which take ranges instead of having to pass begin/end explicitly...
void setScalarValue(Value *Key, const VPIteration &Instance, Value *Scalar)
Set a scalar value associated with Key and Instance.
An intrusive list with ownership and callbacks specified/controlled by ilist_traits, only with API safe for polymorphic types.
static nodes_iterator nodes_end(GraphRef N)
static void deleteCFG(VPBlockBase *Entry)
Delete all blocks reachable from a given VPBlockBase, inclusive.
void setPredecessors(ArrayRef< VPBlockBase *> NewPreds)
Set each VPBasicBlock in NewPreds as predecessor of this VPBlockBase.
VPBasicBlock serves as the leaf of the Hierarchical Control-Flow Graph.
VPValue * getMask() const
Return the mask used by this recipe.
bool isLoopInvariant(const Value *V) const
Return true if the specified value is loop invariant.
VPBlockBase(const unsigned char SC, const std::string &N)
const_iterator begin() const
static bool blockIsLoopLatch(const VPBlockBase *Block, const VPLoopInfo *VPLInfo)
Returns true if Block is a loop latch.
const VPRecipeBase & back() const
Iterator for intrusive lists based on ilist_node.
void setTwoSuccessors(VPBlockBase *IfTrue, VPBlockBase *IfFalse, VPValue *Condition)
Set two given VPBlockBases IfTrue and IfFalse to be the two successors of this VPBlockBase.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
static void insertTwoBlocksAfter(VPBlockBase *IfTrue, VPBlockBase *IfFalse, VPValue *Condition, VPBlockBase *BlockPtr)
Insert disconnected VPBlockBases IfTrue and IfFalse after BlockPtr.
BlockVerifier::State From
A range of powers-of-2 vectorization factors with fixed start and adjustable end. ...
const VPRecipeBase & front() const
VPLoopInfo & getVPLoopInfo()
Return the VPLoopInfo analysis for this VPlan.
VPBlockBase is the building block of the Hierarchical Control-Flow Graph.
testing::Matcher< const detail::ErrorHolder & > Failed()
static NodeRef getEntryNode(Inverse< NodeRef > B)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
VPReplicateRecipe(Instruction *I, bool IsUniform, bool IsPredicated=false)
Class that provides utilities for VPBlockBases in VPlan.
static NodeRef getEntryNode(NodeRef N)
Predicate
Predicate - These are "(BI << 5) | BO" for various predicates.
CHAIN = SC CHAIN, Imm128 - System call.
static bool classof(const VPBlockBase *V)
Method to support type inquiry through isa, cast, and dyn_cast.
const InterleaveGroup< Instruction > * getInterleaveGroup()
void setCondBit(VPValue *CV)
const VPBlocksTy & getSuccessors() const
unsigned getNumIncomingValues() const
Return the number of incoming edges.
bool isLoopLatch(const BlockT *BB) const
const VPBlockBase * getEntry() const
VPInterleaveRecipe is a recipe for transforming an interleave group of load or stores into one wide l...
VPValue * getOrAddVPValue(Value *V)
VPValue * getOrCreateBackedgeTakenCount()
The backedge taken count of the original loop.
void resetVectorValue(Value *Key, unsigned Part, Value *Vector)
Reset the vector value associated with Key for the given Part.
hash_code hash_combine_range(InputIteratorT first, InputIteratorT last)
Compute a hash_code for a sequence of values.
enum { VPBlendSC, VPBranchOnMaskSC, VPInstructionSC, VPInterleaveSC, VPPredInstPHISC, VPReplicateSC, VPWidenGEPSC, VPWidenIntOrFpInductionSC, VPWidenMemoryInstructionSC, VPWidenPHISC, VPWidenSC, } VPRecipeTy
An enumeration for keeping track of the concrete subclass of VPRecipeBase that is actually instantiat...
VPInterleaveRecipe(const InterleaveGroup< Instruction > *IG, VPValue *Addr, VPValue *Mask)
VPRegionBlock(const std::string &Name="", bool IsReplicator=false)
iterator_range< op_iterator > indices()
const VPBasicBlock * getParent() const
void print(raw_ostream &OS) const
iterator insert(iterator where, pointer New)
const VPBlocksTy & getPredecessors() const
static nodes_iterator nodes_begin(GraphRef N)
Value * getVectorValue(Value *Key, unsigned Part)
Retrieve the existing vector value that corresponds to Key and Part.
VPReplicateRecipe replicates a given instruction producing multiple scalar copies of the original sca...
LLVM_NODISCARD bool empty() const
Represents a single loop in the control flow graph.
static bool classof(const VPRecipeBase *V)
Method to support type inquiry through isa, cast, and dyn_cast.
const VPValue * getPredicate() const
VPWidenGEPRecipe(GetElementPtrInst *GEP, Loop *OrigLoop)
static bool classof(const VPRecipeBase *V)
Method to support type inquiry through isa, cast, and dyn_cast.
VPRecipeBase(const unsigned char SC)
VPPredInstPHIRecipe(Instruction *PredInst)
Construct a VPPredInstPHIRecipe given PredInst whose value needs a phi nodes after merging back from ...
const VPBlockBase * getEntry() const
static bool classof(const VPRecipeBase *V)
Method to support type inquiry through isa, cast, and dyn_cast.
VPlan(VPBlockBase *Entry=nullptr)
A recipe for handling phi nodes of integer and floating-point inductions, producing their vector and ...
unsigned getOpcode() const
const_iterator end() const
raw_ostream & operator<<(raw_ostream &OS, const APInt &I)
size_type count(const_arg_type_t< KeyT > Val) const
Return 1 if the specified key is in the map, 0 otherwise.
std::string str() const
Return the twine contents as a std::string.
void setVectorValue(Value *Key, unsigned Part, Value *Vector)
Set a vector value associated with Key and Part.
unsigned getNumOperands() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static bool classof(const VPRecipeBase *V)
Method to support type inquiry through isa, cast, and dyn_cast.
VPBasicBlock * getParent()
VPWidenRecipe is a recipe for producing a copy of vector type for each Instruction in its ingredients...
This file contains the declarations of the entities induced by Vectorization Plans, e.g.
LLVM Value Representation.
VPValue * getMask() const
Return the mask used by this recipe.
A recipe for generating conditional branches on the bits of a mask.
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.
static ChildIteratorType child_begin(NodeRef N)
static bool classof(const VPRecipeBase *V)
Method to support type inquiry through isa, cast, and dyn_cast.
This class implements an extremely fast bulk output stream that can only output to a stream...
bool isEqual(const GCNRPTracker::LiveRegSet &S1, const GCNRPTracker::LiveRegSet &S2)
A recipe for vectorizing a phi-node as a sequence of mask-based select instructions.
In what follows, the term "input IR" refers to code that is fed into the vectorizer whereas the term ...
static nodes_iterator nodes_end(GraphRef N)
static bool classof(const VPRecipeBase *V)
Method to support type inquiry through isa, cast, and dyn_cast.
unsigned getWidestBundleBits() const
Return the width of the widest combined bundle in bits.
This is a concrete Recipe that models a single VPlan-level instruction.
RecipeListTy & getRecipeList()
Returns a reference to the list of recipes.
VPBranchOnMaskRecipe(VPValue *BlockInMask)
const_reverse_iterator rend() const
static nodes_iterator nodes_begin(GraphRef N)
VPBasicBlock(const Twine &Name="", VPRecipeBase *Recipe=nullptr)
void setParent(VPRegionBlock *P)
static void disconnectBlocks(VPBlockBase *From, VPBlockBase *To)
Disconnect VPBlockBases From and To bi-directionally.
bool empty() const
empty - Check if the array is empty.
detail::enumerator< R > enumerate(R &&TheRange)
Given an input range, returns a new range whose values are are pair (A,B) such that A is the 0-based ...
void addOperand(VPValue *Operand)
const VPLoopInfo & getVPLoopInfo() const
size_type count(const T &V) const
count - Return 1 if the element is in the set, 0 otherwise.