This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Fix potentially buggy code in `((%x & C) == 0) --> %x u< (-C)` transform
ClosedPublic

Authored by goldstein.w.n on Jan 5 2023, 2:24 PM.

Details

Summary

Its possible for C2 to have set bits that are known not-needed
(zeroable). See: D140858

+ will overflow here, | will get the right logic.

Diff Detail

Event Timeline

goldstein.w.n created this revision.Jan 5 2023, 2:24 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 5 2023, 2:24 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
goldstein.w.n requested review of this revision.Jan 5 2023, 2:24 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 5 2023, 2:24 PM
nikic accepted this revision.Jan 6 2023, 12:59 AM

LGTM

This revision is now accepted and ready to land.Jan 6 2023, 12:59 AM
nikic added a comment.Jan 7 2023, 10:07 AM

If you don't have commit access, can you please share the "Name <email>" to use for the commit?

See also https://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access for requesting commit access.

If you don't have commit access, can you please share the "Name <email>" to use for the commit?

I don't, email: goldstein.w.n@gmail.com. Thank you :)

See also https://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access for requesting commit access.

Will do, although if its all the same, wouldn't mind getting a bit more familiar
before getting write access, don't want to mess up big time :/