LLVM  6.0.0svn
Classes | Public Member Functions | Friends | List of all members
llvm::sroa::AllocaSlices Class Reference

Representation of the alloca slices. More...

Public Member Functions

 AllocaSlices (const DataLayout &DL, AllocaInst &AI)
 Construct the slices of a particular alloca. More...
 
bool isEscaped () const
 Test whether a pointer to the allocation escapes our analysis. More...
 
void erase (iterator Start, iterator Stop)
 Erase a range of slices. More...
 
void insert (ArrayRef< Slice > NewSlices)
 Insert new slices for this alloca. More...
 
iterator_range< partition_iterator > partitions ()
 
ArrayRef< Instruction * > getDeadUsers () const
 Access the dead users for this alloca. More...
 
ArrayRef< Use * > getDeadOperands () const
 Access the dead operands referring to this alloca. More...
 
void print (raw_ostream &OS, const_iterator I, StringRef Indent=" ") const
 
void printSlice (raw_ostream &OS, const_iterator I, StringRef Indent=" ") const
 
void printUse (raw_ostream &OS, const_iterator I, StringRef Indent=" ") const
 
void print (raw_ostream &OS) const
 
void dump (const_iterator I) const
 
void dump () const
 

Friends

class AllocaSlices::SliceBuilder
 
using iterator = SmallVectorImpl< Slice >::iterator
 Support for iterating over the slices. More...
 
using range = iterator_range< iterator >
 
using const_iterator = SmallVectorImpl< Slice >::const_iterator
 
using const_range = iterator_range< const_iterator >
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 

Detailed Description

Representation of the alloca slices.

This class represents the slices of an alloca which are formed by its various uses. If a pointer escapes, we can't fully build a representation for the slices used and we reflect that in this structure. The uses are stored, sorted by increasing beginning offset and with unsplittable slices starting at a particular offset before splittable slices.

Definition at line 237 of file SROA.cpp.

Member Typedef Documentation

◆ const_iterator

Definition at line 256 of file SROA.cpp.

◆ const_range

Definition at line 257 of file SROA.cpp.

◆ iterator

Support for iterating over the slices.

Definition at line 250 of file SROA.cpp.

◆ range

Definition at line 251 of file SROA.cpp.

Constructor & Destructor Documentation

◆ AllocaSlices()

llvm::sroa::AllocaSlices::AllocaSlices ( const DataLayout DL,
AllocaInst AI 
)

Construct the slices of a particular alloca.

Referenced by AllocaSlices::SliceBuilder::SliceBuilder().

Member Function Documentation

◆ begin() [1/2]

iterator llvm::sroa::AllocaSlices::begin ( )
inline

Definition at line 253 of file SROA.cpp.

Referenced by getTypePartition().

◆ begin() [2/2]

const_iterator llvm::sroa::AllocaSlices::begin ( ) const
inline

Definition at line 259 of file SROA.cpp.

◆ dump() [1/2]

void llvm::sroa::AllocaSlices::dump ( const_iterator  I) const

◆ dump() [2/2]

void llvm::sroa::AllocaSlices::dump ( ) const

◆ end() [1/2]

iterator llvm::sroa::AllocaSlices::end ( )
inline

Definition at line 254 of file SROA.cpp.

Referenced by getTypePartition().

◆ end() [2/2]

const_iterator llvm::sroa::AllocaSlices::end ( ) const
inline

Definition at line 260 of file SROA.cpp.

◆ erase()

void llvm::sroa::AllocaSlices::erase ( iterator  Start,
iterator  Stop 
)
inline

Erase a range of slices.

Definition at line 264 of file SROA.cpp.

Referenced by getTypePartition().

◆ getDeadOperands()

ArrayRef<Use *> llvm::sroa::AllocaSlices::getDeadOperands ( ) const
inline

Access the dead operands referring to this alloca.

These are operands which have cannot actually be used to refer to the alloca as they are outside its range and the user doesn't correct for that. These mostly consist of PHI node inputs and the like which we just need to replace with undef.

Definition at line 293 of file SROA.cpp.

References llvm::dump(), I, and print().

Referenced by getTypePartition().

◆ getDeadUsers()

ArrayRef<Instruction *> llvm::sroa::AllocaSlices::getDeadUsers ( ) const
inline

Access the dead users for this alloca.

Definition at line 285 of file SROA.cpp.

Referenced by getTypePartition().

◆ insert()

void llvm::sroa::AllocaSlices::insert ( ArrayRef< Slice >  NewSlices)
inline

Insert new slices for this alloca.

This moves the slices into the alloca's slices collection, and re-sorts everything so that the usual ordering properties of the alloca's slices hold.

Definition at line 271 of file SROA.cpp.

References llvm::ArrayRef< T >::begin(), llvm::ArrayRef< T >::end(), and llvm::parallel::sort().

Referenced by getTypePartition().

◆ isEscaped()

bool llvm::sroa::AllocaSlices::isEscaped ( ) const
inline

Test whether a pointer to the allocation escapes our analysis.

If this is true, the slices are never fully built and should be ignored.

Definition at line 246 of file SROA.cpp.

Referenced by getTypePartition().

◆ partitions()

iterator_range<partition_iterator> llvm::sroa::AllocaSlices::partitions ( )

◆ print() [1/2]

void llvm::sroa::AllocaSlices::print ( raw_ostream OS,
const_iterator  I,
StringRef  Indent = "  " 
) const

◆ print() [2/2]

void llvm::sroa::AllocaSlices::print ( raw_ostream OS) const

◆ printSlice()

void llvm::sroa::AllocaSlices::printSlice ( raw_ostream OS,
const_iterator  I,
StringRef  Indent = "  " 
) const

◆ printUse()

void llvm::sroa::AllocaSlices::printUse ( raw_ostream OS,
const_iterator  I,
StringRef  Indent = "  " 
) const

Friends And Related Function Documentation

◆ AllocaSlices::SliceBuilder

friend class AllocaSlices::SliceBuilder
friend

Definition at line 308 of file SROA.cpp.


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