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

Correctly handle don't care named arguments #3278

Merged
merged 6 commits into from
May 13, 2022

Conversation

mihaibudiu
Copy link
Contributor

Signed-off-by: Mihai Budiu mbudiu@vmware.com

Fixes #3274
This also fixes a bug where functions were considered to be side-effect-free if they had all parameters 'in'. That is wrong, such a function can still call extern functions that have side-effects.

@mihaibudiu mihaibudiu requested a review from fruffy May 2, 2022 23:01
@mihaibudiu mihaibudiu changed the title Issue3274 Correctly handle don't care named arguments May 2, 2022
Copy link
Collaborator

@fruffy fruffy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is missing the ref files. Some of the ref file changes are hard to read, but Gauntlet is at least not complaining.

@mihaibudiu
Copy link
Contributor Author

I started to make some changes to improve the quality of the generated code, which turned into something bigger. I will split this into two PRs, a small one here with correct outputs and another one which improves code quality by running def-use after inlining again.

Mihai Budiu added 5 commits May 11, 2022 12:41
Signed-off-by: Mihai Budiu <mbudiu@vmware.com>
Signed-off-by: Mihai Budiu <mbudiu@vmware.com>
…shared the IR tree

Signed-off-by: Mihai Budiu <mbudiu@vmware.com>
Signed-off-by: Mihai Budiu <mbudiu@vmware.com>
Signed-off-by: Mihai Budiu <mbudiu@vmware.com>
Signed-off-by: Mihai Budiu <mbudiu@vmware.com>
@mihaibudiu mihaibudiu merged commit 1d5b90d into p4lang:main May 13, 2022
@mihaibudiu mihaibudiu deleted the issue3274 branch May 13, 2022 02:01
github-sajan pushed a commit to github-sajan/p4c that referenced this pull request May 26, 2022
* Correctly handle don't care named arguments
* def-use analysis requires all statements (including Empty) not to be shared the IR tree

Signed-off-by: Mihai Budiu <mbudiu@vmware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compiler does not handle correctly don't care arguments
2 participants