This is an archive of the discontinued LLVM Phabricator instance.

[TargetLowering][InstCombine] Simplify BSwap demanded bits code a little. NFC
ClosedPublic

Authored by craig.topper on Jan 20 2022, 9:48 AM.

Details

Summary

Use alignDown instead of &= ~7.

Replace ResultBit with NLZ. (BitWidth - NLZ - NTZ == 8) so
(BitWidth - NTZ - 8 == NLZ).

Diff Detail

Event Timeline

craig.topper created this revision.Jan 20 2022, 9:48 AM
craig.topper requested review of this revision.Jan 20 2022, 9:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 20 2022, 9:48 AM
spatel accepted this revision.Jan 20 2022, 10:34 AM

LGTM

llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
805–810

Spacing/indentation look wrong (clang-format).

This revision is now accepted and ready to land.Jan 20 2022, 10:34 AM
This revision was landed with ongoing or failed builds.Jan 20 2022, 10:45 AM
This revision was automatically updated to reflect the committed changes.