LLVM  11.0.0git
Public Member Functions | List of all members
llvm::InterleaveGroup< InstTy > Class Template Reference

The group of interleaved loads/stores sharing the same stride and close to each other. More...

#include "llvm/Analysis/VectorUtils.h"

Inheritance diagram for llvm::InterleaveGroup< InstTy >:
Inheritance graph
[legend]

Public Member Functions

 InterleaveGroup (uint32_t Factor, bool Reverse, Align Alignment)
 
 InterleaveGroup (InstTy *Instr, int32_t Stride, Align Alignment)
 
bool isReverse () const
 
uint32_t getFactor () const
 
 LLVM_ATTRIBUTE_DEPRECATED (uint32_t getAlignment() const, "Use getAlign instead.")
 
Align getAlign () const
 
uint32_t getNumMembers () const
 
bool insertMember (InstTy *Instr, int32_t Index, Align NewAlign)
 Try to insert a new member Instr with index Index and alignment NewAlign. More...
 
InstTy * getMember (uint32_t Index) const
 Get the member with the given index Index. More...
 
uint32_t getIndex (const InstTy *Instr) const
 Get the index for the given member. More...
 
InstTy * getInsertPos () const
 
void setInsertPos (InstTy *Inst)
 
void addMetadata (InstTy *NewInst) const
 Add metadata (e.g. More...
 
bool requiresScalarEpilogue () const
 Returns true if this Group requires a scalar iteration to handle gaps. More...
 
template<>
void addMetadata (Instruction *NewInst) const
 

Detailed Description

template<typename InstTy>
class llvm::InterleaveGroup< InstTy >

The group of interleaved loads/stores sharing the same stride and close to each other.

Each member in this group has an index starting from 0, and the largest index should be less than interleaved factor, which is equal to the absolute value of the access's stride.

E.g. An interleaved load group of factor 4: for (unsigned i = 0; i < 1024; i+=4) { a = A[i]; // Member of index 0 b = A[i+1]; // Member of index 1 d = A[i+3]; // Member of index 3 ... }

An interleaved store group of factor 4: for (unsigned i = 0; i < 1024; i+=4) { ... A[i] = a; // Member of index 0 A[i+1] = b; // Member of index 1 A[i+2] = c; // Member of index 2 A[i+3] = d; // Member of index 3 }

Note: the interleaved load group could have gaps (missing members), but the interleaved store group doesn't allow gaps.

Definition at line 287 of file VectorUtils.h.

Constructor & Destructor Documentation

◆ InterleaveGroup() [1/2]

template<typename InstTy>
llvm::InterleaveGroup< InstTy >::InterleaveGroup ( uint32_t  Factor,
bool  Reverse,
Align  Alignment 
)
inline

Definition at line 581 of file VectorUtils.h.

◆ InterleaveGroup() [2/2]

template<typename InstTy>
llvm::InterleaveGroup< InstTy >::InterleaveGroup ( InstTy *  Instr,
int32_t  Stride,
Align  Alignment 
)
inline

Definition at line 585 of file VectorUtils.h.

Member Function Documentation

◆ addMetadata() [1/2]

template<typename InstT>
void InterleaveGroup::addMetadata ( InstT *  NewInst) const

Add metadata (e.g.

alias info) from the instructions in this group to NewInst.

FIXME: this function currently does not add noalias metadata a'la addNewMedata. To do that we need to compute the intersection of the noalias info from all members.

Definition at line 1258 of file VectorUtils.cpp.

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

◆ addMetadata() [2/2]

template<>
void llvm::InterleaveGroup< Instruction >::addMetadata ( Instruction NewInst) const

Definition at line 1264 of file VectorUtils.cpp.

◆ getAlign()

template<typename InstTy>
Align llvm::InterleaveGroup< InstTy >::getAlign ( ) const
inline

Definition at line 600 of file VectorUtils.h.

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

◆ getFactor()

template<typename InstTy>
uint32_t llvm::InterleaveGroup< InstTy >::getFactor ( ) const
inline

◆ getIndex()

template<typename InstTy>
uint32_t llvm::InterleaveGroup< InstTy >::getIndex ( const InstTy *  Instr) const
inline

Get the index for the given member.

Unlike the key in the member map, the index starts from 0.

Definition at line 659 of file VectorUtils.h.

Referenced by llvm::InterleavedAccessInfo::analyzeInterleaving(), and llvm::InnerLoopVectorizer::vectorizeInterleaveGroup().

◆ getInsertPos()

template<typename InstTy>
InstTy* llvm::InterleaveGroup< InstTy >::getInsertPos ( ) const
inline

◆ getMember()

template<typename InstTy>
InstTy* llvm::InterleaveGroup< InstTy >::getMember ( uint32_t  Index) const
inline

Get the member with the given index Index.

Returns
nullptr if contains no such member.

Definition at line 648 of file VectorUtils.h.

Referenced by llvm::createBitMaskForGaps(), llvm::InterleavedAccessInfo::requiresScalarEpilogue(), llvm::LoopVectorizationCostModel::setWideningDecision(), and llvm::InnerLoopVectorizer::vectorizeInterleaveGroup().

◆ getNumMembers()

template<typename InstTy>
uint32_t llvm::InterleaveGroup< InstTy >::getNumMembers ( ) const
inline

Definition at line 601 of file VectorUtils.h.

Referenced by llvm::createBitMaskForGaps().

◆ insertMember()

template<typename InstTy>
bool llvm::InterleaveGroup< InstTy >::insertMember ( InstTy *  Instr,
int32_t  Index,
Align  NewAlign 
)
inline

Try to insert a new member Instr with index Index and alignment NewAlign.

The index is related to the leader and it could be negative if it is the new leader.

Returns
false if the instruction doesn't belong to the group.

Definition at line 608 of file VectorUtils.h.

Referenced by llvm::InterleavedAccessInfo::analyzeInterleaving(), and llvm::VPValue::printAsOperand().

◆ isReverse()

template<typename InstTy>
bool llvm::InterleaveGroup< InstTy >::isReverse ( ) const
inline

◆ LLVM_ATTRIBUTE_DEPRECATED()

template<typename InstTy>
llvm::InterleaveGroup< InstTy >::LLVM_ATTRIBUTE_DEPRECATED ( uint32_t getAlignment()  const,
"Use getAlign instead."   
)
inline

Definition at line 596 of file VectorUtils.h.

◆ requiresScalarEpilogue()

template<typename InstTy>
bool llvm::InterleaveGroup< InstTy >::requiresScalarEpilogue ( ) const
inline

Returns true if this Group requires a scalar iteration to handle gaps.

Definition at line 680 of file VectorUtils.h.

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

◆ setInsertPos()

template<typename InstTy>
void llvm::InterleaveGroup< InstTy >::setInsertPos ( InstTy *  Inst)
inline

Definition at line 669 of file VectorUtils.h.

Referenced by llvm::InterleavedAccessInfo::analyzeInterleaving().


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