Skip to content

[ConstraintElim] Add facts about non-poison intrinsics on demand #136558

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dtcxzyw
Copy link
Member

@dtcxzyw dtcxzyw commented Apr 21, 2025

Address comment #80121 (comment).
TODO: caching added non-poison values

@dtcxzyw
Copy link
Member Author

dtcxzyw commented Apr 22, 2025

Compile-time overhead is high: https://llvm-compile-time-tracker.com/compare.php?from=2ba455ff3dd192ff814514647d485491510a6342&to=7338200a504c6f16f4394fbcbbe632bcfcc54b6e&stat=instructions%3Au
@fhahn @nikic Do you think this patch is in the right direction? If so, I can further reduce the overhead by maintaining a global cache for visited non-poison values.

Copy link
Contributor

@nikic nikic left a comment

Choose a reason for hiding this comment

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

I don't really understand the approach you are using here. What I expected to see is something along the lines of how we handle IsKnownNonNegative, where we add additional constraints to ExtraInfo, which will be used while checking the condition only.

Basically, would it be possible to extend ConstraintInfo::getConstraint to go through the variables, and if they are umin/etc add the additional constraint to ExtraInfo? Or is that insufficient?

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.

2 participants