class AllocaSlices

Declaration

class AllocaSlices { /* full declaration omitted */ };

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.

Declared at: llvm/lib/Transforms/Scalar/SROA.cpp:232

Method Overview

  • public AllocaSlices(const llvm::DataLayout & DL, llvm::AllocaInst & AI)
  • public llvm::sroa::AllocaSlices::iterator begin()
  • public llvm::sroa::AllocaSlices::const_iterator begin() const
  • public void dump() const
  • public void dump(llvm::sroa::AllocaSlices::const_iterator I) const
  • public llvm::sroa::AllocaSlices::iterator end()
  • public llvm::sroa::AllocaSlices::const_iterator end() const
  • public void erase(llvm::sroa::AllocaSlices::iterator Start, llvm::sroa::AllocaSlices::iterator Stop)
  • public ArrayRef<llvm::Use *> getDeadOperands() const
  • public ArrayRef<llvm::Instruction *> getDeadUsers() const
  • public void insert(ArrayRef<(anonymous namespace)::Slice> NewSlices)
  • public bool isEscaped() const
  • public iterator_range<llvm::sroa::AllocaSlices::partition_iterator> partitions()
  • public void print(llvm::raw_ostream & OS) const
  • public void print(llvm::raw_ostream & OS, llvm::sroa::AllocaSlices::const_iterator I, llvm::StringRef Indent = " ") const
  • public void printSlice(llvm::raw_ostream & OS, llvm::sroa::AllocaSlices::const_iterator I, llvm::StringRef Indent = " ") const
  • public void printUse(llvm::raw_ostream & OS, llvm::sroa::AllocaSlices::const_iterator I, llvm::StringRef Indent = " ") const

Methods

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

Description

Construct the slices of a particular alloca.

Declared at: llvm/lib/Transforms/Scalar/SROA.cpp:235

Parameters

const llvm::DataLayout& DL
llvm::AllocaInst& AI

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

Declared at: llvm/lib/Transforms/Scalar/SROA.cpp:248

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

Declared at: llvm/lib/Transforms/Scalar/SROA.cpp:254

void dump() const

Declared at: llvm/lib/Transforms/Scalar/SROA.cpp:298

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

Declared at: llvm/lib/Transforms/Scalar/SROA.cpp:297

Parameters

llvm::sroa::AllocaSlices::const_iterator I

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

Declared at: llvm/lib/Transforms/Scalar/SROA.cpp:249

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

Declared at: llvm/lib/Transforms/Scalar/SROA.cpp:255

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

Description

Erase a range of slices.

Declared at: llvm/lib/Transforms/Scalar/SROA.cpp:259

Parameters

llvm::sroa::AllocaSlices::iterator Start
llvm::sroa::AllocaSlices::iterator Stop

ArrayRef<llvm::Use*> getDeadOperands() const

Description

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.

Declared at: llvm/lib/Transforms/Scalar/SROA.cpp:288

ArrayRef<llvm::Instruction*> getDeadUsers() const

Description

Access the dead users for this alloca.

Declared at: llvm/lib/Transforms/Scalar/SROA.cpp:280

void insert(ArrayRef<(anonymous namespace)::Slice>
                NewSlices)

Description

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.

Declared at: llvm/lib/Transforms/Scalar/SROA.cpp:266

Parameters

ArrayRef<(anonymous namespace)::Slice> NewSlices

bool isEscaped() const

Description

Test whether a pointer to the allocation escapes our analysis. If this is true, the slices are never fully built and should be ignored.

Declared at: llvm/lib/Transforms/Scalar/SROA.cpp:241

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

Description

A forward range over the partitions of the alloca's slices. This accesses an iterator range over the partitions of the alloca's slices. It computes these partitions on the fly based on the overlapping offsets of the slices and the ability to split them. It will visit "empty" partitions to cover regions of the alloca only accessed via split slices.

Declared at: llvm/lib/Transforms/Scalar/SROA.cpp:277

void print(llvm::raw_ostream& OS) const

Declared at: llvm/lib/Transforms/Scalar/SROA.cpp:296

Parameters

llvm::raw_ostream& OS

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

Declared at: llvm/lib/Transforms/Scalar/SROA.cpp:291

Parameters

llvm::raw_ostream& OS
llvm::sroa::AllocaSlices::const_iterator I
llvm::StringRef Indent = " "

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

Declared at: llvm/lib/Transforms/Scalar/SROA.cpp:292

Parameters

llvm::raw_ostream& OS
llvm::sroa::AllocaSlices::const_iterator I
llvm::StringRef Indent = " "

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

Declared at: llvm/lib/Transforms/Scalar/SROA.cpp:294

Parameters

llvm::raw_ostream& OS
llvm::sroa::AllocaSlices::const_iterator I
llvm::StringRef Indent = " "