Liveness analysis by basic block.
In the liveness analysis, the in_value of a block is the set of variables that are live at the start of a block. "Live" means that the current value of the variable may be used later in the execution. The out_value of a block is the set of variable identifiers that are live at the end of the block.
Since this is a backward analysis, the "before_value" is the out_value and the "after_value" is the in_value.
Method | __init__ |
Undocumented |
Method | aggregate |
Computes the out_value (before_value) of a block. |
Method | compute |
Computes the liveness analysis gen and kill sets for a basic block. |
Inherited from Analysis
:
Method | visit |
Visit the nodes of the control flow graph, performing the analysis. |
Instance Variable | after |
Either the in_label or out_label depending on the direction of the analysis. Marks the after_value on a node during an analysis. |
Instance Variable | before |
Either the in_label or out_label depending on the direction of the analysis. Marks the before_value on a node during an analysis. |
Instance Variable | forward |
(bool) True for forward analyses, False for backward analyses. |
Instance Variable | in |
The name of the analysis, suffixed with _in. |
Instance Variable | label |
The name of the analysis. |
Instance Variable | out |
The name of the analysis, suffixed with _out. |
Computes the out_value (before_value) of a block.
Parameters | |
previous | A list of the sets of live variables at the start of each of the blocks following the current block. |
Returns | |
The set of live variables at the end of the current block. This is the union of live variable sets at the start of each subsequent block. |
Computes the liveness analysis gen and kill sets for a basic block.
The gen set is the set of variables read by the block before they are written to. The kill set is the set of variables written to by the basic block.
Parameters | |
block | The BasicBlock to analyze. |
before | The out_value for block (the set of variables live at the end of the block.) |
Returns | |
The in_value for block (the set of variables live at the start of the block). |