19#ifndef BACKENDS_TOFINO_BF_P4C_COMMON_ALIAS_H_
20#define BACKENDS_TOFINO_BF_P4C_COMMON_ALIAS_H_
22#include "backends/tofino/bf-p4c/bf-p4c-options.h"
23#include "backends/tofino/bf-p4c/logging/pass_manager.h"
24#include "backends/tofino/bf-p4c/phv/phv_fields.h"
25#include "backends/tofino/bf-p4c/phv/pragma/pa_alias.h"
26#include "backends/tofino/bf-p4c/phv/transforms/auto_alias.h"
40 bool preorder(
const IR::HeaderOrMetadata *h)
override;
44 : fieldNameToExpressionsMap(f) {}
61 IR::Node *preorder(IR::BFN::Pipe *)
override;
62 IR::Node *preorder(IR::Expression *expr)
override;
67 : phv(p), pragmaAlias(pragmaAlias), fieldExpressions(f) {}
85 IR::Node *preorder(IR::MAU::Instruction *inst)
override;
86 IR::Node *postorder(IR::MAU::Action *action)
override;
90 : phv(p), pragmaAlias(pa) {}
114 LOG1(pragmaAlias.pretty_print());
124 IR::Node *preorder(IR::BFN::AliasMember *alias)
override {
125 const PHV::Field *aliasSource = phv.field(alias->source);
126 const PHV::Field *aliasDestination = phv.field(alias);
127 BUG_CHECK(aliasSource,
"Field %1% not found", alias->source);
128 BUG_CHECK(aliasDestination,
"Field %1% not found", alias);
133 IR::Node *preorder(IR::BFN::AliasSlice *alias)
override {
134 const PHV::Field *aliasSource = phv.field(alias->source);
135 const PHV::Field *aliasDestination = phv.field(alias);
136 BUG_CHECK(aliasSource,
"Field %1% not found", alias->source);
137 BUG_CHECK(aliasDestination,
"Field %1% not found", alias);
Definition backends/tofino/bf-p4c/common/alias.h:74
Definition backends/tofino/bf-p4c/common/alias.h:101
Definition backends/tofino/bf-p4c/common/alias.h:34
Definition backends/tofino/bf-p4c/logging/pass_manager.h:36
Definition ir/pass_manager.h:184
Definition ordered_map.h:32
Definition phv_fields.h:154
Definition phv_fields.h:1095
void addAliasMapEntry(const PHV::Field *f1, const PHV::Field *f2)
Adds an entry to the aliasMap.
Definition phv_fields.h:1634
Replace AliasMember and AliasSlice nodes with their alias sources.
Definition backends/tofino/bf-p4c/common/alias.h:121
Definition backends/tofino/bf-p4c/common/alias.h:51
@ AUTO
Creates if this is the first time writing to the log; otherwise, appends.
Definition filelog.h:43
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24