LLVM  8.0.0svn
Public Member Functions | List of all members
llvm::InterleaveGroup Class Reference

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

#include "llvm/Analysis/VectorUtils.h"

Public Member Functions

 InterleaveGroup (Instruction *Instr, int Stride, unsigned Align)
 
bool isReverse () const
 
unsigned getFactor () const
 
unsigned getAlignment () const
 
unsigned getNumMembers () const
 
bool insertMember (Instruction *Instr, int Index, unsigned NewAlign)
 Try to insert a new member Instr with index Index and alignment NewAlign. More...
 
InstructiongetMember (unsigned Index) const
 Get the member with the given index Index. More...
 
unsigned getIndex (Instruction *Instr) const
 Get the index for the given member. More...
 
InstructiongetInsertPos () const
 
void setInsertPos (Instruction *Inst)
 
void addMetadata (Instruction *NewInst) const
 Add metadata (e.g. More...
 

Detailed Description

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 206 of file VectorUtils.h.

Constructor & Destructor Documentation

◆ InterleaveGroup()

llvm::InterleaveGroup::InterleaveGroup ( Instruction Instr,
int  Stride,
unsigned  Align 
)
inline

Definition at line 208 of file VectorUtils.h.

References llvm::abs(), and assert().

Member Function Documentation

◆ addMetadata()

void llvm::InterleaveGroup::addMetadata ( Instruction NewInst) const
inline

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 289 of file VectorUtils.h.

References llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Align, llvm::propagateMetadata(), and llvm::transform().

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

◆ getAlignment()

unsigned llvm::InterleaveGroup::getAlignment ( ) const
inline

◆ getFactor()

unsigned llvm::InterleaveGroup::getFactor ( ) const
inline

◆ getIndex()

unsigned llvm::InterleaveGroup::getIndex ( Instruction 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 272 of file VectorUtils.h.

References I, and llvm_unreachable.

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

◆ getInsertPos()

Instruction* llvm::InterleaveGroup::getInsertPos ( ) const
inline

◆ getMember()

Instruction* llvm::InterleaveGroup::getMember ( unsigned  Index) const
inline

Get the member with the given index Index.

Returns
nullptr if contains no such member.

Definition at line 261 of file VectorUtils.h.

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

◆ getNumMembers()

unsigned llvm::InterleaveGroup::getNumMembers ( ) const
inline

Definition at line 222 of file VectorUtils.h.

◆ insertMember()

bool llvm::InterleaveGroup::insertMember ( Instruction Instr,
int  Index,
unsigned  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 229 of file VectorUtils.h.

References llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Align, and assert().

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

◆ isReverse()

bool llvm::InterleaveGroup::isReverse ( ) const
inline

Definition at line 219 of file VectorUtils.h.

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

◆ setInsertPos()

void llvm::InterleaveGroup::setInsertPos ( Instruction Inst)
inline

Definition at line 281 of file VectorUtils.h.

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


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