This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Custom legalize bswap/bitreverse to GREVI with Zbp extension to enable them to combine with other GREVI instructions
ClosedPublic

Authored by craig.topper on Nov 27 2020, 6:32 PM.

Details

Summary

This enables bswap/bitreverse to combine with other GREVI patterns or each other without needing to add more special cases to the DAG combine or new DAG combines.

I've also enabled the existing GREVI combine for GREVIW so that it can pick up the i32 bswap/bitreverse on RV64 after they've been type legalized to GREVIW.

Diff Detail