LLVM  9.0.0svn
Classes | Public Member Functions | List of all members
llvm::InterleavedAccessInfo Class Reference

Drive the analysis of interleaved memory accesses in the loop. More...

#include "llvm/Analysis/VectorUtils.h"

Public Member Functions

 InterleavedAccessInfo (PredicatedScalarEvolution &PSE, Loop *L, DominatorTree *DT, LoopInfo *LI, const LoopAccessInfo *LAI)
 
 ~InterleavedAccessInfo ()
 
void analyzeInterleaving (bool EnableMaskedInterleavedGroup)
 Analyze the interleaved accesses and collect them in interleave groups. More...
 
void reset ()
 Invalidate groups, e.g., in case all blocks in loop will be predicated contrary to original assumption. More...
 
bool isInterleaved (Instruction *Instr) const
 Check if Instr belongs to any interleave group. More...
 
InterleaveGroup< Instruction > * getInterleaveGroup (const Instruction *Instr) const
 Get the interleave group that Instr belongs to. More...
 
iterator_range< SmallPtrSetIterator< llvm::InterleaveGroup< Instruction > * > > getInterleaveGroups ()
 
bool requiresScalarEpilogue () const
 Returns true if an interleaved group that may access memory out-of-bounds requires a scalar epilogue iteration for correctness. More...
 
void invalidateGroupsRequiringScalarEpilogue ()
 Invalidate groups that require a scalar epilogue (due to gaps). More...
 

Detailed Description

Drive the analysis of interleaved memory accesses in the loop.

Use this class to analyze interleaved accesses only when we can vectorize a loop. Otherwise it's meaningless to do analysis as the vectorization on interleaved accesses is unsafe.

The analysis collects interleave groups and records the relationships between the member and the group in a map.

Definition at line 398 of file VectorUtils.h.

Constructor & Destructor Documentation

◆ InterleavedAccessInfo()

llvm::InterleavedAccessInfo::InterleavedAccessInfo ( PredicatedScalarEvolution PSE,
Loop L,
DominatorTree DT,
LoopInfo LI,
const LoopAccessInfo LAI 
)
inline

Definition at line 400 of file VectorUtils.h.

◆ ~InterleavedAccessInfo()

llvm::InterleavedAccessInfo::~InterleavedAccessInfo ( )
inline

Definition at line 405 of file VectorUtils.h.

Member Function Documentation

◆ analyzeInterleaving()

void InterleavedAccessInfo::analyzeInterleaving ( bool  EnableMaskedInterleavedGroup)

◆ getInterleaveGroup()

InterleaveGroup<Instruction>* llvm::InterleavedAccessInfo::getInterleaveGroup ( const Instruction Instr) const
inline

Get the interleave group that Instr belongs to.

Returns
nullptr if doesn't have such group.

Definition at line 438 of file VectorUtils.h.

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

◆ getInterleaveGroups()

iterator_range<SmallPtrSetIterator<llvm::InterleaveGroup<Instruction> *> > llvm::InterleavedAccessInfo::getInterleaveGroups ( )
inline

Definition at line 445 of file VectorUtils.h.

References llvm::make_range().

◆ invalidateGroupsRequiringScalarEpilogue()

void InterleavedAccessInfo::invalidateGroupsRequiringScalarEpilogue ( )

Invalidate groups that require a scalar epilogue (due to gaps).

This can happen when optimizing for size forbids a scalar epilogue, and the gap cannot be filtered by masking the load/store.

Definition at line 1039 of file VectorUtils.cpp.

References llvm::dbgs(), I, llvm::SmallPtrSetImpl< PtrType >::insert(), LLVM_DEBUG, and llvm::InterleaveGroup< InstTy >::requiresScalarEpilogue().

◆ isInterleaved()

bool llvm::InterleavedAccessInfo::isInterleaved ( Instruction Instr) const
inline

Check if Instr belongs to any interleave group.

Definition at line 430 of file VectorUtils.h.

◆ requiresScalarEpilogue()

bool llvm::InterleavedAccessInfo::requiresScalarEpilogue ( ) const
inline

◆ reset()

void llvm::InterleavedAccessInfo::reset ( )
inline

Invalidate groups, e.g., in case all blocks in loop will be predicated contrary to original assumption.

Although we currently prevent group formation for predicated accesses, we may be able to relax this limitation in the future once we handle more complicated blocks.

Definition at line 417 of file VectorUtils.h.

References I, and llvm::SmallPtrSetImpl< PtrType >::insert().


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