[RISCV] Custom legalize bswap/bitreverse to GREVI with Zbp extension to enable them...
authorCraig Topper <craig.topper@sifive.com>
Mon, 30 Nov 2020 16:14:30 +0000 (08:14 -0800)
committerCraig Topper <craig.topper@sifive.com>
Mon, 30 Nov 2020 16:30:40 +0000 (08:30 -0800)
commit76d1026b59bd04bd31645ab37dd82d1d89daa6d9
treee81450a28745929d4ff513d574f741f6ccb7f82b
parent589e10f8586e45ebe9b6409dd29d62f2f40ab52f
[RISCV] Custom legalize bswap/bitreverse to GREVI with Zbp extension to enable them to combine with other GREVI instructions

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.

Differential Revision: https://reviews.llvm.org/D92253
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/lib/Target/RISCV/RISCVInstrInfoB.td
llvm/test/CodeGen/RISCV/rv32Zbp.ll
llvm/test/CodeGen/RISCV/rv64Zbp.ll