P4C
The P4 Compiler
Loading...
Searching...
No Matches
BFN::IdentifyPovMergeTargets Class Reference

Identify POV bits that can be merged. More...

Inheritance diagram for BFN::IdentifyPovMergeTargets:
[legend]

Public Member Functions

 IdentifyPovMergeTargets (const PhvInfo &phv, const CollectParserInfo &parser_info, const HeaderValidityAnalysis &hva, ordered_map< const PHV::Field *, const PHV::Field * > &merge_pov)
 

Protected Member Functions

void end_apply () override
 
Visitor::profile_t init_apply (const IR::Node *root) override
 
bool preorder (const IR::BFN::Extract *e) override
 

Protected Attributes

const HeaderValidityAnalysishva
 
ordered_map< const PHV::Field *, const PHV::Field * > & merge_pov
 
const CollectParserInfoparser_info
 
const PhvInfophv
 
ordered_map< const PHV::Field *, std::set< const IR::BFN::ParserState * > > pov_states
 
std::set< const PHV::Field * > pov_zero_writes
 
ordered_map< const IR::BFN::ParserState *, ordered_set< const PHV::Field * > > state_povs
 

Detailed Description

Identify POV bits that can be merged.

Two POV bits can be merged if the headers are always extracted together, and if their validity remains in sync in MAU (always invalidated/validated together). The extractions can occur in the same state or in consecutive states.

FIXME: Handle headers that are not extracted but which are made valid in MAU.