LLVM 24.0.0git
llvm::VPIRAttributes Class Reference

Manage IR per-argument and return attributes for call recipes. More...

#include "Transforms/Vectorize/VPlan.h"

Inheritance diagram for llvm::VPIRAttributes:
[legend]

Public Member Functions

 VPIRAttributes ()=default
 VPIRAttributes (const CallInst &CI, FunctionType *WideTy, bool IsMaskedCall)
 Stores the return and per-arg attributes of CI that are valid for a widened call with type WideTy.
void intersectAttrs (const VPIRAttributes &Other, LLVMContext &Ctx)
 Keep only the attributes valid for both this and Other.
void applyAttrs (CallInst &WideCall) const
 Apply the stored attributes to the widened call WideCall.
void printRetAttrs (raw_ostream &O) const
 Print return-value attributes carried with this object.
void printParamAttrs (raw_ostream &O, unsigned ArgIdx) const
 Print per-arg attributes for argument ArgIdx.

Detailed Description

Manage IR per-argument and return attributes for call recipes.

Only attributes that are valid to propagate to the widened call are stored.

Definition at line 1278 of file VPlan.h.

Constructor & Destructor Documentation

◆ VPIRAttributes() [1/2]

llvm::VPIRAttributes::VPIRAttributes ( )
default

References llvm::Other, and VPIRAttributes().

Referenced by intersectAttrs(), and VPIRAttributes().

◆ VPIRAttributes() [2/2]

VPIRAttributes::VPIRAttributes ( const CallInst & CI,
FunctionType * WideTy,
bool IsMaskedCall )

Stores the return and per-arg attributes of CI that are valid for a widened call with type WideTy.

If IsMaskedCall is true, the scalar call only executes for some lanes, so argument attributes are only kept for widened arguments passed to a masked variant.

Definition at line 2258 of file VPlanRecipes.cpp.

References llvm::CallBase::arg_size(), assert(), llvm::AttributeMask::contains(), llvm::Filter, llvm::AttributeSet::get(), llvm::CallBase::getArgOperand(), llvm::CallBase::getAttributes(), llvm::Value::getContext(), llvm::FunctionType::getNumParams(), llvm::FunctionType::getParamType(), llvm::FunctionType::getReturnType(), llvm::Value::getType(), and I.

Member Function Documentation

◆ applyAttrs()

void llvm::VPIRAttributes::applyAttrs ( CallInst & WideCall) const
inline

Apply the stored attributes to the widened call WideCall.

Definition at line 1294 of file VPlan.h.

References llvm::CallBase::setAttributes().

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

◆ intersectAttrs()

void VPIRAttributes::intersectAttrs ( const VPIRAttributes & Other,
LLVMContext & Ctx )

Keep only the attributes valid for both this and Other.

Definition at line 2304 of file VPlanRecipes.cpp.

References llvm::Other, and VPIRAttributes().

◆ printParamAttrs()

void VPIRAttributes::printParamAttrs ( raw_ostream & O,
unsigned ArgIdx ) const

Print per-arg attributes for argument ArgIdx.

Definition at line 2318 of file VPlanRecipes.cpp.

References llvm::AttributeSet::getAsString(), and llvm::AttributeSet::hasAttributes().

Referenced by llvm::VPWidenCallRecipe::printRecipe().

◆ printRetAttrs()

void VPIRAttributes::printRetAttrs ( raw_ostream & O) const

Print return-value attributes carried with this object.

Definition at line 2312 of file VPlanRecipes.cpp.

References llvm::AttributeSet::getAsString(), and llvm::AttributeSet::hasAttributes().

Referenced by llvm::VPWidenCallRecipe::printRecipe().


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