[RISCV] Insert a sext_inreg when type legalizing i32 shl by constant on RV64.
authorCraig Topper <craig.topper@sifive.com>
Thu, 26 Aug 2021 16:33:53 +0000 (09:33 -0700)
committerCraig Topper <craig.topper@sifive.com>
Thu, 26 Aug 2021 17:20:19 +0000 (10:20 -0700)
commit1b9417454eda38f27048f9665aedcb6158ce8e9f
tree6883066662d233dee97122d29ea60ffe6fb3b990
parentabb956370ee71d018e9a88ae196f039f6c4e0dae
[RISCV] Insert a sext_inreg when type legalizing i32 shl by constant on RV64.

Similar to what we do for add/sub/mul.

This can help remove some sext.w. There are some regressions on
some bswap tests, but I have an idea how to fix that for a follow up.

A new PACKW pattern is added to handle the new sext_inreg placement.

Differential Revision: https://reviews.llvm.org/D108663
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/lib/Target/RISCV/RISCVInstrInfoB.td
llvm/test/CodeGen/RISCV/alu32.ll
llvm/test/CodeGen/RISCV/bswap-ctlz-cttz-ctpop.ll
llvm/test/CodeGen/RISCV/copysign-casts.ll
llvm/test/CodeGen/RISCV/mul.ll
llvm/test/CodeGen/RISCV/rv64i-exhaustive-w-insts.ll
llvm/test/CodeGen/RISCV/rv64zbb-zbp.ll
llvm/test/CodeGen/RISCV/rv64zbb.ll
llvm/test/CodeGen/RISCV/rv64zbp.ll