P4C
The P4 Compiler
Loading...
Searching...
No Matches
reduction_or.h
1
19#ifndef BF_P4C_MAU_REDUCTION_OR_H_
20#define BF_P4C_MAU_REDUCTION_OR_H_
21
22#include <map>
23
24#include "bf-p4c/mau/mau_visitor.h"
25#include "lib/ordered_set.h"
26
27using namespace P4;
28
48 using SaluReductionOrGroup = std::map<cstring, ordered_set<const IR::MAU::StatefulAlu *>>;
49 using TblReductionOrGroup = std::map<cstring, ordered_set<const IR::MAU::Table *>>;
50
51 SaluReductionOrGroup salu_reduction_or_group;
52 TblReductionOrGroup tbl_reduction_or_group;
53 bool is_reduction_or(const IR::MAU::Instruction *, const IR::MAU::Table *,
54 cstring &red_or_key) const;
55
56 void clear() {
57 salu_reduction_or_group.clear();
58 tbl_reduction_or_group.clear();
59 }
60};
61
63 Visitor::profile_t init_apply(const IR::Node *node) override;
64 bool preorder(const IR::MAU::StatefulAlu *) override;
65 bool preorder(const IR::MAU::Action *) override { return false; }
66
67 ReductionOrInfo &red_or_info;
68
69 public:
70 explicit GatherReductionOrReqs(ReductionOrInfo &red_or_info) : red_or_info(red_or_info) {}
71};
72
73#endif /* BF_P4C_MAU_REDUCTION_OR_H_ */
Definition reduction_or.h:62
Definition mau_visitor.h:29
Definition node.h:95
Definition visitor.h:78
Definition cstring.h:85
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24
Definition reduction_or.h:47
bool is_reduction_or(const IR::MAU::Instruction *, const IR::MAU::Table *, cstring &red_or_key) const
Definition reduction_or.cpp:30