[RISCV] Use reduction result type for EXTRACT_VECTOR_ELT in lowerReductionSeq.
authorCraig Topper <craig.topper@sifive.com>
Tue, 13 Dec 2022 17:09:42 +0000 (09:09 -0800)
committerCraig Topper <craig.topper@sifive.com>
Tue, 13 Dec 2022 17:10:36 +0000 (09:10 -0800)
commitbee9a92aec07db15f7ec89278c381654d60e4d02
treec34bc6b9db769ab7e3c2eabdad5b93eaa4dfb222
parent844430bcc3778094ac0e0dd085062809b7f6d666
[RISCV] Use reduction result type for EXTRACT_VECTOR_ELT in lowerReductionSeq.

Remove the call to getSExtOrTrunc.

Reduction ISD nodes produce a scalar result and that result is
allowed to be larger than the vector element type due to type
legalization. This is the same rule we allow for EXTRACT_VECTOR_ELT
for the same reason.

We can copy the result type over from the reduction node to
EXTRACT_VECTOR_ELT.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D139757
llvm/lib/Target/RISCV/RISCVISelLowering.cpp