P4C
The P4 Compiler
|
Replace deparser IR with lowered version that references containers instead of fields. More...
Classes | |
class | CoalesceLearning |
Replaces consecutive extracts of the same container with a single extract. More... | |
struct | Parde::Lowered::ComputeLoweredDeparserIR |
Generates lowered deparser IR with container references. More... | |
struct | Parde::Lowered::ReplaceDeparserIR |
Replace deparser IR with lowered version. More... | |
struct | Parde::Lowered::RewriteEmitClot |
Replace Emits covered in a CLOT with EmitClot. More... | |
Replace deparser IR with lowered version that references containers instead of fields.
Generate a lowered version of the parser IR in this program and swap it in in place of the existing representation.
The pass does this by:
class CoalesceLearning |
Replaces consecutive extracts of the same container with a single extract.
Copyright (C) 2024 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Digests cannot extract from the same 16 or 32 bit PHV consecutively, but for learning digests, since we control the layout completely, we can set it up to just extract the container once, and use the data from that container more than once.
This pass detects consecutive extracts of the same container and replaces them with a single extract, rewriting the control-plane info to match. In theory we could combine any extracts from the same container (not just adjacent ones) to reduce the number of digest bytes needed
struct Parde::Lowered::ComputeLoweredDeparserIR |
Generates lowered deparser IR with container references.
Generate the lowered deparser IR by splitting references to fields in the high-level deparser IR into references to containers.
Public Member Functions | |
ComputeLoweredDeparserIR (const PhvInfo &phv, const ClotInfo &clotInfo) | |
Public Attributes | |
std::map< gress_t, std::map< const IR::BFN::EmitChecksum *, unsigned > > | checksumInfo |
IR::BFN::LoweredDeparser * | egLoweredDeparser |
IR::BFN::LoweredDeparser * | igLoweredDeparser |
The lowered deparser IR generated by this pass. | |
struct Parde::Lowered::ReplaceDeparserIR |
Replace deparser IR with lowered version.
Replace the high-level deparser IR version of each deparser with the lowered version generated by ComputeLoweredDeparserIR.
Public Member Functions | |
ReplaceDeparserIR (const IR::BFN::LoweredDeparser *igLoweredDeparser, const IR::BFN::LoweredDeparser *egLoweredDeparser) | |
struct Parde::Lowered::RewriteEmitClot |
Replace Emits covered in a CLOT with EmitClot.
This pass visits the deparsers, and for each deparser, it walks through the emits and identifies checksums/fields that are covered as part of a CLOT. Elements that are covered by a CLOT are removed from the emit list and are replace by EmitClot objects.
Public Member Functions | |
RewriteEmitClot (const PhvInfo &phv, ClotInfo &clotInfo) | |