Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run def-use analysis again after inlining #3591

Merged
merged 6 commits into from
Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
WIP
  • Loading branch information
Mihai Budiu committed Oct 21, 2022
commit 811ed8a7437bab203ca68cfe0fcc693bd3380287
2 changes: 2 additions & 0 deletions frontends/p4/frontend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ const IR::P4Program *FrontEnd::run(const CompilerOptions &options, const IR::P4P
new RemoveParserControlFlow(&refMap, &typeMap), // more ifs may have been added to parsers
new UniqueNames(&refMap), // needed again after inlining
new MoveDeclarations(), // needed again after inlining
new SimplifyDefUse(&refMap, &typeMap),
new RemoveUnusedDeclarations(&refMap),
new SimplifyControlFlow(&refMap, &typeMap),
new HierarchicalNames(),
new FrontEndLast(),
Expand Down
2 changes: 1 addition & 1 deletion frontends/p4/simplifyDefUse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ class FindUninitialized : public Inspector {
const IR::ParameterList* parameters,
Definitions* defs) {
LOG2("Checking output parameters of " << block <<
"; definitions are " << Log::endl << defs);
"; definitions are " << IndentCtl::endl << defs);
for (auto p : parameters->parameters) {
if (p->direction == IR::Direction::Out || p->direction == IR::Direction::InOut) {
auto storage = definitions->storageMap->getStorage(p);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fabric.p4(84): [--Wwarn=invalid_header] warning: accessing a field of a potentially invalid header hdr.gtpu_ipv4
spgw_ingress.apply(hdr.gtpu_ipv4, hdr.gtpu_udp, hdr.gtpu,
^^^^^^^^^^^^^