8000 Extension to strength reduction for issue 5280 by ChrisDodd · Pull Request #5281 · p4lang/p4c · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Extension to strength reduction for issue 5280 #5281

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ChrisDodd
Copy link
Contributor
  • swap operands to Add when left is a constant.

@fruffy fruffy added the core Topics concerning the core segments of the compiler (frontend, midend, parser) label May 17, 2025
@ChrisDodd ChrisDodd force-pushed the cdodd-strengthreduction branch 4 times, most recently from fc7cd4a to 808daf6 Compare June 4, 2025 03:14
@ChrisDodd ChrisDodd requested review from asl and fruffy June 4, 2025 03:14
@ChrisDodd
Copy link
Contributor Author

I extended this to other commutative operators (mul and binary and/or/xor), as well as addiing the missing support for AddSat and SubSat.

@ChrisDodd ChrisDodd force-pushed the cdodd-strengthreduction branch from 808daf6 to e7ae6e7 Compare June 4, 2025 03:46
@fruffy
Copy link
Collaborator
fruffy commented Jun 21, 2025

The P4Testgen tests are likely failing because some expressions are reordered. The tests are in backends/p4tools/modules/testgen/targets/bmv2/test/small-step/binary.cpp

@ChrisDodd ChrisDodd force-pushed the cdodd-strengthreduction branch 2 times, most recently from 3cab090 to bd64294 Compare June 24, 2025 05:10
- swap operands to commutative ops when left is a constant.
- add support for AddSat and SubSat

Signed-off-by: Chris Dodd <cdodd@nvidia.com>
- use Sub instead of Add so it won't be swapped by StrengthReduction

Signed-off-by: Chris Dodd <cdodd@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Topics concerning the core segments of the compiler (frontend, midend, parser)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0