struct VectorizerValueMap

Declaration

struct VectorizerValueMap { /* full declaration omitted */ };

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.

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:109

Method Overview

  • public VectorizerValueMap(unsigned int UF, unsigned int VF)
  • public llvm::Value * getScalarValue(llvm::Value * Key, const llvm::VPIteration & Instance)
  • public llvm::Value * getVectorValue(llvm::Value * Key, unsigned int Part)
  • public bool hasAnyScalarValue(llvm::Value * Key) const
  • public bool hasAnyVectorValue(llvm::Value * Key) const
  • public bool hasScalarValue(llvm::Value * Key, const llvm::VPIteration & Instance) const
  • public bool hasVectorValue(llvm::Value * Key, unsigned int Part) const
  • public void resetScalarValue(llvm::Value * Key, const llvm::VPIteration & Instance, llvm::Value * Scalar)
  • public void resetVectorValue(llvm::Value * Key, unsigned int Part, llvm::Value * Vector)
  • public void setScalarValue(llvm::Value * Key, const llvm::VPIteration & Instance, llvm::Value * Scalar)
  • public void setVectorValue(llvm::Value * Key, unsigned int Part, llvm::Value * Vector)

Methods

VectorizerValueMap(unsigned int UF,
                   unsigned int VF)

Description

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

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:129

Parameters

unsigned int UF
unsigned int VF

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

Description

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

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:173

Parameters

llvm::Value* Key
const llvm::VPIteration& Instance

llvm::Value* getVectorValue(llvm::Value* Key,
                            unsigned int Part)

Description

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

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:166

Parameters

llvm::Value* Key
unsigned int Part

bool hasAnyScalarValue(llvm::Value* Key) const

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:147

Parameters

llvm::Value* Key

Returns

True if the map has any scalar entry for \p Key.

bool hasAnyVectorValue(llvm::Value* Key) const

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:132

Parameters

llvm::Value* Key

Returns

True if the map has any vector entry for \p Key.

bool hasScalarValue(
    llvm::Value* Key,
    const llvm::VPIteration& Instance) const

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:152

Parameters

llvm::Value* Key
const llvm::VPIteration& Instance

Returns

True if the map has a scalar entry for \p Key and \p Instance.

bool hasVectorValue(llvm::Value* Key,
                    unsigned int Part) const

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:137

Parameters

llvm::Value* Key
unsigned int Part

Returns

True if the map has a vector entry for \p Key and \p Part.

void resetScalarValue(
    llvm::Value* Key,
    const llvm::VPIteration& Instance,
    llvm::Value* Scalar)

Description

Reset the scalar value associated with \p Key for \p Part and \p 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.

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:217

Parameters

llvm::Value* Key
const llvm::VPIteration& Instance
llvm::Value* Scalar

void resetVectorValue(llvm::Value* Key,
                      unsigned int Part,
                      llvm::Value* Vector)

Description

Reset the vector value associated with \p Key for the given \p 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.

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:208

Parameters

llvm::Value* Key
unsigned int Part
llvm::Value* Vector

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

Description

Set a scalar value associated with \p Key and \p Instance. Assumes such a value is not already set.

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:191

Parameters

llvm::Value* Key
const llvm::VPIteration& Instance
llvm::Value* Scalar

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

Description

Set a vector value associated with \p Key and \p Part. Assumes such a value is not already set. If it is, use resetVectorValue() instead.

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:180

Parameters

llvm::Value* Key
unsigned int Part
llvm::Value* Vector