This is an archive of the discontinued LLVM Phabricator instance.

[TargetLowering][RISCV][ARM][AArch64][Mips] Reduce the number of AND mask constants used by BSWAP expansion.
ClosedPublic

Authored by craig.topper on Nov 15 2022, 10:41 AM.

Details

Summary

We can reuse constants if we use SRL followed by AND and AND followed by SHL.
Similar was done to bitreverse previously.

Diff Detail

Event Timeline

craig.topper created this revision.Nov 15 2022, 10:41 AM
craig.topper requested review of this revision.Nov 15 2022, 10:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 15 2022, 10:41 AM
efriedma accepted this revision.Nov 15 2022, 1:31 PM

LGTM; seems to help all the testcases, likely to be generally beneficial, and if it somehow hurts some target, that target can always override.

This revision is now accepted and ready to land.Nov 15 2022, 1:31 PM
This revision was landed with ongoing or failed builds.Nov 15 2022, 2:36 PM
This revision was automatically updated to reflect the committed changes.