[RISCV][LegalizeTypes] Try to expand BITREVERSE before promoting if the promoted...
authorCraig Topper <craig.topper@sifive.com>
Mon, 15 Feb 2021 20:33:14 +0000 (12:33 -0800)
committerCraig Topper <craig.topper@sifive.com>
Mon, 15 Feb 2021 20:33:16 +0000 (12:33 -0800)
commiteb75f250feb6822d57be95e8535e28724cde6e9d
tree6cf9be624de6923f861d5f485df5d913783a57dd
parentc2123a82cd0076c548d2b8c2acc14408681d7f89
[RISCV][LegalizeTypes] Try to expand BITREVERSE before promoting if the promoted BITREVERSE would expand anyway.

If we're going to end up expanding anyway, we should do it early
so we don't create extra operations to handle the bytes added by
promotion.

Simlilar was done for BSWAP previously.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D96681
llvm/include/llvm/CodeGen/TargetLowering.h
llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
llvm/test/CodeGen/RISCV/rv32Zbp.ll
llvm/test/CodeGen/RISCV/rv64Zbp.ll