LLVM 22.0.0git
llvm::VPSlotTracker Class Reference

This class can be used to assign names to VPValues. More...

#include "Transforms/Vectorize/VPlanHelpers.h"

Public Member Functions

 VPSlotTracker (const VPlan *Plan=nullptr)
std::string getOrCreateName (const VPValue *V) const
 Returns the name assigned to V, if there is one, otherwise try to construct one from the underlying value, if there's one; else return <badref>.
ArrayRef< StringRefgetMDNames ()
 Returns the cached metadata kind names.
const ModulegetModule () const
 Returns the cached Module pointer.

Detailed Description

This class can be used to assign names to VPValues.

For VPValues without underlying value, assign consecutive numbers and use those as names (wrapped in vp<>). Otherwise, use the name from the underlying value (wrapped in ir<>), appending a .V version number if there are multiple uses of the same name. Allows querying names for VPValues for printing, similar to the ModuleSlotTracker for IR values.

Definition at line 383 of file VPlanHelpers.h.

Constructor & Destructor Documentation

◆ VPSlotTracker()

llvm::VPSlotTracker::VPSlotTracker ( const VPlan * Plan = nullptr)
inline

Definition at line 409 of file VPlanHelpers.h.

References llvm::VPlan::getScalarHeader().

Member Function Documentation

◆ getMDNames()

ArrayRef< StringRef > llvm::VPSlotTracker::getMDNames ( )
inline

Returns the cached metadata kind names.

Definition at line 423 of file VPlanHelpers.h.

◆ getModule()

const Module * llvm::VPSlotTracker::getModule ( ) const
inline

Returns the cached Module pointer.

Definition at line 430 of file VPlanHelpers.h.

◆ getOrCreateName()

std::string VPSlotTracker::getOrCreateName ( const VPValue * V) const

Returns the name assigned to V, if there is one, otherwise try to construct one from the underlying value, if there's one; else return <badref>.

Definition at line 1513 of file VPlan.cpp.

References assert(), llvm::VPRecipeBase::getParent(), and llvm::VPBlockBase::getPlan().

Referenced by llvm::VPValue::printAsOperand().


The documentation for this class was generated from the following files: