-
Notifications
You must be signed in to change notification settings - Fork 444
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
Conversation
Signed-off-by: Mihai Budiu <[email protected]>
Signed-off-by: Mihai Budiu <[email protected]>
Signed-off-by: Mihai Budiu <[email protected]>
Signed-off-by: Mihai Budiu <[email protected]>
test-tools has failed, but I don't know how to figure out what the problem is. |
Some of the expected For example, look at the changes in this PR for the file decl2-frontend.p4. Is there enough left to verify the compiler is not mis-transforming the input program? Or perhaps gauntlet is checking every intermediate step during CI here, so we don't need to worry about this? |
@@ -0,0 +1,12 @@ | |||
void x() { | |||
} |
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.
Should these expected output files with "FrontEnd_41_SimplifyDefUse" be in this PR? I don't see any input P4 program in the p4c repo that corresponds to them. Perhaps added into this PR by mistake due to some local new test P4 program you have?
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 have deleted these.
In principle gauntlet checks equivalence of the code, so it should flag any file where the semantics changes.
But it does not check all files, and not between all compilation points.
@fruffy what are the representations checked? We should document this somewhere.
I have reviewed some -frontend files, but not all.
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.
Gauntlet currently only checks p4test's front and mid end. I have also disabled parser checking for Gauntlet (the missing implementation for extract causes issues). The only pass that is skipped is FlattenHeaderUnion. I can try to add a README on this.
Signed-off-by: Mihai Budiu <[email protected]>
@@ -21,13 +21,13 @@ struct parsed_packet_t { | |||
|
|||
struct local_metadata_t { | |||
short _s0; | |||
@field_list(0) | |||
@field_list(0) |
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 there is a space being added here?
hd_12.setInvalid(); | ||
h_0.h2[0] = hd_12; |
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.
Some of these seem quite aggressive. Gauntlet does not complain but I will try to check these manually. Intuitively, it makes sense since all these headers are set invalid.
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.
LGTM
Do you want to merge this first before #3606? |
Inlining leads to many optimization opportunities.
Doing this has uncovered a few bugs in the analysis itself, which should be fixed in this PR.
Unfortunately many reference outputs change.