Skip to content

llvm-reduce: Skip setting br conditions on already constant branches #133841

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

Conversation

arsenm
Copy link
Contributor

@arsenm arsenm commented Apr 1, 2025

If we are trying to simplify branch conditions to true, ignore branches
already set to a constant true. If we are simplifying to constant false,
ignore the already constant false cases. This saves steps in this edge
case, and avoids the side effect of running simplifycfg on blocks we
did not intend to modify.

If we are trying to simplify branch conditions to true, ignore branches
already set to a constant true. If we are simplifying to constant false,
ignore the already constant false cases. This saves steps in this edge
case, and avoids the side effect of running simplifycfg on blocks we
did not intend to modify.
@arsenm arsenm added the llvm-reduce label Apr 1, 2025 — with Graphite App
Copy link
Contributor Author

arsenm commented Apr 1, 2025

@arsenm arsenm requested review from aeubanks, fhahn and regehr April 1, 2025 02:36
@arsenm arsenm marked this pull request as ready for review April 1, 2025 02:36
@arsenm arsenm merged commit adbe9e2 into main Apr 2, 2025
15 checks passed
@arsenm arsenm deleted the users/arsenm/llvm-reduce/ignore-constant-condition-branches-in-reduce-conditionals branch April 2, 2025 04:41
Ankur-0429 pushed a commit to Ankur-0429/llvm-project that referenced this pull request Apr 2, 2025
…lvm#133841)

If we are trying to simplify branch conditions to true, ignore branches
already set to a constant true. If we are simplifying to constant false,
ignore the already constant false cases. This saves steps in this edge
case, and avoids the side effect of running simplifycfg on blocks we
did not intend to modify.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants