LLVM  10.0.0svn
llvm::VectorizerValueMap Struct Reference

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

ValuegetVectorValue (Value *Key, unsigned Part)
Retrieve the existing vector value that corresponds to Key and Part. More...

ValuegetScalarValue (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

Detailed Description

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.

Definition at line 108 of file VPlan.h.

◆ VectorizerValueMap()

 llvm::VectorizerValueMap::VectorizerValueMap ( unsigned UF, unsigned VF )
inline

Construct an empty map with the given unroll and vectorization factors.

Definition at line 128 of file VPlan.h.

◆ getScalarValue()

 Value* llvm::VectorizerValueMap::getScalarValue ( Value * Key, const VPIteration & Instance )
inline

Retrieve the existing scalar value that corresponds to Key and Instance.

Definition at line 172 of file VPlan.h.

References assert(), llvm::VPIteration::Lane, and llvm::VPIteration::Part.

◆ getVectorValue()

 Value* llvm::VectorizerValueMap::getVectorValue ( Value * Key, unsigned Part )
inline

Retrieve the existing vector value that corresponds to Key and Part.

Definition at line 165 of file VPlan.h.

References assert().

◆ hasAnyScalarValue()

 bool llvm::VectorizerValueMap::hasAnyScalarValue ( Value * Key ) const
inline
Returns
True if the map has any scalar entry for Key.

Definition at line 146 of file VPlan.h.

Referenced by llvm::InnerLoopVectorizer::getOrCreateVectorValue().

◆ hasAnyVectorValue()

 bool llvm::VectorizerValueMap::hasAnyVectorValue ( Value * Key ) const
inline
Returns
True if the map has any vector entry for Key.

Definition at line 131 of file VPlan.h.

Referenced by llvm::InnerLoopVectorizer::truncateToMinimalBitwidths().

◆ hasScalarValue()

 bool llvm::VectorizerValueMap::hasScalarValue ( Value * Key, const VPIteration & Instance ) const
inline
Returns
True if the map has a scalar entry for Key and Instance.

Definition at line 151 of file VPlan.h.

Referenced by llvm::InnerLoopVectorizer::getOrCreateScalarValue().

◆ hasVectorValue()

 bool llvm::VectorizerValueMap::hasVectorValue ( Value * Key, unsigned Part ) const
inline
Returns
True if the map has a vector entry for Key and Part.

Definition at line 136 of file VPlan.h.

References assert(), and llvm::SmallVectorBase::size().

◆ resetScalarValue()

 void llvm::VectorizerValueMap::resetScalarValue ( Value * Key, const VPIteration & Instance, Value * Scalar )
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 216 of file VPlan.h.

Referenced by llvm::VPPredInstPHIRecipe::execute().

◆ resetVectorValue()

 void llvm::VectorizerValueMap::resetVectorValue ( Value * Key, unsigned Part, Value * Vector )
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 207 of file VPlan.h.

References assert(), and llvm::Vector.

◆ setScalarValue()

 void llvm::VectorizerValueMap::setScalarValue ( Value * Key, const VPIteration & Instance, Value * Scalar )
inline

Set a scalar value associated with Key and Instance.

Assumes such a value is not already set.

Definition at line 190 of file VPlan.h.

References assert().

◆ setVectorValue()

 void llvm::VectorizerValueMap::setVectorValue ( Value * Key, unsigned Part, Value * Vector )
inline

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 179 of file VPlan.h.

References assert().

◆ VPTransformState

 friend struct VPTransformState
friend

Definition at line 109 of file VPlan.h.

The documentation for this struct was generated from the following file: