struct VPTransformState
Declaration
struct VPTransformState { /* full declaration omitted */ };
Description
VPTransformState holds information passed down when "executing" a VPlan, needed for generating the output IR.
Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:201
Member Variables
- public llvm::ElementCount VF
- The chosen Vectorization and Unroll Factors of the loop being vectorized.
- public unsigned int UF
- public Optional<llvm::VPIteration> Instance
- Hold the indices to generate specific scalar instructions. Null indicates that all instances are to be generated, using either scalar or vector instructions.
- public struct DataState Data
- public struct CFGState CFG
- public llvm::LoopInfo* LI
- Hold a pointer to LoopInfo to register new basic blocks in the loop.
- public llvm::DominatorTree* DT
- Hold a pointer to Dominator Tree to register new basic blocks in the loop.
- public llvm::IRBuilderBase& Builder
- Hold a reference to the IRBuilder used to generate output IR code.
- public llvm::VPValue2ValueTy VPValue2Value
- public llvm::Value* CanonicalIV = nullptr
- Hold the canonical scalar IV of the vector loop (start=0, step=VF*UF).
- public llvm::InnerLoopVectorizer* ILV
- Hold a pointer to InnerLoopVectorizer to reuse its IR generation methods.
- public llvm::VPlan* Plan
- Pointer to the VPlan code is generated for.
- public SmallPtrSet<llvm::VPRecipeBase*, 16> MayGeneratePoisonRecipes
- Holds recipes that may generate a poison value that is used after vectorization, even when their operands are not poison.
- public llvm::Loop* CurrentVectorLoop = nullptr
- The loop object for the current parent region, or nullptr.
- public std::unique_ptr<LoopVersioning> LVer
- This is currently only used to add no-alias metadata based on the memchecks. The actually versioning is performed manually.
Method Overview
- public VPTransformState(llvm::ElementCount VF, unsigned int UF, llvm::LoopInfo * LI, llvm::DominatorTree * DT, llvm::IRBuilderBase & Builder, llvm::InnerLoopVectorizer * ILV, llvm::VPlan * Plan)
- public void addMetadata(llvm::Instruction * To, llvm::Instruction * From)
- public void addMetadata(ArrayRef<llvm::Value *> To, llvm::Instruction * From)
- public void addNewMetadata(llvm::Instruction * To, const llvm::Instruction * Orig)
- public llvm::Value * get(llvm::VPValue * Def, unsigned int Part)
- public llvm::Value * get(llvm::VPValue * Def, const llvm::VPIteration & Instance)
- public bool hasAnyVectorValue(llvm::VPValue * Def) const
- public bool hasScalarValue(llvm::VPValue * Def, llvm::VPIteration Instance)
- public bool hasVectorValue(llvm::VPValue * Def, unsigned int Part)
- public void reset(llvm::VPValue * Def, llvm::Value * V, unsigned int Part)
- public void reset(llvm::VPValue * Def, llvm::Value * V, const llvm::VPIteration & Instance)
- public void set(llvm::VPValue * Def, llvm::Value * V, unsigned int Part)
- public void set(llvm::VPValue * Def, llvm::Value * V, const llvm::VPIteration & Instance)
- public void setDebugLocFromInst(const llvm::Value * V)
Methods
¶VPTransformState(llvm::ElementCount VF,
unsigned int UF,
llvm::LoopInfo* LI,
llvm::DominatorTree* DT,
llvm::IRBuilderBase& Builder,
llvm::InnerLoopVectorizer* ILV,
llvm::VPlan* Plan)
VPTransformState(llvm::ElementCount VF,
unsigned int UF,
llvm::LoopInfo* LI,
llvm::DominatorTree* DT,
llvm::IRBuilderBase& Builder,
llvm::InnerLoopVectorizer* ILV,
llvm::VPlan* Plan)
Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:202
Parameters
- llvm::ElementCount VF
- unsigned int UF
- llvm::LoopInfo* LI
- llvm::DominatorTree* DT
- llvm::IRBuilderBase& Builder
- llvm::InnerLoopVectorizer* ILV
- llvm::VPlan* Plan
¶void addMetadata(llvm::Instruction* To,
llvm::Instruction* From)
void addMetadata(llvm::Instruction* To,
llvm::Instruction* From)
Description
Add metadata from one instruction to another. This includes both the original MDs from \p From and additional ones (
Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:314
Parameters
- llvm::Instruction* To
- llvm::Instruction* From
¶void addMetadata(ArrayRef<llvm::Value*> To,
llvm::Instruction* From)
void addMetadata(ArrayRef<llvm::Value*> To,
llvm::Instruction* From)
Description
Similar to the previous function but it adds the metadata to a vector of instructions.
Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:318
Parameters
- ArrayRef<llvm::Value*> To
- llvm::Instruction* From
¶void addNewMetadata(llvm::Instruction* To,
const llvm::Instruction* Orig)
void addNewMetadata(llvm::Instruction* To,
const llvm::Instruction* Orig)
Description
Add additional metadata to \p To that was not present on \p Orig. Currently this is used to add the noalias annotations based on the inserted memchecks. Use this for instructions that are *cloned* into the vector loop.
Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:307
Parameters
- llvm::Instruction* To
- const llvm::Instruction* Orig
¶llvm::Value* get(llvm::VPValue* Def,
unsigned int Part)
llvm::Value* get(llvm::VPValue* Def,
unsigned int Part)
Description
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.
Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:234
Parameters
- llvm::VPValue* Def
- unsigned int Part
¶llvm::Value* get(
llvm::VPValue* Def,
const llvm::VPIteration& Instance)
llvm::Value* get(
llvm::VPValue* Def,
const llvm::VPIteration& Instance)
Description
Get the generated Value for a given VPValue and given Part and Lane.
Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:237
Parameters
- llvm::VPValue* Def
- const llvm::VPIteration& Instance
¶bool hasAnyVectorValue(llvm::VPValue* Def) const
bool hasAnyVectorValue(llvm::VPValue* Def) const
Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:245
Parameters
- llvm::VPValue* Def
¶bool hasScalarValue(llvm::VPValue* Def,
llvm::VPIteration Instance)
bool hasScalarValue(llvm::VPValue* Def,
llvm::VPIteration Instance)
Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:249
Parameters
- llvm::VPValue* Def
- llvm::VPIteration Instance
¶bool hasVectorValue(llvm::VPValue* Def,
unsigned int Part)
bool hasVectorValue(llvm::VPValue* Def,
unsigned int Part)
Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:239
Parameters
- llvm::VPValue* Def
- unsigned int Part
¶void reset(llvm::VPValue* Def,
llvm::Value* V,
unsigned int Part)
void reset(llvm::VPValue* Def,
llvm::Value* V,
unsigned int Part)
Description
Reset an existing vector value for \p Def and a given \p Part.
Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:268
Parameters
- llvm::VPValue* Def
- llvm::Value* V
- unsigned int Part
¶void reset(llvm::VPValue* Def,
llvm::Value* V,
const llvm::VPIteration& Instance)
void reset(llvm::VPValue* Def,
llvm::Value* V,
const llvm::VPIteration& Instance)
Description
Reset an existing scalar value for \p Def and a given \p Instance.
Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:290
Parameters
- llvm::VPValue* Def
- llvm::Value* V
- const llvm::VPIteration& Instance
¶void set(llvm::VPValue* Def,
llvm::Value* V,
unsigned int Part)
void set(llvm::VPValue* Def,
llvm::Value* V,
unsigned int Part)
Description
Set the generated Value for a given VPValue and a given Part.
Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:260
Parameters
- llvm::VPValue* Def
- llvm::Value* V
- unsigned int Part
¶void set(llvm::VPValue* Def,
llvm::Value* V,
const llvm::VPIteration& Instance)
void set(llvm::VPValue* Def,
llvm::Value* V,
const llvm::VPIteration& Instance)
Description
Set the generated scalar \p V for \p Def and the given \p Instance.
Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:276
Parameters
- llvm::VPValue* Def
- llvm::Value* V
- const llvm::VPIteration& Instance
¶void setDebugLocFromInst(const llvm::Value* V)
void setDebugLocFromInst(const llvm::Value* V)
Description
Set the debug location in the builder using the debug location in \p V.
Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:321
Parameters
- const llvm::Value* V