LLVM
15.0.0git
|
VPRecipeBase is a base class modeling a sequence of one or more output IR instructions. More...
#include "Transforms/Vectorize/VPlan.h"
Public Member Functions | |
VPRecipeBase (const unsigned char SC, ArrayRef< VPValue * > Operands) | |
template<typename IterT > | |
VPRecipeBase (const unsigned char SC, iterator_range< IterT > Operands) | |
virtual | ~VPRecipeBase ()=default |
VPBasicBlock * | getParent () |
const VPBasicBlock * | getParent () const |
virtual void | execute (struct VPTransformState &State)=0 |
The method which generates the output IR instructions that correspond to this VPRecipe, thereby "executing" the VPlan. More... | |
void | insertBefore (VPRecipeBase *InsertPos) |
Insert an unlinked recipe into a basic block immediately before the specified recipe. More... | |
void | insertBefore (VPBasicBlock &BB, iplist< VPRecipeBase >::iterator IP) |
Insert an unlinked recipe into BB immediately before the insertion point IP ;. More... | |
void | insertAfter (VPRecipeBase *InsertPos) |
Insert an unlinked Recipe into a basic block immediately after the specified Recipe. More... | |
void | moveAfter (VPRecipeBase *MovePos) |
Unlink this recipe from its current VPBasicBlock and insert it into the VPBasicBlock that MovePos lives in, right after MovePos. More... | |
void | moveBefore (VPBasicBlock &BB, iplist< VPRecipeBase >::iterator I) |
Unlink this recipe and insert into BB before I. More... | |
void | removeFromParent () |
This method unlinks 'this' from the containing basic block, but does not delete it. More... | |
iplist< VPRecipeBase >::iterator | eraseFromParent () |
This method unlinks 'this' from the containing basic block and deletes it. More... | |
Instruction * | getUnderlyingInstr () |
Returns the underlying instruction, if the recipe is a VPValue or nullptr otherwise. More... | |
const Instruction * | getUnderlyingInstr () const |
bool | mayHaveSideEffects () const |
Returns true if the recipe may have side-effects. More... | |
bool | isPhi () const |
Returns true for PHI-like recipes. More... | |
bool | mayReadFromMemory () const |
Returns true if the recipe may read from memory. More... | |
bool | mayWriteToMemory () const |
Returns true if the recipe may write to memory. More... | |
bool | mayReadOrWriteMemory () const |
Returns true if the recipe may read from or write to memory. More... | |
![]() | |
VPRecipeBase * | getPrevNode () |
const VPRecipeBase * | getPrevNode () const |
Get the previous node, or nullptr for the list head. More... | |
VPRecipeBase * | getNextNode () |
Get the next node, or nullptr for the list tail. More... | |
const VPRecipeBase * | getNextNode () const |
Get the next node, or nullptr for the list tail. More... | |
![]() | |
self_iterator | getIterator () |
const_self_iterator | getIterator () const |
reverse_self_iterator | getReverseIterator () |
const_reverse_self_iterator | getReverseIterator () const |
bool | isSentinel () const |
Check whether this is the sentinel node. More... | |
![]() | |
VPDef (const unsigned char SC) | |
virtual | ~VPDef () |
VPValue * | getVPSingleValue () |
Returns the only VPValue defined by the VPDef. More... | |
const VPValue * | getVPSingleValue () const |
VPValue * | getVPValue (unsigned I) |
Returns the VPValue with index I defined by the VPDef. More... | |
const VPValue * | getVPValue (unsigned I) const |
ArrayRef< VPValue * > | definedValues () |
Returns an ArrayRef of the values defined by the VPDef. More... | |
ArrayRef< VPValue * > | definedValues () const |
Returns an ArrayRef of the values defined by the VPDef. More... | |
unsigned | getNumDefinedValues () const |
Returns the number of values defined by the VPDef. More... | |
unsigned | getVPDefID () const |
void | dump () const |
Dump the VPDef to stderr (for debugging). More... | |
virtual void | print (raw_ostream &O, const Twine &Indent, VPSlotTracker &SlotTracker) const =0 |
Each concrete VPDef prints itself. More... | |
![]() | |
VPUser ()=delete | |
VPUser (const VPUser &)=delete | |
VPUser & | operator= (const VPUser &)=delete |
virtual | ~VPUser () |
VPUserID | getVPUserID () const |
void | addOperand (VPValue *Operand) |
unsigned | getNumOperands () const |
VPValue * | getOperand (unsigned N) const |
void | setOperand (unsigned I, VPValue *New) |
void | removeLastOperand () |
operand_iterator | op_begin () |
const_operand_iterator | op_begin () const |
operand_iterator | op_end () |
const_operand_iterator | op_end () const |
operand_range | operands () |
const_operand_range | operands () const |
virtual bool | usesScalars (const VPValue *Op) const |
Returns true if the VPUser uses scalars of operand Op . More... | |
virtual bool | onlyFirstLaneUsed (const VPValue *Op) const |
Returns true if the VPUser only uses the first lane of operand Op . More... | |
Static Public Member Functions | |
static bool | classof (const VPDef *D) |
Method to support type inquiry through isa, cast, and dyn_cast. More... | |
static bool | classof (const VPUser *U) |
![]() | |
static bool | classof (const VPDef *Recipe) |
Method to support type inquiry through isa, cast, and dyn_cast. More... | |
Friends | |
class | VPBlockUtils |
Additional Inherited Members | |
![]() | |
using | VPRecipeTy = enum { VPBranchOnMaskSC, VPExpandSCEVSC, VPInstructionSC, VPInterleaveSC, VPReductionSC, VPReplicateSC, VPScalarIVStepsSC, VPWidenCallSC, VPWidenCanonicalIVSC, VPWidenGEPSC, VPWidenMemoryInstructionSC, VPWidenSC, VPWidenSelectSC, VPBlendSC, VPCanonicalIVPHISC, VPFirstOrderRecurrencePHISC, VPWidenPHISC, VPWidenIntOrFpInductionSC, VPWidenPointerInductionSC, VPPredInstPHISC, VPReductionPHISC, VPFirstPHISC=VPBlendSC, VPLastPHISC=VPReductionPHISC, } |
An enumeration for keeping track of the concrete subclass of VPRecipeBase that is actually instantiated. More... | |
![]() | |
enum | VPUserID { VPUserID::Recipe, VPUserID::LiveOut } |
Subclass identifier (for isa/dyn_cast). More... | |
typedef SmallVectorImpl< VPValue * >::iterator | operand_iterator |
typedef SmallVectorImpl< VPValue * >::const_iterator | const_operand_iterator |
typedef iterator_range< operand_iterator > | operand_range |
typedef iterator_range< const_operand_iterator > | const_operand_range |
![]() | |
using | self_iterator = ilist_iterator< ilist_detail::compute_node_options< VPRecipeBase, Options... >::type, false, false > |
using | const_self_iterator = ilist_iterator< ilist_detail::compute_node_options< VPRecipeBase, Options... >::type, false, true > |
using | reverse_self_iterator = ilist_iterator< ilist_detail::compute_node_options< VPRecipeBase, Options... >::type, true, false > |
using | const_reverse_self_iterator = ilist_iterator< ilist_detail::compute_node_options< VPRecipeBase, Options... >::type, true, true > |
![]() | |
ilist_node_with_parent ()=default | |
![]() | |
ilist_node_impl ()=default | |
![]() | |
void | printOperands (raw_ostream &O, VPSlotTracker &SlotTracker) const |
Print the operands to O . More... | |
VPUser (ArrayRef< VPValue * > Operands, VPUserID ID) | |
VPUser (std::initializer_list< VPValue * > Operands, VPUserID ID) | |
template<typename IterT > | |
VPUser (iterator_range< IterT > Operands, VPUserID ID) | |
VPRecipeBase is a base class modeling a sequence of one or more output IR instructions.
VPRecipeBase owns the the VPValues it defines through VPDef and is responsible for deleting its defined values. Single-value VPRecipeBases that also inherit from VPValue must make sure to inherit from VPRecipeBase before VPValue.
|
inline |
|
virtualdefault |
Definition at line 700 of file VPlan.h.
References llvm::VPUser::getVPUserID(), and llvm::VPUser::Recipe.
iplist< VPRecipeBase >::iterator VPRecipeBase::eraseFromParent | ( | ) |
This method unlinks 'this' from the containing basic block and deletes it.
Definition at line 657 of file VPlan.cpp.
References assert(), and getParent().
Referenced by llvm::VPlanTransforms::removeRedundantCanonicalIVs().
|
pure virtual |
The method which generates the output IR instructions that correspond to this VPRecipe, thereby "executing" the VPlan.
Implemented in llvm::VPHeaderPHIRecipe, llvm::VPScalarIVStepsRecipe, llvm::VPWidenCanonicalIVRecipe, llvm::VPCanonicalIVPHIRecipe, llvm::VPExpandSCEVRecipe, llvm::VPWidenMemoryInstructionRecipe, llvm::VPPredInstPHIRecipe, llvm::VPBranchOnMaskRecipe, llvm::VPReplicateRecipe, llvm::VPReductionRecipe, llvm::VPInterleaveRecipe, llvm::VPBlendRecipe, llvm::VPReductionPHIRecipe, llvm::VPFirstOrderRecurrencePHIRecipe, llvm::VPWidenPHIRecipe, llvm::VPWidenPointerInductionRecipe, llvm::VPWidenIntOrFpInductionRecipe, llvm::VPWidenGEPRecipe, llvm::VPWidenSelectRecipe, llvm::VPWidenCallRecipe, llvm::VPWidenRecipe, and llvm::VPInstruction.
|
inline |
Definition at line 649 of file VPlan.h.
Referenced by llvm::VPValue::dump(), llvm::VPDef::dump(), llvm::InnerLoopVectorizer::fixReduction(), insertAfter(), insertBefore(), and llvm::operator<<().
|
inline |
|
inline |
Returns the underlying instruction, if the recipe is a VPValue or nullptr otherwise.
Definition at line 687 of file VPlan.h.
References llvm::VPDef::getVPSingleValue().
|
inline |
Definition at line 690 of file VPlan.h.
References llvm::VPDef::getVPSingleValue().
void VPRecipeBase::insertAfter | ( | VPRecipeBase * | InsertPos | ) |
Insert an unlinked Recipe into a basic block immediately after the specified Recipe.
Definition at line 643 of file VPlan.cpp.
References assert(), llvm::ilist_node_impl< OptionsT >::getIterator(), getParent(), llvm::VPBasicBlock::getRecipeList(), and llvm::iplist_impl< IntrusiveListT, TraitsT >::insertAfter().
void VPRecipeBase::insertBefore | ( | VPBasicBlock & | BB, |
iplist< VPRecipeBase >::iterator | IP | ||
) |
void VPRecipeBase::insertBefore | ( | VPRecipeBase * | InsertPos | ) |
Insert an unlinked recipe into a basic block immediately before the specified recipe.
Definition at line 627 of file VPlan.cpp.
References assert(), llvm::ilist_node_impl< OptionsT >::getIterator(), getParent(), llvm::VPBasicBlock::getRecipeList(), and llvm::iplist_impl< IntrusiveListT, TraitsT >::insert().
Referenced by llvm::VPlanTransforms::VPInstructionsToVPRecipes().
|
inline |
Returns true for PHI-like recipes.
Definition at line 708 of file VPlan.h.
References llvm::VPDef::getVPDefID().
bool VPRecipeBase::mayHaveSideEffects | ( | ) | const |
bool VPRecipeBase::mayReadFromMemory | ( | ) | const |
Returns true if the recipe may read from memory.
Definition at line 559 of file VPlan.cpp.
Referenced by mayReadOrWriteMemory().
|
inline |
Returns true if the recipe may read from or write to memory.
Definition at line 719 of file VPlan.h.
References mayReadFromMemory(), and mayWriteToMemory().
bool VPRecipeBase::mayWriteToMemory | ( | ) | const |
Returns true if the recipe may write to memory.
Definition at line 528 of file VPlan.cpp.
Referenced by mayReadOrWriteMemory().
void VPRecipeBase::moveAfter | ( | VPRecipeBase * | MovePos | ) |
Unlink this recipe from its current VPBasicBlock and insert it into the VPBasicBlock that MovePos lives in, right after MovePos.
void VPRecipeBase::moveBefore | ( | VPBasicBlock & | BB, |
iplist< VPRecipeBase >::iterator | I | ||
) |
void VPRecipeBase::removeFromParent | ( | ) |
This method unlinks 'this' from the containing basic block, but does not delete it.
Definition at line 651 of file VPlan.cpp.
References assert(), and getParent().
|
friend |