P4C
The P4 Compiler
|
Public Types | |
enum class | OpInfo { DEAD , READ , WRITE , READ_WRITE , LIVE } |
Public Member Functions | |
bool | can_overlay (const LiveRangeInfo &other) const |
OpInfo & | deparser () |
const OpInfo & | deparser () const |
std::vector< LiveRange > | disjoint_ranges () const |
OpInfo & | parser () |
const OpInfo & | parser () const |
OpInfo & | stage (int i) |
const OpInfo & | stage (int i) const |
const safe_vector< OpInfo > & | vec () const |
Static Public Member Functions | |
static std::vector< LiveRange > | merge_invalid_ranges (const std::vector< LiveRange > &ranges) |
static void | set_num_table_stages (int stage) |
bool PHV::LiveRangeInfo::can_overlay | ( | const LiveRangeInfo & | other | ) | const |
other
can be overlaid, defined as: (1) For any stage s, at least one of OpInfo at s of this or other
is dead. (2) Except for the write-after-read case that: For example P 0 1 2 3 4 D A W L L R D D D B D D D W L L R A and B can be overlaid because the Write at stage 2 of B actually happens after the Read of A at stage 2, i.e., for write, we require Dead in the next stage, instead of the corresponding stage. Note that, we cannot overlay in this case: P 0 1 2 3 4 D A W L L R D D D B D D W RW L L R TODO: we do not need to use this function during PHV allocation because AllocSlices already have the presice live range info already. This function is kept here for future overlay analysis before PHV allocation. std::vector< LiveRange > PHV::LiveRangeInfo::disjoint_ranges | ( | ) | const |
|
static |
ranges
must be disjoint and sorted in increasing order of LiveRange. a compiler BUG will be thrown if not satisfied.
|
inlinestatic |
Record the number of table stages in use
Minimum size is Device::numStages()
|
inline |