P4C
The P4 Compiler
|
#include <container_equivalence.h>
Public Member Functions | |
ContainerEquivalenceTracker (const PHV::Allocation &alloc) | |
void | exclude (PHV::Container c) |
std::optional< PHV::Container > | find_equivalent_tried_container (PHV::Container c) |
void | invalidate (PHV::Container c) |
void | set_is_wide_arith () |
void | set_is_wide_arith_low () |
Keeps track of equivalence classes for the purpose of slice list allocation (for a given set of start constraints). For each class it is sufficient to check the slice list can be allocated only to the first container, if it cannot, checking the other containers is pointless.
|
inline |
Never consider this container to be equivalent to any other. Useful to mark containers appearing in exact container constraints
std::optional< PHV::Container > PHV::ContainerEquivalenceTracker::find_equivalent_tried_container | ( | PHV::Container | c | ) |
When called with a container c, this will return either:
void PHV::ContainerEquivalenceTracker::invalidate | ( | PHV::Container | c | ) |
Invalidate this container for the purpose of equivalence. That is, this container will not be considered to be equivalent to other containers any more (its class is removed). This has to be used if the constraints are too complex to evaluate and require recursive allocation of other containers.
|
inline |
Set that the slice list contains wide arithmetic and therefore the containers can only be equivalent with different containers of the same parity.
|
inline |
Set that the slice list contains low part of wide arithmetic. In this case, we can't use equivalence tracking efficiently due to quirks in the metrics which can differ for otherwise equivalent fields if used in wide arithmerics.