-
Notifications
You must be signed in to change notification settings - Fork 456
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
frontend: Fix SpecializeGenericTypes #5133
Conversation
8d17ce1
to
988e1b6
Compare
d13e3d7
to
22142e6
Compare
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.
Overall, looks good to me. See some minor notes and questions.
@vlstill Looks like generic-struct.p4 is failing |
Yep, there was still some dependency on processing order, it should now be fixed hopefully. |
1bf8c88
to
3cdff52
Compare
Always place the specialized structs *right before* the original. Signed-off-by: Vladimír Štill <[email protected]>
Signed-off-by: Vladimír Štill <[email protected]>
Signed-off-by: Vladimír Štill <[email protected]>
Signed-off-by: Vladimír Štill <[email protected]>
Signed-off-by: Vladimír Štill <[email protected]>
Signed-off-by: Vladimír Štill <[email protected]>
Signed-off-by: Vladimír Štill <[email protected]>
Signed-off-by: Vladimír Štill <[email protected]>
Signed-off-by: Vladimír Štill <[email protected]>
Co-authored-by: Anton Korobeynikov <[email protected]> Signed-off-by: Vladimír Štill <[email protected]>
Signed-off-by: Vladimír Štill <[email protected]>
Co-authored-by: Anton Korobeynikov <[email protected]> Signed-off-by: Vladimír Štill <[email protected]>
Signed-off-by: Vladimír Štill <[email protected]>
Signed-off-by: Vladimír Štill <[email protected]>
Signed-off-by: Vladimír Štill <[email protected]>
Signed-off-by: Vladimír Štill <[email protected]>
45376f3
to
368d079
Compare
Signed-off-by: Vladimír Štill <[email protected]>
It passed after rerun. |
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.
Not very familiar with that pass so it might take me a bit to give a proper review. Other might be better qualified for that.
@@ -0,0 +1,50 @@ | |||
#include <core.p4> |
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.
Somewhat of a nonstandard issue name for the file? Although we do not really have a consistent naming scheme.
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.
oh, sometimes I forget which conventions differ between projects, renamed to be more consistent :-)
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.
Great, thanks!
Signed-off-by: Vladimír Štill <[email protected]>
A significant rewrite of
SpecializeGenericTypes
. Namely it fixes problems occurring in more complex specializations where a specialized type might depend on another specialized type and their order of insertion can be incorrect. Instead the types are now inspected to check for their dependencies and inserted just after all of the dependencies. I've also change the naming scheme of the specializations so that simple once are more readable (although for complex once the types quickly becomes ugly).A caveat is that many passes seem to use very similar, but slightly different patterns and these passes still contain bugs (e.g.
EliminateTuples
.SpecializeGenericFunctions
). Ideally, we would want to factor out the common parts and implement only the specific once, but I don't have time for that (at least not now). Namely at least the insertion part should be factorable for any pass that inserts global objects that can have dependencies.Without the changes, the added test fails with
The reason is that the specialization of
S2
is inserted after specialization ofS1
which refers to it.fixes #4835