19#ifndef BACKENDS_TOFINO_BF_P4C_PHV_PRAGMA_PA_ALIAS_H_
20#define BACKENDS_TOFINO_BF_P4C_PHV_PRAGMA_PA_ALIAS_H_
25#include "backends/tofino/bf-p4c/phv/phv_fields.h"
26#include "backends/tofino/bf-p4c/phv/pragma/pa_no_overlay.h"
27#include "backends/tofino/bf-p4c/phv/pragma/pretty_print.h"
28#include "backends/tofino/bf-p4c/phv/utils/utils.h"
40 enum CreatedBy { PRAGMA, COMPILER };
48 std::optional<le_bitrange>
range;
64 bitvec fieldsWithExpressions;
66 bitvec fieldsWithAliasingSrc;
68 bitvec fieldsWithAliasingDst;
73 bool preorder(
const IR::Expression *expr)
override;
76 void postorder(
const IR::BFN::Pipe *pipe)
override;
80 : phv_i(phv), no_overlay(no_ovrl) {}
81 const AliasMap &getAliasMap()
const {
return aliasMap; }
85 static const char *description;
86 static const char *help;
91 std::optional<std::pair<const PHV::Field *, const PHV::Field *>>
mayAddAlias(
93 CreatedBy who = PRAGMA);
96 CreatedBy who = PRAGMA);
98 std::string pretty_print()
const override;
101std::ostream &operator<<(std::ostream &out,
const PragmaAlias &pa_a);
Definition phv_fields.h:154
Definition phv_fields.h:1095
Definition pretty_print.h:29
static const char * name
BFN::Pragma interface.
Definition pa_alias.h:84
CreatedBy who
Who created the pragma?
Definition pa_alias.h:51
cstring field
The alias destination field.
Definition pa_alias.h:44
std::optional< le_bitrange > range
Definition pa_alias.h:48
ordered_map< cstring, AliasDestination > AliasMap
Map type from alias sources to destinations.
Definition pa_alias.h:55
std::optional< std::pair< const PHV::Field *, const PHV::Field * > > mayAddAlias(const PHV::Field *f1, const PHV::Field *f2, bool suppressWarning=false, CreatedBy who=PRAGMA)
Definition pa_alias.cpp:76
Definition pa_no_overlay.h:33
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24