LLVM
8.0.1
|
This is a helper struct for maintaining vectorization state. More...
#include "Transforms/Vectorize/VPlan.h"
Public Member Functions | |
VectorizerValueMap (unsigned UF, unsigned VF) | |
Construct an empty map with the given unroll and vectorization factors. More... | |
bool | hasAnyVectorValue (Value *Key) const |
bool | hasVectorValue (Value *Key, unsigned Part) const |
bool | hasAnyScalarValue (Value *Key) const |
bool | hasScalarValue (Value *Key, const VPIteration &Instance) const |
Value * | getVectorValue (Value *Key, unsigned Part) |
Retrieve the existing vector value that corresponds to Key and Part . More... | |
Value * | getScalarValue (Value *Key, const VPIteration &Instance) |
Retrieve the existing scalar value that corresponds to Key and Instance . More... | |
void | setVectorValue (Value *Key, unsigned Part, Value *Vector) |
Set a vector value associated with Key and Part . More... | |
void | setScalarValue (Value *Key, const VPIteration &Instance, Value *Scalar) |
Set a scalar value associated with Key and Instance . More... | |
void | resetVectorValue (Value *Key, unsigned Part, Value *Vector) |
Reset the vector value associated with Key for the given Part . More... | |
void | resetScalarValue (Value *Key, const VPIteration &Instance, Value *Scalar) |
Reset the scalar value associated with Key for Part and Lane . More... | |
Friends | |
struct | VPTransformState |
This is a helper struct for maintaining vectorization state.
It's used for mapping values from the original loop to their corresponding values in the new loop. Two mappings are maintained: one for vectorized values and one for scalarized values. Vectorized values are represented with UF vector values in the new loop, and scalarized values are represented with UF x VF scalar values in the new loop. UF and VF are the unroll and vectorization factors, respectively.
Entries can be added to either map with setVectorValue and setScalarValue, which assert that an entry was not already added before. If an entry is to replace an existing one, call resetVectorValue and resetScalarValue. This is currently needed to modify the mapped values during "fix-up" operations that occur once the first phase of widening is complete. These operations include type truncation and the second phase of recurrence widening.
Entries from either map can be retrieved using the getVectorValue and getScalarValue functions, which assert that the desired value exists.
|
inline |
Retrieve the existing scalar value that corresponds to Key
and Instance
.
Definition at line 173 of file VPlan.h.
References assert(), llvm::VPIteration::Lane, and llvm::VPIteration::Part.
Referenced by llvm::VPPredInstPHIRecipe::execute(), llvm::InnerLoopVectorizer::getOrCreateScalarValue(), llvm::InnerLoopVectorizer::getOrCreateVectorValue(), and llvm::InnerLoopVectorizer::packScalarIntoVectorValue().
Retrieve the existing vector value that corresponds to Key
and Part
.
Definition at line 166 of file VPlan.h.
References assert().
Referenced by llvm::VPPredInstPHIRecipe::execute(), llvm::InnerLoopVectorizer::fixFirstOrderRecurrence(), llvm::InnerLoopVectorizer::fixNonInductionPHIs(), llvm::InnerLoopVectorizer::fixReduction(), llvm::InnerLoopVectorizer::getOrCreateVectorValue(), and llvm::InnerLoopVectorizer::packScalarIntoVectorValue().
Key
. Definition at line 147 of file VPlan.h.
Referenced by llvm::InnerLoopVectorizer::getOrCreateVectorValue().
Key
. Definition at line 132 of file VPlan.h.
Referenced by llvm::InnerLoopVectorizer::truncateToMinimalBitwidths().
|
inline |
Key
and Instance
. Definition at line 152 of file VPlan.h.
References assert(), llvm::VPIteration::Lane, llvm::VPIteration::Part, and llvm::SmallVectorBase::size().
Referenced by llvm::InnerLoopVectorizer::getOrCreateScalarValue().
Key
and Part
. Definition at line 137 of file VPlan.h.
References assert(), and llvm::SmallVectorBase::size().
Referenced by llvm::VPPredInstPHIRecipe::execute(), and llvm::InnerLoopVectorizer::getOrCreateVectorValue().
|
inline |
Reset the scalar value associated with Key
for Part
and Lane
.
This function can be used to update values that have already been scalarized. This is the case for "fix-up" operations including scalar phi nodes for scalarized and predicated instructions.
Definition at line 217 of file VPlan.h.
References assert(), llvm::VPIteration::Lane, llvm::VPIteration::Part, and llvm::NVPTX::PTXLdStInstCode::Scalar.
Referenced by llvm::VPPredInstPHIRecipe::execute().
|
inline |
Reset the vector value associated with Key
for the given Part
.
This function can be used to update values that have already been vectorized. This is the case for "fix-up" operations including type truncation and the second phase of recurrence vectorization.
Definition at line 208 of file VPlan.h.
References assert().
Referenced by llvm::VPPredInstPHIRecipe::execute(), llvm::InnerLoopVectorizer::fixFirstOrderRecurrence(), llvm::InnerLoopVectorizer::fixReduction(), llvm::InnerLoopVectorizer::packScalarIntoVectorValue(), and llvm::InnerLoopVectorizer::truncateToMinimalBitwidths().
|
inline |
Set a scalar value associated with Key
and Instance
.
Assumes such a value is not already set.
Definition at line 191 of file VPlan.h.
References assert(), llvm::VPIteration::Lane, llvm::VPIteration::Part, and llvm::NVPTX::PTXLdStInstCode::Scalar.
Referenced by llvm::InnerLoopVectorizer::buildScalarSteps(), llvm::InnerLoopVectorizer::recordVectorLoopValueForInductionCast(), llvm::InnerLoopVectorizer::scalarizeInstruction(), and llvm::InnerLoopVectorizer::widenPHIInstruction().
Set a vector value associated with Key
and Part
.
Assumes such a value is not already set. If it is, use resetVectorValue() instead.
Definition at line 180 of file VPlan.h.
References assert().
Referenced by llvm::VPBlendRecipe::execute(), llvm::VPReplicateRecipe::execute(), llvm::InnerLoopVectorizer::getOrCreateVectorValue(), llvm::InnerLoopVectorizer::recordVectorLoopValueForInductionCast(), llvm::InnerLoopVectorizer::vectorizeInterleaveGroup(), llvm::InnerLoopVectorizer::vectorizeMemoryInstruction(), llvm::InnerLoopVectorizer::widenInstruction(), llvm::InnerLoopVectorizer::widenIntOrFpInduction(), and llvm::InnerLoopVectorizer::widenPHIInstruction().
|
friend |