This is an archive of the discontinued LLVM Phabricator instance.

[SelectionDAG][RISCV] Teach getNode to fold bswap(bswap(x))->x.
ClosedPublic

Authored by craig.topper on Jan 23 2022, 1:55 PM.

Details

Summary

This can show up during when bitreverse is expanded to bswap and
swap of bits within a byte. If the input is already a bswap, we
should cancel them out before we further transform them in a way
that makes it harder to see the redundancy.

Diff Detail