31 std::map<cstring, std::vector<ordered_set<const PHV::Field *>>> stride_groups;
35 bool preorder(
const IR::HeaderStack *hs) {
36 auto state = findContext<IR::BFN::ParserState>();
38 if (state && state->stride) {
39 LOG4(state->name <<
" needs strided allocation (stride size = " << hs->size <<
")");
41 for (
auto f : hs->type->fields) {
44 for (
int i = 0; i < hs->size; i++) {
45 cstring name = hs->name +
"[" + cstring::to_cstring(i) +
"]." + f->name;
46 auto field = phv.field(name);
47 stride_group.push_back(field);
50 stride_groups[hs->name].push_back(stride_group);
58 for (
auto &[_, groups] : stride_groups) {
59 for (
auto &group : groups) {
60 if (group.count(f))
return &group;
68 profile_t rv = Inspector::init_apply(root);
69 stride_groups.clear();