LLVM
13.0.0git
|
VPTransformState holds information passed down when "executing" a VPlan, needed for generating the output IR. More...
#include "Transforms/Vectorize/VPlan.h"
Classes | |
struct | CFGState |
Hold state information used when constructing the CFG of the output IR, traversing the VPBasicBlocks and generating corresponding IR BasicBlocks. More... | |
struct | DataState |
Public Member Functions | |
VPTransformState (ElementCount VF, unsigned UF, LoopInfo *LI, DominatorTree *DT, IRBuilder<> &Builder, InnerLoopVectorizer *ILV, VPlan *Plan) | |
Value * | get (VPValue *Def, unsigned Part) |
Get the generated Value for a given VPValue and a given Part. More... | |
Value * | get (VPValue *Def, const VPIteration &Instance) |
Get the generated Value for a given VPValue and given Part and Lane. More... | |
bool | hasVectorValue (VPValue *Def, unsigned Part) |
bool | hasAnyVectorValue (VPValue *Def) const |
bool | hasScalarValue (VPValue *Def, VPIteration Instance) |
void | set (VPValue *Def, Value *V, unsigned Part) |
Set the generated Value for a given VPValue and a given Part. More... | |
void | reset (VPValue *Def, Value *V, unsigned Part) |
Reset an existing vector value for Def and a given Part . More... | |
void | set (VPValue *Def, Value *V, const VPIteration &Instance) |
Set the generated scalar V for Def and the given Instance . More... | |
void | reset (VPValue *Def, Value *V, const VPIteration &Instance) |
Reset an existing scalar value for Def and a given Instance . More... | |
Public Attributes | |
ElementCount | VF |
The chosen Vectorization and Unroll Factors of the loop being vectorized. More... | |
unsigned | UF |
Optional< VPIteration > | Instance |
Hold the indices to generate specific scalar instructions. More... | |
struct llvm::VPTransformState::DataState | Data |
struct llvm::VPTransformState::CFGState | CFG |
LoopInfo * | LI |
Hold a pointer to LoopInfo to register new basic blocks in the loop. More... | |
DominatorTree * | DT |
Hold a pointer to Dominator Tree to register new basic blocks in the loop. More... | |
IRBuilder & | Builder |
Hold a reference to the IRBuilder used to generate output IR code. More... | |
VPValue2ValueTy | VPValue2Value |
Value * | CanonicalIV = nullptr |
Hold the canonical scalar IV of the vector loop (start=0, step=VF*UF). More... | |
Value * | TripCount = nullptr |
Hold the trip count of the scalar loop. More... | |
InnerLoopVectorizer * | ILV |
Hold a pointer to InnerLoopVectorizer to reuse its IR generation methods. More... | |
VPlan * | Plan |
Pointer to the VPlan code is generated for. More... | |
VPTransformState holds information passed down when "executing" a VPlan, needed for generating the output IR.
|
inline |
Value * VPTransformState::get | ( | VPValue * | Def, |
const VPIteration & | Instance | ||
) |
Get the generated Value for a given VPValue and given Part and Lane.
Definition at line 243 of file VPlan.cpp.
References assert(), Builder, llvm::IRBuilderBase::CreateExtractElement(), Data, llvm::tgtok::Def, llvm::IRBuilderBase::getInt32(), hasScalarValue(), hasVectorValue(), Instance, llvm::VPTransformState::DataState::PerPartOutput, and llvm::VPTransformState::DataState::PerPartScalars.
Get the generated Value for a given VPValue and a given Part.
Note that as some Defs are still created by ILV and managed in its ValueMap, this method will delegate the call to ILV in such cases in order to provide callers a consistent API.
Definition at line 9144 of file LoopVectorize.cpp.
References assert(), B, llvm::InnerLoopVectorizer::Builder, llvm::Data, llvm::tgtok::Def, get, llvm::VectorType::get(), llvm::PoisonValue::get(), llvm::LinearPolySize< LeafTy >::getKnownMinValue(), llvm::LinearPolySize< LeafTy >::isScalable(), llvm::ElementCount::isScalar(), llvm::IRBuilderBase::restoreIP(), llvm::IRBuilderBase::saveIP(), set, llvm::IRBuilderBase::SetInsertPoint(), llvm::RegState::Undef, and llvm::InnerLoopVectorizer::VF.
Referenced by llvm::InnerLoopVectorizer::clearReductionWrapFlags(), llvm::VPReductionRecipe::execute(), llvm::VPBranchOnMaskRecipe::execute(), llvm::VPPredInstPHIRecipe::execute(), llvm::VPBasicBlock::execute(), llvm::InnerLoopVectorizer::fixFirstOrderRecurrence(), llvm::InnerLoopVectorizer::fixLCSSAPHIs(), llvm::InnerLoopVectorizer::fixNonInductionPHIs(), llvm::InnerLoopVectorizer::fixReduction(), llvm::InnerLoopVectorizer::packScalarIntoVectorValue(), llvm::InnerLoopVectorizer::scalarizeInstruction(), llvm::InnerLoopVectorizer::truncateToMinimalBitwidths(), llvm::InnerLoopVectorizer::vectorizeInterleaveGroup(), llvm::InnerLoopVectorizer::vectorizeMemoryInstruction(), llvm::InnerLoopVectorizer::widenCallInstruction(), llvm::InnerLoopVectorizer::widenGEP(), llvm::InnerLoopVectorizer::widenInstruction(), and llvm::InnerLoopVectorizer::widenSelectInstruction().
|
inline |
Definition at line 152 of file VPlan.h.
References Data, llvm::tgtok::Def, and llvm::VPTransformState::DataState::PerPartOutput.
Referenced by llvm::InnerLoopVectorizer::truncateToMinimalBitwidths().
|
inline |
Definition at line 156 of file VPlan.h.
References Data, llvm::tgtok::Def, I, Instance, and llvm::VPTransformState::DataState::PerPartScalars.
Referenced by llvm::VPPredInstPHIRecipe::execute(), and get().
|
inline |
Definition at line 146 of file VPlan.h.
References Data, llvm::tgtok::Def, I, and llvm::VPTransformState::DataState::PerPartOutput.
Referenced by llvm::VPPredInstPHIRecipe::execute(), and get().
|
inline |
Reset an existing scalar value for Def
and a given Instance
.
Definition at line 195 of file VPlan.h.
References assert(), Data, llvm::tgtok::Def, Instance, and llvm::VPTransformState::DataState::PerPartScalars.
Reset an existing vector value for Def
and a given Part
.
Definition at line 174 of file VPlan.h.
References assert(), Data, llvm::tgtok::Def, and llvm::VPTransformState::DataState::PerPartOutput.
Referenced by llvm::VPPredInstPHIRecipe::execute(), llvm::InnerLoopVectorizer::fixFirstOrderRecurrence(), llvm::InnerLoopVectorizer::fixReduction(), and llvm::InnerLoopVectorizer::truncateToMinimalBitwidths().
|
inline |
Set the generated scalar V
for Def
and the given Instance
.
Definition at line 182 of file VPlan.h.
References assert(), Data, llvm::tgtok::Def, Instance, and llvm::VPTransformState::DataState::PerPartScalars.
Set the generated Value for a given VPValue and a given Part.
Definition at line 166 of file VPlan.h.
References Data, llvm::tgtok::Def, and llvm::VPTransformState::DataState::PerPartOutput.
Referenced by llvm::InnerLoopVectorizer::buildScalarSteps(), llvm::VPReductionRecipe::execute(), llvm::VPReplicateRecipe::execute(), llvm::VPPredInstPHIRecipe::execute(), llvm::VPWidenCanonicalIVRecipe::execute(), llvm::VPlan::execute(), llvm::InnerLoopVectorizer::packScalarIntoVectorValue(), llvm::InnerLoopVectorizer::recordVectorLoopValueForInductionCast(), llvm::InnerLoopVectorizer::scalarizeInstruction(), llvm::InnerLoopVectorizer::vectorizeInterleaveGroup(), llvm::InnerLoopVectorizer::vectorizeMemoryInstruction(), llvm::InnerLoopVectorizer::widenCallInstruction(), llvm::InnerLoopVectorizer::widenGEP(), llvm::InnerLoopVectorizer::widenInstruction(), llvm::InnerLoopVectorizer::widenPHIInstruction(), and llvm::InnerLoopVectorizer::widenSelectInstruction().
IRBuilder& llvm::VPTransformState::Builder |
Hold a reference to the IRBuilder used to generate output IR code.
Definition at line 238 of file VPlan.h.
Referenced by llvm::VPBlendRecipe::execute(), llvm::VPReductionRecipe::execute(), llvm::VPBranchOnMaskRecipe::execute(), llvm::VPPredInstPHIRecipe::execute(), llvm::VPBasicBlock::execute(), llvm::VPlan::execute(), get(), llvm::InnerLoopVectorizer::packScalarIntoVectorValue(), and llvm::InnerLoopVectorizer::scalarizeInstruction().
Value* llvm::VPTransformState::CanonicalIV = nullptr |
Hold the canonical scalar IV of the vector loop (start=0, step=VF*UF).
Definition at line 243 of file VPlan.h.
Referenced by llvm::VPWidenCanonicalIVRecipe::execute().
struct llvm::VPTransformState::CFGState llvm::VPTransformState::CFG |
struct llvm::VPTransformState::DataState llvm::VPTransformState::Data |
Referenced by get(), hasAnyVectorValue(), hasScalarValue(), hasVectorValue(), reset(), and set().
DominatorTree* llvm::VPTransformState::DT |
Hold a pointer to Dominator Tree to register new basic blocks in the loop.
Definition at line 235 of file VPlan.h.
Referenced by llvm::VPlan::execute().
InnerLoopVectorizer* llvm::VPTransformState::ILV |
Hold a pointer to InnerLoopVectorizer to reuse its IR generation methods.
Definition at line 249 of file VPlan.h.
Referenced by llvm::VPWidenRecipe::execute(), llvm::VPWidenCallRecipe::execute(), llvm::VPWidenSelectRecipe::execute(), llvm::VPWidenGEPRecipe::execute(), llvm::VPWidenIntOrFpInductionRecipe::execute(), llvm::VPWidenPHIRecipe::execute(), llvm::VPBlendRecipe::execute(), llvm::VPInterleaveRecipe::execute(), llvm::VPReplicateRecipe::execute(), and llvm::VPWidenMemoryInstructionRecipe::execute().
Optional<VPIteration> llvm::VPTransformState::Instance |
Hold the indices to generate specific scalar instructions.
Null indicates that all instances are to be generated, using either scalar or vector instructions.
Definition at line 122 of file VPlan.h.
Referenced by llvm::VPInstruction::execute(), llvm::VPWidenIntOrFpInductionRecipe::execute(), llvm::VPInterleaveRecipe::execute(), llvm::VPReductionRecipe::execute(), llvm::VPReplicateRecipe::execute(), llvm::VPBranchOnMaskRecipe::execute(), llvm::VPPredInstPHIRecipe::execute(), llvm::VPBasicBlock::execute(), llvm::VPRegionBlock::execute(), get(), hasScalarValue(), reset(), and set().
LoopInfo* llvm::VPTransformState::LI |
Hold a pointer to LoopInfo to register new basic blocks in the loop.
Definition at line 232 of file VPlan.h.
Referenced by llvm::VPBasicBlock::execute(), and llvm::VPlan::execute().
VPlan* llvm::VPTransformState::Plan |
Pointer to the VPlan code is generated for.
Definition at line 252 of file VPlan.h.
Referenced by llvm::InnerLoopVectorizer::clearReductionWrapFlags(), llvm::InnerLoopVectorizer::fixFirstOrderRecurrence(), llvm::InnerLoopVectorizer::fixLCSSAPHIs(), llvm::InnerLoopVectorizer::fixNonInductionPHIs(), llvm::InnerLoopVectorizer::fixReduction(), and llvm::InnerLoopVectorizer::truncateToMinimalBitwidths().
Value* llvm::VPTransformState::TripCount = nullptr |
Hold the trip count of the scalar loop.
Definition at line 246 of file VPlan.h.
Referenced by llvm::VPlan::execute().
unsigned llvm::VPTransformState::UF |
Definition at line 117 of file VPlan.h.
Referenced by llvm::VPInstruction::execute(), llvm::VPWidenGEPRecipe::execute(), llvm::VPReductionRecipe::execute(), llvm::VPReplicateRecipe::execute(), llvm::VPWidenCanonicalIVRecipe::execute(), llvm::VPRegionBlock::execute(), llvm::VPlan::execute(), and llvm::InnerLoopVectorizer::widenPHIInstruction().
ElementCount llvm::VPTransformState::VF |
The chosen Vectorization and Unroll Factors of the loop being vectorized.
Definition at line 116 of file VPlan.h.
Referenced by llvm::VPWidenGEPRecipe::execute(), llvm::VPReplicateRecipe::execute(), llvm::VPWidenCanonicalIVRecipe::execute(), llvm::VPRegionBlock::execute(), llvm::VPlan::execute(), llvm::InnerLoopVectorizer::scalarizeInstruction(), and llvm::InnerLoopVectorizer::widenPHIInstruction().
VPValue2ValueTy llvm::VPTransformState::VPValue2Value |
Definition at line 240 of file VPlan.h.
Referenced by llvm::VPlan::execute().