This is an archive of the discontinued LLVM Phabricator instance.

[DAGCombine][RISCV] Fold (bitreverse (srl X, C)) -> (shl (bitreverse X), C) if X is a bswap.
AbandonedPublic

Authored by craig.topper on Feb 28 2022, 10:05 AM.

Details

Summary

This brings the bswap and bitrevserse together which can enable
more simplifications if the bitreverse needs to be expanded.

This improves the same test cases as D120648, but I think this
improvement is better as it gives a shift pair after the brev8
which could be a zext.h or zext.w if they were enabled in the test.

Diff Detail