P4C
The P4 Compiler
Toggle main menu visibility
Main Page
P4C Repository Organization
Getting Started
P4C Intermediate Representation (IR)
Frontend
Midend
Backends
Behavioral Model Backend
DPDK Backend
eBPF Backend
TC Backend
uBPF Backend
P4test Backend
Graphs Backend
p4fmt (P4 Formatter)
P4Tools
P4Smith
P4Testgen
Contribute to the P4 Compiler Project
Releases
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
w
x
z
Functions
a
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
w
x
Variables
Typedefs
Enumerations
Enumerator
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
z
~
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
Typedefs
Enumerations
Enumerator
Related Symbols
►
P4 Compiler Documentation (P4C)
•
All
Classes
Namespaces
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Modules
Pages
Loading...
Searching...
No Matches
deparser_zero.h
1
18
19
#ifndef BF_P4C_PHV_ANALYSIS_DEPARSER_ZERO_H_
20
#define BF_P4C_PHV_ANALYSIS_DEPARSER_ZERO_H_
21
22
#include <optional>
23
24
#include "backends/tofino/bf-p4c/common/field_defuse.h"
25
#include "backends/tofino/bf-p4c/mau/action_analysis.h"
26
#include "backends/tofino/bf-p4c/parde/clot/clot_info.h"
27
#include "backends/tofino/bf-p4c/phv/phv_fields.h"
28
#include "backends/tofino/bf-p4c/phv/pragma/pa_deparser_zero.h"
29
#include "backends/tofino/bf-p4c/phv/utils/utils.h"
30
#include "ir/ir.h"
31
40
class
IdentifyDeparserZeroCandidates :
public
Inspector
{
41
private
:
42
PhvInfo
&phv;
43
const
FieldDefUse
&defuse;
44
const
ReductionOrInfo
&red_info;
45
const
PragmaDeparserZero
&pragmaFields;
46
ordered_set<const PHV::Field *>
&candidateFields;
47
49
bitvec
mauReadFields;
51
bitvec
mauWrittenFields;
53
bitvec
mauWrittenToZeroFields;
55
bitvec
mauWrittenToNonZeroFields;
57
bitvec
mauWrittenByNonSets;
58
60
void
eliminateNonByteAlignedFields();
61
62
profile_t
init_apply(
const
IR::Node
*root)
override
;
63
bool
preorder(
const
IR::MAU::Action *act)
override
;
64
bool
preorder(
const
IR::BFN::DigestFieldList *)
override
;
65
void
end_apply()
override
;
66
67
public
:
68
explicit
IdentifyDeparserZeroCandidates(
PhvInfo
&p,
const
FieldDefUse
&d,
69
const
ReductionOrInfo
&ri,
const
PragmaDeparserZero
&f,
70
ordered_set<const PHV::Field *>
&c)
71
: phv(p), defuse(d), red_info(ri), pragmaFields(f), candidateFields(c) {}
72
};
40
class
IdentifyDeparserZeroCandidates :
public
Inspector
{
…
};
73
76
class
ImplementDeparserZero :
public
Transform
{
77
private
:
78
PhvInfo
&phv;
79
const
ordered_set<const PHV::Field *>
&candidateFields;
80
const
ClotInfo
&clots;
81
82
IR::Node
*preorder(IR::BFN::Extract *extract)
override
;
83
IR::Node
*preorder(IR::MAU::Instruction *inst)
override
;
84
85
public
:
86
explicit
ImplementDeparserZero(
PhvInfo
&p,
const
ordered_set<const PHV::Field *>
&c,
87
const
ClotInfo
&ci)
88
: phv(p), candidateFields(c), clots(ci) {}
89
};
76
class
ImplementDeparserZero :
public
Transform
{
…
};
90
91
class
DeparserZeroOptimization :
public
PassManager {
92
private
:
93
ordered_set<const PHV::Field *>
candidateFields;
94
95
public
:
96
explicit
DeparserZeroOptimization(
PhvInfo
&p,
const
FieldDefUse
&d,
const
ReductionOrInfo
&ri,
97
const
PragmaDeparserZero
&pf,
const
ClotInfo
&c);
98
};
91
class
DeparserZeroOptimization :
public
PassManager {
…
};
99
100
#endif
/* BF_P4C_PHV_ANALYSIS_DEPARSER_ZERO_H_ */
ClotInfo
Definition
clot_info.h:41
P4::IR::Node
Definition
node.h:94
P4::Inspector
Definition
visitor.h:413
P4::Transform
Definition
visitor.h:437
P4::Visitor::profile_t
Definition
visitor.h:78
P4::bitvec
Definition
bitvec.h:120
P4::ordered_set
Definition
ordered_set.h:32
PhvInfo
Definition
phv_fields.h:1095
PragmaDeparserZero
Definition
pa_deparser_zero.h:30
FieldDefUse
Definition
field_defuse.h:77
ReductionOrInfo
Definition
reduction_or.h:47
backends
tofino
bf-p4c
phv
analysis
deparser_zero.h
Generated by
1.13.2