LLVM 24.0.0git
llvm::VPIRAttributes Class Reference

Manage IR attributes for call recipes. More...

#include "Transforms/Vectorize/VPlan.h"

Inheritance diagram for llvm::VPIRAttributes:
[legend]

Public Member Functions

 VPIRAttributes ()=default
 VPIRAttributes (AttributeList CallAttrs)
 VPIRAttributes (const VPInstruction &Call, FunctionType *WideTy)
 Stores the return and per-arg attributes of the call VPInstruction Call 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.
MemoryEffects getMemoryEffects (AttributeSet CalleeFnAttrs) const
 Returns the memory effects of a call with these attributes to a callee with function attributes CalleeFnAttrs.
bool hasFnAttr (Attribute::AttrKind Kind, AttributeSet CalleeFnAttrs) const
 Returns true if the call site or CalleeFnAttrs has Kind.
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.
void printFnAttrs (raw_ostream &O) const
 Print function attributes carried with this object.

Detailed Description

Manage IR attributes for call recipes.

Call VPInstructions store all call-site attributes. Widened calls only store return and per-argument attributes that are valid to propagate to the widened call.

Definition at line 1276 of file VPlan.h.

Constructor & Destructor Documentation

◆ VPIRAttributes() [1/3]

llvm::VPIRAttributes::VPIRAttributes ( )
default

◆ VPIRAttributes() [2/3]

llvm::VPIRAttributes::VPIRAttributes ( AttributeList CallAttrs)
inlineexplicit

Definition at line 1282 of file VPlan.h.

◆ VPIRAttributes() [3/3]

VPIRAttributes::VPIRAttributes ( const VPInstruction & Call,
FunctionType * WideTy )

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

If Call is masked, 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 2276 of file VPlanRecipes.cpp.

References assert(), Call, llvm::AttributeMask::contains(), llvm::Filter, llvm::AttributeSet::get(), getCalledFnOperandIndex(), llvm::Type::getContext(), llvm::FunctionType::getNumParams(), llvm::FunctionType::getParamType(), llvm::FunctionType::getReturnType(), 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().

◆ getMemoryEffects()

MemoryEffects llvm::VPIRAttributes::getMemoryEffects ( AttributeSet CalleeFnAttrs) const
inline

Returns the memory effects of a call with these attributes to a callee with function attributes CalleeFnAttrs.

Definition at line 1300 of file VPlan.h.

References llvm::AttributeSet::getMemoryEffects().

Referenced by llvm::VPInstruction::opcodeMayReadOrWriteFromMemory().

◆ hasFnAttr()

bool llvm::VPIRAttributes::hasFnAttr ( Attribute::AttrKind Kind,
AttributeSet CalleeFnAttrs ) const
inline

Returns true if the call site or CalleeFnAttrs has Kind.

Definition at line 1305 of file VPlan.h.

References llvm::AttributeSet::hasAttribute().

◆ intersectAttrs()

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

Keep only the attributes valid for both this and Other.

Definition at line 2324 of file VPlanRecipes.cpp.

References llvm::Other, and VPIRAttributes().

◆ printFnAttrs()

void VPIRAttributes::printFnAttrs ( raw_ostream & O) const

Print function attributes carried with this object.

Definition at line 2343 of file VPlanRecipes.cpp.

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

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

◆ printParamAttrs()

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

Print per-arg attributes for argument ArgIdx.

Definition at line 2337 of file VPlanRecipes.cpp.

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

Referenced by llvm::VPInstruction::printRecipe(), and llvm::VPWidenCallRecipe::printRecipe().

◆ printRetAttrs()

void VPIRAttributes::printRetAttrs ( raw_ostream & O) const

Print return-value attributes carried with this object.

Definition at line 2331 of file VPlanRecipes.cpp.

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

Referenced by llvm::VPInstruction::printRecipe(), and llvm::VPWidenCallRecipe::printRecipe().


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