This is an archive of the discontinued LLVM Phabricator instance.

[ValueTracking] Add support for `bswap` and `bitreverse` in `isKnownToBeAPowerOfTwo`
ClosedPublic

Authored by goldstein.w.n on Aug 7 2023, 10:47 AM.

Details

Summary

Both of these intrinsics don't change the number of 1s/0s so we can
look directly through them.

Proofs: https://alive2.llvm.org/ce/z/gnZuwC

Diff Detail

Event Timeline

goldstein.w.n created this revision.Aug 7 2023, 10:47 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 7 2023, 10:47 AM
goldstein.w.n requested review of this revision.Aug 7 2023, 10:47 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 7 2023, 10:47 AM
nikic accepted this revision.Aug 7 2023, 11:23 AM

LGTM

This revision is now accepted and ready to land.Aug 7 2023, 11:23 AM
This revision was landed with ongoing or failed builds.Aug 9 2023, 12:45 PM
This revision was automatically updated to reflect the committed changes.