LLVM  8.0.1
Classes | Public Member Functions | List of all members
llvm::safestack::StackColoring Class Reference

Compute live ranges of allocas. More...

#include "CodeGen/SafeStackColoring.h"

Classes

struct  LiveRange
 This class represents a set of interesting instructions where an alloca is live. More...
 

Public Member Functions

 StackColoring (Function &F, ArrayRef< AllocaInst *> Allocas)
 
void run ()
 
void removeAllMarkers ()
 
const LiveRangegetLiveRange (AllocaInst *AI)
 Returns a set of "interesting" instructions where the given alloca is live. More...
 
LiveRange getFullLiveRange ()
 Returns a live range that represents an alloca that is live throughout the entire function. More...
 

Detailed Description

Compute live ranges of allocas.

Live ranges are represented as sets of "interesting" instructions, which are defined as instructions that may start or end an alloca's lifetime. These are:

Definition at line 38 of file SafeStackColoring.h.

Constructor & Destructor Documentation

◆ StackColoring()

llvm::safestack::StackColoring::StackColoring ( Function F,
ArrayRef< AllocaInst *>  Allocas 
)
inline

Definition at line 119 of file SafeStackColoring.h.

References getLiveRange(), removeAllMarkers(), and run().

Member Function Documentation

◆ getFullLiveRange()

LiveRange llvm::safestack::StackColoring::getFullLiveRange ( )
inline

Returns a live range that represents an alloca that is live throughout the entire function.

Definition at line 132 of file SafeStackColoring.h.

References llvm::safestack::StackColoring::LiveRange::AddRange(), assert(), and llvm::safestack::StackColoring::LiveRange::SetMaximum().

Referenced by run().

◆ getLiveRange()

const StackColoring::LiveRange & StackColoring::getLiveRange ( AllocaInst AI)

Returns a set of "interesting" instructions where the given alloca is live.

Not all instructions in a function are interesting: we pick a set that is large enough for LiveRange::Overlaps to be correct.

Definition at line 42 of file SafeStackColoring.cpp.

References assert(), I, llvm::Instruction::isLifetimeStartOrEnd(), IT, and llvm::Intrinsic::lifetime_start.

Referenced by StackColoring().

◆ removeAllMarkers()

bool StackColoring::removeAllMarkers ( )

◆ run()

void StackColoring::run ( )

Definition at line 284 of file SafeStackColoring.cpp.

References ClColoring, getFullLiveRange(), I, LLVM_DEBUG, and llvm::BitVector::test().

Referenced by StackColoring().


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