MLIR  16.0.0git
mlir::LivenessBlockInfo Class Reference

This class represents liveness information on block level. More...

#include "mlir/Analysis/Liveness.h"

## Public Types

using ValueSetT = Liveness::ValueSetT
A typedef declaration of a value set. More...

## Public Member Functions

BlockgetBlock () const
Returns the underlying block. More...

const ValueSetTin () const
Returns all values that are live at the beginning of the block (unordered). More...

const ValueSetTout () const
Returns all values that are live at the end of the block (unordered). More...

bool isLiveIn (Value value) const
Returns true if the given value is in the live-in set. More...

bool isLiveOut (Value value) const
Returns true if the given value is in the live-out set. More...

OperationgetStartOperation (Value value) const
Gets the start operation for the given value. More...

OperationgetEndOperation (Value value, Operation *startOperation) const
Gets the end operation for the given value using the start operation provided (must be referenced in this block). More...

ValueSetT currentlyLiveValues (Operation *op) const
Get the set of values that are currently live (if any) for the current op. More...

class Liveness

## Detailed Description

This class represents liveness information on block level.

Definition at line 99 of file Liveness.h.

## ◆ ValueSetT

A typedef declaration of a value set.

Definition at line 102 of file Liveness.h.

## ◆ currentlyLiveValues()

 LivenessBlockInfo::ValueSetT LivenessBlockInfo::currentlyLiveValues ( Operation * op ) const

Get the set of values that are currently live (if any) for the current op.

Return the values that are currently live as of the given operation.

This analysis takes an expansive view of "live" in that if a value is defined by or within the operation or is fully consumed (as in last user) by or within the operation the value is considered "live". The values in the list are not ordered.

This check is quite expensive as it does not cache the results of the computation, so the currently live values have to be recomputed for each op.

Definition at line 396 of file Liveness.cpp.

References mlir::Operation::isBeforeInBlock(), and value.

## ◆ getBlock()

 Block* mlir::LivenessBlockInfo::getBlock ( ) const
inline

Returns the underlying block.

Definition at line 106 of file Liveness.h.

Referenced by walkReferenceCountedValues().

## ◆ getEndOperation()

 Operation * LivenessBlockInfo::getEndOperation ( Value value, Operation * startOperation ) const

Gets the end operation for the given value using the start operation provided (must be referenced in this block).

Definition at line 375 of file Liveness.cpp.

References mlir::Value::getUsers(), and mlir::Operation::isBeforeInBlock().

## ◆ getStartOperation()

 Operation * LivenessBlockInfo::getStartOperation ( Value value ) const

Gets the start operation for the given value.

Gets the start operation for the given value (must be referenced in this block).

This is the first operation the given value is considered to be live. This could either be the start operation of the current block (in case the value is live-in) or the operation that defines the given value (must be referenced in this block).

Definition at line 364 of file Liveness.cpp.

References mlir::Value::getDefiningOp().

## ◆ in()

 const ValueSetT& mlir::LivenessBlockInfo::in ( ) const
inline

Returns all values that are live at the beginning of the block (unordered).

Definition at line 110 of file Liveness.h.

Referenced by mlir::Liveness::getLiveIn().

## ◆ isLiveIn()

 bool LivenessBlockInfo::isLiveIn ( Value value ) const

Returns true if the given value is in the live-in set.

Definition at line 353 of file Liveness.cpp.

Referenced by mlir::Liveness::resolveLiveness(), and walkReferenceCountedValues().

## ◆ isLiveOut()

 bool LivenessBlockInfo::isLiveOut ( Value value ) const

Returns true if the given value is in the live-out set.

Definition at line 358 of file Liveness.cpp.

## ◆ out()

 const ValueSetT& mlir::LivenessBlockInfo::out ( ) const
inline

Returns all values that are live at the end of the block (unordered).

Definition at line 114 of file Liveness.h.

References value.

Referenced by mlir::Liveness::getLiveOut().

## ◆ Liveness

 friend class Liveness
friend

Definition at line 153 of file Liveness.h.

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