P4C
The P4 Compiler
Loading...
Searching...
No Matches
rewrite_parser_locals.h
1
19#ifndef BACKENDS_TOFINO_BF_P4C_PARDE_REWRITE_PARSER_LOCALS_H_
20#define BACKENDS_TOFINO_BF_P4C_PARDE_REWRITE_PARSER_LOCALS_H_
21#include "bf-p4c/phv/phv_fields.h"
22#include "bf-p4c/phv/phv_parde_mau_use.h"
23#include "collect_parser_usedef.h"
24
26 const PhvInfo &phv;
28 bool preorder(const IR::BFN::Select *select) override;
29
30 public:
34 explicit GetSelectFieldInfo(const PhvInfo &phv) : phv(phv) {}
35 Visitor::profile_t init_apply(const IR::Node *root) override {
37 return Inspector::init_apply(root);
38 }
39};
40
42 const PhvInfo &phv;
43 CollectParserInfo &parserInfo;
44 const GetSelectFieldInfo &getSelectField;
45 const PhvUse &uses;
48 bool preorder(IR::BFN::Extract *) override;
49
50 public:
51 AddParserMatchDefs(const PhvInfo &phv, CollectParserInfo &parserInfo,
52 const GetSelectFieldInfo &getSelectField, const PhvUse &uses)
53 : phv(phv), parserInfo(parserInfo), getSelectField(getSelectField), uses(uses) {}
54};
55
67 public:
68 explicit RewriteParserMatchDefs(const PhvInfo &phv);
69};
70
71#endif /*BACKENDS_TOFINO_BF_P4C_PARDE_REWRITE_PARSER_LOCALS_H_*/
Definition rewrite_parser_locals.h:41
Definition rewrite_parser_locals.h:25
ordered_map< const PHV::Field *, ordered_set< const IR::BFN::ParserState * > > select_field_to_state
A map of select fields to the states that use them.
Definition rewrite_parser_locals.h:33
Definition visitor.h:400
Definition visitor.h:372
Definition ir/pass_manager.h:40
Definition ordered_map.h:32
Definition phv_fields.h:1095
Definition phv_parde_mau_use.h:154
Looks for extracts into temporary local variables used in select statements.
Definition rewrite_parser_locals.h:66