[RISCV][LegalizeTypes] Try to expand BSWAP before promoting if the promoted BSWAP...
authorCraig Topper <craig.topper@sifive.com>
Sun, 31 Jan 2021 06:38:06 +0000 (22:38 -0800)
committerCraig Topper <craig.topper@sifive.com>
Sun, 31 Jan 2021 22:33:29 +0000 (14:33 -0800)
commit70289ea6f591bd39c631f1eee3e6f2622fbc1d46
tree119fb9cd2afac06fe501996d521dfca490913afa
parent2eb5f3454212aa906388013e6807a7a906233f18
[RISCV][LegalizeTypes] Try to expand BSWAP before promoting if the promoted BSWAP 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.

This is helfpul on RISCV where we might have to promote i16 all
the way to i64.

Differential Revision: https://reviews.llvm.org/D95756
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/bswap-ctlz-cttz-ctpop.ll
llvm/test/CodeGen/RISCV/rv64Zbb.ll
llvm/test/CodeGen/RISCV/rv64Zbp.ll