LLVM
15.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, IRBuilderBase &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... | |
IRBuilderBase & | 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... | |
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... | |
SmallPtrSet< VPRecipeBase *, 16 > | MayGeneratePoisonRecipes |
Holds recipes that may generate a poison value that is used after vectorization, even when their operands are not poison. More... | |
Loop * | CurrentVectorLoop = nullptr |
The loop object for the current parent region, or nullptr. 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 227 of file VPlan.cpp.
References assert(), Builder, llvm::IRBuilderBase::CreateExtractElement(), Data, llvm::tgtok::Def, hasScalarValue(), hasVectorValue(), Instance, llvm::VPTransformState::DataState::PerPartOutput, llvm::VPTransformState::DataState::PerPartScalars, and VF.
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 10139 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::VPWidenRecipe::execute(), llvm::VPWidenSelectRecipe::execute(), llvm::VPWidenGEPRecipe::execute(), llvm::VPWidenIntOrFpInductionRecipe::execute(), llvm::VPWidenPointerInductionRecipe::execute(), llvm::VPReductionPHIRecipe::execute(), llvm::VPReductionRecipe::execute(), llvm::VPBranchOnMaskRecipe::execute(), llvm::VPPredInstPHIRecipe::execute(), llvm::VPWidenMemoryInstructionRecipe::execute(), llvm::VPWidenCanonicalIVRecipe::execute(), llvm::VPScalarIVStepsRecipe::execute(), llvm::VPBasicBlock::execute(), llvm::InnerLoopVectorizer::fixFirstOrderRecurrence(), llvm::InnerLoopVectorizer::fixNonInductionPHIs(), llvm::VPLiveOut::fixPhi(), llvm::InnerLoopVectorizer::fixReduction(), llvm::InnerLoopVectorizer::packScalarIntoVectorValue(), llvm::InnerLoopVectorizer::scalarizeInstruction(), llvm::InnerLoopVectorizer::truncateToMinimalBitwidths(), llvm::InnerLoopVectorizer::vectorizeInterleaveGroup(), and llvm::InnerLoopVectorizer::widenCallInstruction().
|
inline |
Definition at line 243 of file VPlan.h.
References Data, llvm::tgtok::Def, and llvm::VPTransformState::DataState::PerPartOutput.
Referenced by llvm::InnerLoopVectorizer::truncateToMinimalBitwidths().
|
inline |
Definition at line 247 of file VPlan.h.
References Data, llvm::tgtok::Def, I, Instance, llvm::VPTransformState::DataState::PerPartScalars, and VF.
Referenced by llvm::VPPredInstPHIRecipe::execute(), and get().
|
inline |
Definition at line 237 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 288 of file VPlan.h.
References assert(), Data, llvm::tgtok::Def, Instance, llvm::VPTransformState::DataState::PerPartScalars, and VF.
Reset an existing vector value for Def
and a given Part
.
Definition at line 266 of file VPlan.h.
References assert(), Data, llvm::tgtok::Def, and llvm::VPTransformState::DataState::PerPartOutput.
Referenced by llvm::VPPredInstPHIRecipe::execute(), llvm::InnerLoopVectorizer::fixReduction(), and llvm::InnerLoopVectorizer::truncateToMinimalBitwidths().
|
inline |
Set the generated scalar V
for Def
and the given Instance
.
Definition at line 274 of file VPlan.h.
References assert(), Data, llvm::tgtok::Def, Instance, llvm::VPTransformState::DataState::PerPartScalars, and VF.
Set the generated Value for a given VPValue and a given Part.
Definition at line 258 of file VPlan.h.
References Data, llvm::tgtok::Def, and llvm::VPTransformState::DataState::PerPartOutput.
Referenced by buildScalarSteps(), llvm::VPWidenRecipe::execute(), llvm::VPWidenSelectRecipe::execute(), llvm::VPWidenGEPRecipe::execute(), llvm::VPWidenIntOrFpInductionRecipe::execute(), llvm::VPWidenPointerInductionRecipe::execute(), llvm::VPFirstOrderRecurrencePHIRecipe::execute(), llvm::VPReductionPHIRecipe::execute(), llvm::VPReductionRecipe::execute(), llvm::VPReplicateRecipe::execute(), llvm::VPPredInstPHIRecipe::execute(), llvm::VPWidenMemoryInstructionRecipe::execute(), llvm::VPExpandSCEVRecipe::execute(), llvm::VPCanonicalIVPHIRecipe::execute(), llvm::VPWidenCanonicalIVRecipe::execute(), llvm::VPScalarIVStepsRecipe::execute(), llvm::InnerLoopVectorizer::packScalarIntoVectorValue(), llvm::VPlan::prepareToExecute(), llvm::InnerLoopVectorizer::scalarizeInstruction(), llvm::InnerLoopVectorizer::vectorizeInterleaveGroup(), llvm::InnerLoopVectorizer::widenCallInstruction(), and llvm::InnerLoopVectorizer::widenPHIInstruction().
IRBuilderBase& llvm::VPTransformState::Builder |
Hold a reference to the IRBuilder used to generate output IR code.
Definition at line 336 of file VPlan.h.
Referenced by buildScalarSteps(), llvm::VPInstruction::execute(), llvm::VPWidenRecipe::execute(), llvm::VPWidenSelectRecipe::execute(), llvm::VPWidenGEPRecipe::execute(), llvm::VPWidenIntOrFpInductionRecipe::execute(), llvm::VPWidenPointerInductionRecipe::execute(), llvm::VPFirstOrderRecurrencePHIRecipe::execute(), llvm::VPReductionPHIRecipe::execute(), llvm::VPBlendRecipe::execute(), llvm::VPReductionRecipe::execute(), llvm::VPBranchOnMaskRecipe::execute(), llvm::VPPredInstPHIRecipe::execute(), llvm::VPWidenMemoryInstructionRecipe::execute(), llvm::VPExpandSCEVRecipe::execute(), llvm::VPWidenCanonicalIVRecipe::execute(), llvm::VPScalarIVStepsRecipe::execute(), llvm::VPBasicBlock::execute(), llvm::VPLiveOut::fixPhi(), get(), llvm::InnerLoopVectorizer::packScalarIntoVectorValue(), llvm::VPlan::prepareToExecute(), 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 341 of file VPlan.h.
Referenced by llvm::VPWidenCanonicalIVRecipe::execute().
struct llvm::VPTransformState::CFGState llvm::VPTransformState::CFG |
Referenced by llvm::VPWidenIntOrFpInductionRecipe::execute(), llvm::VPWidenPointerInductionRecipe::execute(), llvm::VPFirstOrderRecurrencePHIRecipe::execute(), llvm::VPReductionPHIRecipe::execute(), llvm::VPBranchOnMaskRecipe::execute(), llvm::VPExpandSCEVRecipe::execute(), llvm::VPCanonicalIVPHIRecipe::execute(), llvm::VPWidenCanonicalIVRecipe::execute(), llvm::VPBasicBlock::execute(), llvm::InnerLoopVectorizer::fixNonInductionPHIs(), llvm::InnerLoopVectorizer::fixReduction(), llvm::InnerLoopVectorizer::fixVectorizedLoop(), and llvm::VPlan::prepareToExecute().
Loop* llvm::VPTransformState::CurrentVectorLoop = nullptr |
The loop object for the current parent region, or nullptr.
Definition at line 354 of file VPlan.h.
Referenced by llvm::VPReductionPHIRecipe::execute(), and llvm::VPBasicBlock::execute().
struct llvm::VPTransformState::DataState llvm::VPTransformState::Data |
Referenced by get(), hasAnyVectorValue(), hasScalarValue(), hasVectorValue(), reset(), and set().
DominatorTree* llvm::VPTransformState::DT |
InnerLoopVectorizer* llvm::VPTransformState::ILV |
Hold a pointer to InnerLoopVectorizer to reuse its IR generation methods.
Definition at line 344 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::VPReductionRecipe::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 213 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::VPExpandSCEVRecipe::execute(), llvm::VPScalarIVStepsRecipe::execute(), llvm::VPBasicBlock::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 330 of file VPlan.h.
Referenced by llvm::VPBasicBlock::execute().
SmallPtrSet<VPRecipeBase *, 16> llvm::VPTransformState::MayGeneratePoisonRecipes |
Holds recipes that may generate a poison value that is used after vectorization, even when their operands are not poison.
Definition at line 351 of file VPlan.h.
Referenced by llvm::VPWidenRecipe::execute(), llvm::VPWidenGEPRecipe::execute(), and llvm::InnerLoopVectorizer::scalarizeInstruction().
VPlan* llvm::VPTransformState::Plan |
Pointer to the VPlan code is generated for.
Definition at line 347 of file VPlan.h.
Referenced by llvm::InnerLoopVectorizer::collectPoisonGeneratingRecipes(), llvm::VPlanPrinter::dump(), llvm::InnerLoopVectorizer::fixCrossIterationPHIs(), llvm::InnerLoopVectorizer::fixFirstOrderRecurrence(), llvm::InnerLoopVectorizer::fixNonInductionPHIs(), llvm::VPLiveOut::fixPhi(), llvm::InnerLoopVectorizer::fixReduction(), llvm::vputils::getOrCreateVPValueForSCEVExpr(), llvm::InnerLoopVectorizer::truncateToMinimalBitwidths(), and llvm::VPInterleavedAccessInfo::VPInterleavedAccessInfo().
unsigned llvm::VPTransformState::UF |
Definition at line 208 of file VPlan.h.
Referenced by buildScalarSteps(), llvm::VPInstruction::execute(), llvm::VPWidenRecipe::execute(), llvm::VPWidenSelectRecipe::execute(), llvm::VPWidenGEPRecipe::execute(), llvm::VPWidenIntOrFpInductionRecipe::execute(), llvm::VPWidenPointerInductionRecipe::execute(), llvm::VPReductionPHIRecipe::execute(), llvm::VPReductionRecipe::execute(), llvm::VPReplicateRecipe::execute(), llvm::VPWidenMemoryInstructionRecipe::execute(), llvm::VPExpandSCEVRecipe::execute(), llvm::VPCanonicalIVPHIRecipe::execute(), llvm::VPWidenCanonicalIVRecipe::execute(), llvm::VPScalarIVStepsRecipe::execute(), llvm::VPLiveOut::fixPhi(), and llvm::VPlan::prepareToExecute().
ElementCount llvm::VPTransformState::VF |
The chosen Vectorization and Unroll Factors of the loop being vectorized.
Definition at line 207 of file VPlan.h.
Referenced by buildScalarSteps(), llvm::VPWidenRecipe::execute(), llvm::VPWidenGEPRecipe::execute(), llvm::VPWidenIntOrFpInductionRecipe::execute(), llvm::VPWidenPointerInductionRecipe::execute(), llvm::VPFirstOrderRecurrencePHIRecipe::execute(), llvm::VPReductionPHIRecipe::execute(), llvm::VPReductionRecipe::execute(), llvm::VPReplicateRecipe::execute(), llvm::VPWidenMemoryInstructionRecipe::execute(), llvm::VPWidenCanonicalIVRecipe::execute(), llvm::VPScalarIVStepsRecipe::execute(), llvm::VPLiveOut::fixPhi(), get(), hasScalarValue(), llvm::VPWidenPointerInductionRecipe::onlyScalarsGenerated(), llvm::VPlan::prepareToExecute(), reset(), set(), and llvm::InnerLoopVectorizer::widenPHIInstruction().
VPValue2ValueTy llvm::VPTransformState::VPValue2Value |