Skip to content

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?

@dtcxzyw
Copy link
Member Author

dtcxzyw commented Jul 26, 2025

I don't really understand the approach you are using here.

If an instruction is guaranteed not to be a poison and not to produce a poison, its operands are also non-poison (except for select). We collect a set of non-poison values used as conditions first, then find the closure of the set with the rule above. Finally we add constraints for non-poison intrinsics.

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