LLVM  3.7.0
Classes | Public Member Functions | Public Attributes | List of all members
llvm::RuntimePointerChecking Class Reference

Holds information about the memory runtime legality checks to verify that a group of pointers do not overlap. More...

#include <LoopAccessAnalysis.h>

Collaboration diagram for llvm::RuntimePointerChecking:
[legend]

Classes

struct  CheckingPtrGroup
 A grouping of pointers. More...
 
struct  PointerInfo
 

Public Member Functions

 RuntimePointerChecking (ScalarEvolution *SE)
 
void reset ()
 Reset the state of the pointer runtime information. More...
 
void insert (Loop *Lp, Value *Ptr, bool WritePtr, unsigned DepSetId, unsigned ASId, const ValueToValueMap &Strides)
 Insert a pointer and calculate the start and end SCEVs. More...
 
bool empty () const
 No run-time memory checking is necessary. More...
 
void groupChecks (MemoryDepChecker::DepCandidates &DepCands, bool UseDependencies)
 Groups pointers such that a single memcheck is required between two different groups. More...
 
bool needsChecking (const CheckingPtrGroup &M, const CheckingPtrGroup &N, const SmallVectorImpl< int > *PtrPartition) const
 Decide if we need to add a check between two groups of pointers, according to needsChecking. More...
 
bool needsAnyChecking (const SmallVectorImpl< int > *PtrPartition) const
 Return true if any pointer requires run-time checking according to needsChecking. More...
 
unsigned getNumberOfChecks (const SmallVectorImpl< int > *PtrPartition) const
 Returns the number of run-time checks required according to needsChecking. More...
 
void print (raw_ostream &OS, unsigned Depth=0, const SmallVectorImpl< int > *PtrPartition=nullptr) const
 Print the list run-time memory checks necessary. More...
 

Public Attributes

bool Need
 This flag indicates if we need to add the runtime check. More...
 
SmallVector< PointerInfo, 2 > Pointers
 Information about the pointers that may require checking. More...
 
SmallVector< CheckingPtrGroup, 2 > CheckingGroups
 Holds a partitioning of pointers into "check groups". More...
 

Detailed Description

Holds information about the memory runtime legality checks to verify that a group of pointers do not overlap.

Definition at line 297 of file LoopAccessAnalysis.h.

Constructor & Destructor Documentation

llvm::RuntimePointerChecking::RuntimePointerChecking ( ScalarEvolution SE)
inline

Definition at line 324 of file LoopAccessAnalysis.h.

Member Function Documentation

bool llvm::RuntimePointerChecking::empty ( ) const
inline

No run-time memory checking is necessary.

Definition at line 337 of file LoopAccessAnalysis.h.

References Pointers.

unsigned RuntimePointerChecking::getNumberOfChecks ( const SmallVectorImpl< int > *  PtrPartition) const

Returns the number of run-time checks required according to needsChecking.

Definition at line 357 of file LoopAccessAnalysis.cpp.

References CheckingGroups, I, and needsChecking().

Referenced by llvm::LoopAccessInfo::getNumRuntimePointerChecks().

void RuntimePointerChecking::groupChecks ( MemoryDepChecker::DepCandidates DepCands,
bool  UseDependencies 
)

Groups pointers such that a single memcheck is required between two different groups.

This will clear the CheckingGroups vector and re-compute it. We will only group dependecies if UseDependencies is true, otherwise we will create a separate group for each pointer.

Definition at line 186 of file LoopAccessAnalysis.cpp.

References llvm::SmallVectorTemplateCommon< T >::begin(), CheckingGroups, llvm::SmallSet< T, N, C >::count(), llvm::SmallVectorTemplateCommon< T >::end(), llvm::EquivalenceClasses< ElemTy >::findValue(), llvm::EquivalenceClasses< ElemTy >::getLeaderValue(), I, llvm::SmallSet< T, N, C >::insert(), llvm::EquivalenceClasses< ElemTy >::member_begin(), llvm::EquivalenceClasses< ElemTy >::member_end(), MemoryCheckMergeThreshold, llvm::AArch64CC::MI, and Pointers.

void RuntimePointerChecking::insert ( Loop Lp,
Value Ptr,
bool  WritePtr,
unsigned  DepSetId,
unsigned  ASId,
const ValueToValueMap Strides 
)
bool RuntimePointerChecking::needsAnyChecking ( const SmallVectorImpl< int > *  PtrPartition) const

Return true if any pointer requires run-time checking according to needsChecking.

Definition at line 370 of file LoopAccessAnalysis.cpp.

References I, needsChecking(), and Pointers.

Referenced by llvm::LoopVersioning::needsRuntimeChecks().

bool RuntimePointerChecking::needsChecking ( const CheckingPtrGroup M,
const CheckingPtrGroup N,
const SmallVectorImpl< int > *  PtrPartition 
) const

Decide if we need to add a check between two groups of pointers, according to needsChecking.

Definition at line 135 of file LoopAccessAnalysis.cpp.

References I, llvm::RuntimePointerChecking::CheckingPtrGroup::Members, and llvm::SmallVectorTemplateCommon< T, typename >::size().

Referenced by getNumberOfChecks(), needsAnyChecking(), and print().

void RuntimePointerChecking::print ( raw_ostream OS,
unsigned  Depth = 0,
const SmallVectorImpl< int > *  PtrPartition = nullptr 
) const

Print the list run-time memory checks necessary.

If PtrPartition is set, it contains the partition number for pointers (-1 if the pointer belongs to multiple partitions). In this case omit checks between pointers belonging to the same partition.

Definition at line 310 of file LoopAccessAnalysis.cpp.

References CheckingGroups, I, llvm::raw_ostream::indent(), N, needsChecking(), and Pointers.

Referenced by llvm::LoopAccessInfo::print().

void llvm::RuntimePointerChecking::reset ( )
inline

Reset the state of the pointer runtime information.

Definition at line 327 of file LoopAccessAnalysis.h.

References Need, and Pointers.

Member Data Documentation

SmallVector<CheckingPtrGroup, 2> llvm::RuntimePointerChecking::CheckingGroups

Holds a partitioning of pointers into "check groups".

Definition at line 406 of file LoopAccessAnalysis.h.

Referenced by getNumberOfChecks(), groupChecks(), and print().

bool llvm::RuntimePointerChecking::Need

This flag indicates if we need to add the runtime check.

Definition at line 400 of file LoopAccessAnalysis.h.

Referenced by llvm::LoopAccessInfo::print(), and reset().

SmallVector<PointerInfo, 2> llvm::RuntimePointerChecking::Pointers

Information about the pointers that may require checking.

Definition at line 403 of file LoopAccessAnalysis.h.

Referenced by llvm::RuntimePointerChecking::CheckingPtrGroup::addPointer(), empty(), groupChecks(), insert(), needsAnyChecking(), print(), and reset().


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