P4C
The P4 Compiler
|
#include <parser_packing_validator.h>
Public Member Functions | |
ParserPackingValidator (const PhvInfo &phv, const MapFieldToParserStates &parser, const CollectParserInfo &parser_info, const FieldDefUse &defuse, const PragmaNoInit &pa_no_init, std::set< FieldRange > &mauInitFields) | |
const AllocError * | can_pack (const FieldSliceAllocStartMap &alloc, bool add_mau_inits=false) const override |
const AllocError * | can_pack (const FieldSliceStart &a, const FieldSliceStart &b, bool add_mau_inits=false) const |
void | set_trivial_alloc (bool trivial) const |
void | set_trivial_pass (bool trivial) const |
Public Member Functions inherited from PHV::ParserPackingValidatorInterface |
what we have done wrong: only check against candidate and allocated: this is because we assume that slice lists make sure that the packing is okay because they are very likely coming out from a header. But, it is not true for (1) bridged metadata, they are metadata and we packed them. (2) fancy usage of header fields. (3) result came from co-packer or table key optimization packing. (4) pa_byte_pack.
|
overridevirtual |
alloc
. c
is optional for 32-bit container half-word extract optimization. make sure that every pair of field slices can be packed.
Implements PHV::ParserPackingValidatorInterface.
const AllocError * PHV::v2::ParserPackingValidator::can_pack | ( | const FieldSliceStart & | a, |
const FieldSliceStart & | b, | ||
bool | add_mau_inits = false ) const |
a
and b
in a container. c
is optional for 32-bit container half-word extract optimization.