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

C++: Only propagate smallest/largest range bound in conditional expressions #18461

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

paldepind
Copy link
Contributor

@paldepind paldepind commented Jan 9, 2025

This PR changes how bounds are propagated for the ternary operator.

Currently, for c ? e1 : e2 the union of the bounds for e1 and e2 are propagated. With this change the bounds are combined with the smallest/greatest (for lower bounds/upper bounds respectively) being propagated.

Hence the number of bounds for c ? e1 : e2 changes from |e1| + |e2| to |e1| * |e2|. This is good when the number of bounds is 1 and worse otherwise. DCA will hopefully tell of if the overall impact is good or bad.

@github-actions github-actions bot added the C++ label Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant