[SelectionDAG][RISCV] Make RegsForValue::getCopyToRegs explicitly zero_extend constants.
authorCraig Topper <craig.topper@sifive.com>
Sat, 19 Mar 2022 01:33:30 +0000 (18:33 -0700)
committerCraig Topper <craig.topper@sifive.com>
Sun, 20 Mar 2022 01:43:14 +0000 (18:43 -0700)
commit4eb59f017903c8b70b5c5aad892bdc73516a6766
tree8aa26511e7dfad1931bb31e2d87c387151bf7ef0
parent268371cf7b9f6fd3b9320564f1abd3615eecd2e8
[SelectionDAG][RISCV] Make RegsForValue::getCopyToRegs explicitly zero_extend constants.

ComputePHILiveOutRegInfo assumes that constant incoming values to
Phis will be zero extended if they aren't a legal type. To guarantee
that we should zero_extend rather than any_extend constants.

This fixes a bug for RISCV where any_extend of constants can be
treated as a sign_extend.

Differential Revision: https://reviews.llvm.org/D122053
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/test/CodeGen/RISCV/aext-to-sext.ll