-
Notifications
You must be signed in to change notification settings - Fork 449
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
Do not check for shadowing repeatedly in inlining passes. #4396
Conversation
c26bbd7
to
2ee93c5
Compare
@@ -51,9 +51,7 @@ class ActionsInliner : public AbstractInliner<ActionsInlineList, AInlineWorkList | |||
std::map<const IR::MethodCallStatement *, const IR::P4Action *> *replMap; | |||
|
|||
public: | |||
explicit ActionsInliner(bool isv1) : refMap(new P4::ReferenceMap()), replMap(nullptr) { | |||
refMap->setIsV1(isv1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason why you are removing the isv1 check here and in other places? I think we should deprecated that strange feature eventually but it seems like you may change some semantics here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is because the ReferenceMap being passed in already has the isv1 flag set appropriately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah, makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@grg Any concerns on this PR?
We found that checking shadowing in
ResolveReferences
was a big bottleneck for one of our apps, and it is done each time an inlining pass is repeated. We turned this off and added a newResolveReferences
pass to check shadowing after all inlining is completed. This greatly helped to speed up these passes, which were taking the longest.Compilation times for one of our apps without these changes:
and with them: