frontend: Fix SpecializeGenericTypes#5133
Conversation
8d17ce1 to
988e1b6
Compare
d13e3d7 to
22142e6
Compare
asl
left a comment
There was a problem hiding this comment.
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 <vladimir.still@altera.com>
Signed-off-by: Vladimír Štill <vladimir.still@altera.com>
Signed-off-by: Vladimír Štill <vladimir.still@altera.com>
Signed-off-by: Vladimír Štill <vladimir.still@altera.com>
Signed-off-by: Vladimír Štill <vladimir.still@altera.com>
Signed-off-by: Vladimír Štill <vladimir.still@altera.com>
Signed-off-by: Vladimír Štill <vladimir.still@altera.com>
Signed-off-by: Vladimír Štill <vladimir.still@altera.com>
Co-authored-by: Anton Korobeynikov <anton@korobeynikov.info> Signed-off-by: Vladimír Štill <git@vstill.eu>
Signed-off-by: Vladimír Štill <vladimir.still@altera.com>
Co-authored-by: Anton Korobeynikov <anton@korobeynikov.info> Signed-off-by: Vladimír Štill <git@vstill.eu>
Signed-off-by: Vladimír Štill <vladimir.still@altera.com>
Signed-off-by: Vladimír Štill <vladimir.still@altera.com>
Signed-off-by: Vladimír Štill <vladimir.still@altera.com>
Signed-off-by: Vladimír Štill <vladimir.still@altera.com>
45376f3 to
368d079
Compare
Signed-off-by: Vladimír Štill <vladimir.still@altera.com>
|
It passed after rerun. |
fruffy
left a comment
There was a problem hiding this comment.
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.
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.
oh, sometimes I forget which conventions differ between projects, renamed to be more consistent :-)
Signed-off-by: Vladimír Štill <vladimir.still@altera.com>
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
S2is inserted after specialization ofS1which refers to it.fixes #4835