LLVM
13.0.0git
|
VPlan models a candidate for vectorization, encoding various decisions take to produce efficient output IR, including which branches, basic-blocks and output IR instructions to generate, and their cost. More...
#include "Transforms/Vectorize/VPlan.h"
Public Member Functions | |
VPlan (VPBlockBase *Entry=nullptr) | |
~VPlan () | |
void | execute (struct VPTransformState *State) |
Generate the IR code for this VPlan. More... | |
VPBlockBase * | getEntry () |
const VPBlockBase * | getEntry () const |
VPBlockBase * | setEntry (VPBlockBase *Block) |
VPValue * | getOrCreateBackedgeTakenCount () |
The backedge taken count of the original loop. More... | |
void | addVF (ElementCount VF) |
bool | hasVF (ElementCount VF) |
const std::string & | getName () const |
void | setName (const Twine &newName) |
void | addExternalDef (VPValue *VPVal) |
Add VPVal to the pool of external definitions if it's not already in the pool. More... | |
void | addVPValue (Value *V) |
void | addVPValue (Value *V, VPValue *VPV) |
VPValue * | getVPValue (Value *V) |
VPValue * | getOrAddVPValue (Value *V) |
void | removeVPValueFor (Value *V) |
VPLoopInfo & | getVPLoopInfo () |
Return the VPLoopInfo analysis for this VPlan. More... | |
const VPLoopInfo & | getVPLoopInfo () const |
void | print (raw_ostream &O) const |
Print this VPlan to O . More... | |
void | printDOT (raw_ostream &O) const |
Print this VPlan in DOT format to O . More... | |
LLVM_DUMP_METHOD void | dump () const |
Dump the plan to stderr (for debugging). More... | |
iterator_range< mapped_iterator< Use *, std::function< VPValue *(Value *)> > > | mapToVPValues (User::op_range Operands) |
Returns a range mapping the values the range Operands to their corresponding VPValues. More... | |
Friends | |
class | VPlanPrinter |
class | VPSlotTracker |
VPlan models a candidate for vectorization, encoding various decisions take to produce efficient output IR, including which branches, basic-blocks and output IR instructions to generate, and their cost.
VPlan holds a Hierarchical-CFG of VPBasicBlocks and VPRegionBlocks rooted at an Entry VPBlock.
|
inline |
|
inline |
Add VPVal
to the pool of external definitions if it's not already in the pool.
Definition at line 1841 of file VPlan.h.
References llvm::SetVector< T, Vector, Set >::insert().
|
inline |
Definition at line 1831 of file VPlan.h.
References llvm::SetVector< T, SmallVector< T, N >, SmallDenseSet< T, N > >::insert().
|
inline |
Definition at line 1843 of file VPlan.h.
References assert(), and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::count().
Referenced by getOrAddVPValue().
Definition at line 1851 of file VPlan.h.
References assert(), and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::count().
LLVM_DUMP_METHOD void VPlan::dump | ( | ) | const |
Dump the plan to stderr (for debugging).
Definition at line 788 of file VPlan.cpp.
References llvm::dbgs(), and print().
void VPlan::execute | ( | struct VPTransformState * | State | ) |
Generate the IR code for this VPlan.
Generate the code inside the body of the vectorized loop.
Assumes a single LoopVectorBody basic-block was created for this. Introduce additional basic-blocks as needed, and fill them all.
Definition at line 683 of file VPlan.cpp.
References llvm::LoopBase< BlockT, LoopT >::addBasicBlockToLoop(), assert(), BB, llvm::VPTransformState::Builder, Builder, llvm::VPTransformState::CFG, llvm::BranchInst::Create(), llvm::IRBuilderBase::CreateUnreachable(), llvm::depth_first(), llvm::VPTransformState::DT, EnableVPlanNativePath, llvm::Instruction::eraseFromParent(), llvm::ConstantInt::get(), llvm::VPBlockBase::getEntryBasicBlock(), llvm::LoopBase< BlockT, LoopT >::getExitBlock(), llvm::BasicBlock::getFirstInsertionPt(), llvm::VPBlockBase::getHierarchicalSuccessors(), llvm::LoopInfoBase< BlockT, LoopT >::getLoopFor(), llvm::VPValue::getNumUsers(), llvm::BasicBlock::getSingleSuccessor(), llvm::BasicBlock::getTerminator(), llvm::Value::getType(), llvm::VPTransformState::CFGState::LastBB, llvm::VPTransformState::LI, llvm::MergeBlockIntoPredecessor(), llvm::VPTransformState::CFGState::PrevBB, llvm::VPTransformState::CFGState::PrevVPBB, llvm::VPTransformState::set(), llvm::IRBuilderBase::SetInsertPoint(), llvm::BasicBlock::splitBasicBlock(), llvm::MCID::Terminator, llvm::VPTransformState::TripCount, llvm::VPTransformState::UF, llvm::VPTransformState::VF, llvm::VPTransformState::CFGState::VPBB2IRBB, llvm::VPTransformState::CFGState::VPBBsToFix, and llvm::VPTransformState::VPValue2Value.
|
inline |
Definition at line 1815 of file VPlan.h.
Referenced by llvm::VPlanPrinter::dump(), llvm::VPlanPredicator::predicate(), print(), llvm::VPBlockBase::setPlan(), llvm::VPInterleavedAccessInfo::VPInterleavedAccessInfo(), and llvm::VPlanPredicator::VPlanPredicator().
|
inline |
|
inline |
Definition at line 1835 of file VPlan.h.
Referenced by llvm::VPlanPrinter::dump().
Definition at line 1863 of file VPlan.h.
References addVPValue(), assert(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::count(), and getVPValue().
Referenced by mapToVPValues().
|
inline |
|
inline |
Return the VPLoopInfo analysis for this VPlan.
Definition at line 1873 of file VPlan.h.
Referenced by llvm::VPlanHCFGBuilder::buildHierarchicalCFG().
|
inline |
Definition at line 1857 of file VPlan.h.
References assert(), and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::count().
Referenced by llvm::InnerLoopVectorizer::clearReductionWrapFlags(), llvm::InnerLoopVectorizer::fixFirstOrderRecurrence(), llvm::InnerLoopVectorizer::fixLCSSAPHIs(), llvm::InnerLoopVectorizer::fixNonInductionPHIs(), llvm::InnerLoopVectorizer::fixReduction(), getOrAddVPValue(), and llvm::InnerLoopVectorizer::truncateToMinimalBitwidths().
|
inline |
Definition at line 1833 of file VPlan.h.
References llvm::SetVector< T, SmallVector< T, N >, SmallDenseSet< T, N > >::count().
|
inline |
Returns a range mapping the values the range Operands
to their corresponding VPValues.
Definition at line 1890 of file VPlan.h.
References function, getOrAddVPValue(), llvm::map_range(), and Operands.
LLVM_DUMP_METHOD void VPlan::print | ( | raw_ostream & | O | ) | const |
Print this VPlan to O
.
Definition at line 770 of file VPlan.cpp.
References llvm::depth_first(), getEntry(), and llvm::RISCVFenceField::O.
Referenced by dump(), and llvm::operator<<().
LLVM_DUMP_METHOD void VPlan::printDOT | ( | raw_ostream & | O | ) | const |
|
inline |
Definition at line 1870 of file VPlan.h.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::erase().
|
inline |
Definition at line 1818 of file VPlan.h.
Referenced by llvm::VPlanHCFGBuilder::buildHierarchicalCFG().
Definition at line 1837 of file VPlan.h.
References llvm::Twine::str().
Referenced by llvm::VPlanHCFGBuilder::buildHierarchicalCFG().
|
friend |
|
friend |