Skip to content

Conversation

@nikic
Copy link
Contributor

@nikic nikic commented Dec 12, 2025

I believe this fold isn't going to do anything useful: If the constant is 0, then we'll already handle this via isKnownNonZero(). If the constant is non-zero, we'll create an inttoptr constant expression, and as far as I can tell we don't have any InstSimplify folds that would apply for that case.

I believe this fold isn't going to do anything useful: If the
constant is 0, then we'll already handle this via isKnownNonZero().
If the constant is non-zero, we'll create an inttoptr constant
expression, and as far as I can tell we don't have any InstSimplify
folds that would apply for that case.
@nikic
Copy link
Contributor Author

nikic commented Dec 17, 2025

Looks like the case where this makes a difference if if we're comparing ptrtoint of a phi node. In that case threadCmpOverPhi() does full recursion, while isKnownNonZero() only does partial.

Might still make sense to drop as this seems rather niche, but it's clearly not NFC at least...

@nikic nikic closed this Dec 17, 2025
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.

1 participant