LLVM: llvm::StackLifetime Class Reference (original) (raw)
Compute live ranges of allocas. More...
#include "[llvm/Analysis/StackLifetime.h](StackLifetime%5F8h%5Fsource.html)"
| Public Types | |
|---|---|
| enum class | LivenessType { May, Must } |
| Public Member Functions | |
|---|---|
| StackLifetime (const Function &F, ArrayRef< const AllocaInst * > Allocas, LivenessType Type) | |
| void | run () |
| iterator_range< filter_iterator< ArrayRef< const IntrinsicInst * >::const_iterator, std::function< bool(const IntrinsicInst *)> > > | getMarkers () const |
| const LiveRange & | getLiveRange (const AllocaInst *AI) const |
| Returns a set of "interesting" instructions where the given alloca is live. | |
| bool | isReachable (const Instruction *I) const |
| Returns true if instruction is reachable from entry. | |
| bool | isAliveAfter (const AllocaInst *AI, const Instruction *I) const |
| Returns true if the alloca is alive after the instruction. | |
| LiveRange | getFullLiveRange () const |
| Returns a live range that represents an alloca that is live throughout the entire function. | |
| void | print (raw_ostream &O) |
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:
- lifetime.start and lifetime.end intrinsics
- first instruction of any basic block Interesting instructions are numbered in the depth-first walk of the CFG, and in the program order inside each basic block.
Definition at line 37 of file StackLifetime.h.
◆ LivenessType
◆ getFullLiveRange()
| LiveRange llvm::StackLifetime::getFullLiveRange ( ) const | inline |
|---|
Returns a live range that represents an alloca that is live throughout the entire function.
Definition at line 160 of file StackLifetime.h.
References LiveRange.
Referenced by run().
◆ getLiveRange()
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 35 of file StackLifetime.cpp.
Referenced by isAliveAfter().
◆ getMarkers()
◆ isAliveAfter()
◆ isReachable()
Returns true if instruction is reachable from entry.
Definition at line 41 of file StackLifetime.cpp.
References I.
◆ print()
◆ run()
| void StackLifetime::run | ( | ) |
|---|
The documentation for this class was generated from the following files:
- include/llvm/Analysis/StackLifetime.h
- lib/Analysis/StackLifetime.cpp