HomePhabricator

[RISCV] Custom type legalize i32 bswap/bitreverse to GREVIW on RV64 with Zbp…

Authored by craig.topper on Nov 20 2020, 10:29 AM.

Description

[RISCV] Custom type legalize i32 bswap/bitreverse to GREVIW on RV64 with Zbp extension

Previously we required a sra to pattern match these properly in isel. If the consumer didn't need the result sign extended we'll have an srl instead of sra and fail to match.

This patch switches to custom legalizing to GREVIW using portions of D91259.

Differential Revision: https://reviews.llvm.org/D91457