LLVM  8.0.1
Public Member Functions | Friends | List of all members
llvm::VPlan Class Reference

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...
 
VPBlockBasegetEntry ()
 
const VPBlockBasegetEntry () const
 
VPBlockBasesetEntry (VPBlockBase *Block)
 
VPValuegetOrCreateBackedgeTakenCount ()
 The backedge taken count of the original loop. More...
 
void addVF (unsigned VF)
 
bool hasVF (unsigned 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 addCBV (VPValue *CBV)
 Add CBV to the vector of condition bit values. More...
 
void addVPValue (Value *V)
 
VPValuegetVPValue (Value *V)
 
VPLoopInfogetVPLoopInfo ()
 Return the VPLoopInfo analysis for this VPlan. More...
 
const VPLoopInfogetVPLoopInfo () const
 

Friends

class VPlanPrinter
 

Detailed Description

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.

Definition at line 1130 of file VPlan.h.

Constructor & Destructor Documentation

◆ VPlan()

llvm::VPlan::VPlan ( VPBlockBase Entry = nullptr)
inline

Definition at line 1165 of file VPlan.h.

◆ ~VPlan()

llvm::VPlan::~VPlan ( )
inline

Definition at line 1167 of file VPlan.h.

References llvm::tgtok::Def, and llvm::VPBlockBase::deleteCFG().

Member Function Documentation

◆ addCBV()

void llvm::VPlan::addCBV ( VPValue CBV)
inline

Add CBV to the vector of condition bit values.

Definition at line 1211 of file VPlan.h.

References llvm::SmallVectorTemplateBase< T >::push_back().

◆ addExternalDef()

void llvm::VPlan::addExternalDef ( VPValue VPVal)
inline

Add VPVal to the pool of external definitions if it's not already in the pool.

Definition at line 1206 of file VPlan.h.

References llvm::SmallPtrSetImpl< PtrType >::insert().

◆ addVF()

void llvm::VPlan::addVF ( unsigned  VF)
inline

Definition at line 1196 of file VPlan.h.

References llvm::SmallSet< T, N, C >::insert().

◆ addVPValue()

void llvm::VPlan::addVPValue ( Value V)
inline

◆ execute()

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 360 of file VPlan.cpp.

References llvm::LoopBase< BlockT, LoopT >::addBasicBlockToLoop(), llvm::DominatorTreeBase< NodeT, IsPostDom >::addNewBlock(), assert(), llvm::VPTransformState::Builder, llvm::VPTransformState::CFG, llvm::BranchInst::Create(), llvm::IRBuilder< T, Inserter >::CreateSub(), llvm::IRBuilder< T, Inserter >::CreateUnreachable(), llvm::Depth, llvm::depth_first(), llvm::VPTransformState::DT, E, llvm::Instruction::eraseFromParent(), llvm::DOT::EscapeString(), llvm::raw_ostream::flush(), From, llvm::ConstantInt::get(), llvm::VPRegionBlock::getEntry(), llvm::VPBlockBase::getEntryBasicBlock(), llvm::VPBlockBase::getExitBasicBlock(), llvm::BasicBlock::getFirstInsertionPt(), llvm::VPBlockBase::getHierarchicalSuccessors(), llvm::LoopInfoBase< BlockT, LoopT >::getLoopFor(), llvm::VPBlockBase::getName(), llvm::BasicBlock::getSinglePredecessor(), llvm::BasicBlock::getSingleSuccessor(), llvm::VPBlockBase::getSuccessors(), llvm::BasicBlock::getTerminator(), llvm::Value::getType(), llvm::cl::Hidden, I, Indent, llvm::VPRegionBlock::isReplicator(), llvm::VPTransformState::CFGState::LastBB, llvm::VPTransformState::LI, llvm_unreachable, llvm::MergeBlockIntoPredecessor(), llvm::RISCVFenceField::O, llvm::VPTransformState::CFGState::PrevBB, llvm::VPTransformState::CFGState::PrevVPBB, llvm::VPValue::printAsOperand(), llvm::Value::printAsOperand(), llvm::IRBuilderBase::SetInsertPoint(), llvm::BasicBlock::splitBasicBlock(), llvm::succ_begin(), llvm::succ_end(), llvm::Successor, llvm::MCID::Terminator, llvm::VPTransformState::TripCount, llvm::VPTransformState::CFGState::VPBB2IRBB, llvm::VPTransformState::CFGState::VPBBsToFix, and llvm::VPTransformState::VPValue2Value.

◆ getEntry() [1/2]

VPBlockBase* llvm::VPlan::getEntry ( )
inline

Definition at line 1184 of file VPlan.h.

Referenced by llvm::VPInterleavedAccessInfo::VPInterleavedAccessInfo().

◆ getEntry() [2/2]

const VPBlockBase* llvm::VPlan::getEntry ( ) const
inline

Definition at line 1185 of file VPlan.h.

◆ getName()

const std::string& llvm::VPlan::getName ( ) const
inline

Definition at line 1200 of file VPlan.h.

References Name.

◆ getOrCreateBackedgeTakenCount()

VPValue* llvm::VPlan::getOrCreateBackedgeTakenCount ( )
inline

The backedge taken count of the original loop.

Definition at line 1190 of file VPlan.h.

◆ getVPLoopInfo() [1/2]

VPLoopInfo& llvm::VPlan::getVPLoopInfo ( )
inline

Return the VPLoopInfo analysis for this VPlan.

Definition at line 1228 of file VPlan.h.

◆ getVPLoopInfo() [2/2]

const VPLoopInfo& llvm::VPlan::getVPLoopInfo ( ) const
inline

Definition at line 1229 of file VPlan.h.

◆ getVPValue()

VPValue* llvm::VPlan::getVPValue ( Value V)
inline

◆ hasVF()

bool llvm::VPlan::hasVF ( unsigned  VF)
inline

Definition at line 1198 of file VPlan.h.

References llvm::SmallSet< T, N, C >::count().

◆ setEntry()

VPBlockBase* llvm::VPlan::setEntry ( VPBlockBase Block)
inline

Definition at line 1187 of file VPlan.h.

◆ setName()

void llvm::VPlan::setName ( const Twine newName)
inline

Definition at line 1202 of file VPlan.h.

References llvm::Twine::str().

Friends And Related Function Documentation

◆ VPlanPrinter

friend class VPlanPrinter
friend

Definition at line 1131 of file VPlan.h.


The documentation for this class was generated from the following files: