[RISCV] Enable isTruncateFree in SDAG for i64->i32 on rv64.
authorCraig Topper <craig.topper@sifive.com>
Mon, 15 Aug 2022 15:32:22 +0000 (08:32 -0700)
committerCraig Topper <craig.topper@sifive.com>
Mon, 15 Aug 2022 15:32:51 +0000 (08:32 -0700)
commit7a73ab5818a1e9d849efdbccd5e3181356612d05
tree5ab9c512e533f61113846dc1c57450c23e82aec9
parentef8c34e9543bcf33175f6e5007f4f1150f8bcb96
[RISCV] Enable isTruncateFree in SDAG for i64->i32 on rv64.

We have a good selection of W instructions, so promoting a truncated
value back to i64 is often free.

This appears to be a net code size reduction on SPECINT2006.

This has been split from D130397 as one of the patches needed to
complete that.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D131819
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-masked-scatter.ll
llvm/test/CodeGen/RISCV/trunc-free.ll [new file with mode: 0644]