[RISCV] Make sure we use LMUL=1 for scalar reduction input in combineBinOpToReduce
authorCraig Topper <craig.topper@sifive.com>
Thu, 12 Jan 2023 00:24:23 +0000 (16:24 -0800)
committerCraig Topper <craig.topper@sifive.com>
Thu, 12 Jan 2023 00:24:23 +0000 (16:24 -0800)
commitc6b38f491fb22eb5705bf30fed1ce4a14416e8fe
treef66601a36cb915672f5908fcc2bea540052ffe3b
parentd114dfba2dc4187bd9b98291963e64706acab6b5
[RISCV] Make sure we use LMUL=1 for scalar reduction input in combineBinOpToReduce

We might have looked through an INSERT_SUBVECTOR to find the
vmv.s.x or vfmv.s.f. If we did the ScalarV type is no longer LMUL=1.
We need to add a new INSERT_SUBVECTOR to restore it before
creating the new reduction.

While there, use the same debug location for all of the newly created
nodes. I believe we were using multiple debug locations from the
original nodes, but changing their relative order. I don't think
we're supposed to do that.
llvm/lib/Target/RISCV/RISCVISelLowering.cpp