[llvm] [RISCV][SelectionDAG] Sign extend splats of i32 in getConstant on RV64 (PR #67027)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 22 09:02:38 PDT 2023


topperc wrote:

> > > This seems reasonable, but I'd like a second opinion from someone more knowledgeable. Maybe @topperc?
> 
> > 
> 
> > I'm not opposed to this patch.
> 
> > 
> 
> > The other thought I have would be to add all of the vector .vx pseudoinstructions to hasAllNBitUsers in RISCVISelDAGToDAG.cpp. When we do constant materialization we call that to see if the upper bits of the immediate are used.
> 
> 
> 
> Would we would need a way to tell if the user is being used as a "element" operand in the pseudo, e.g. so we don't assume the x in vslidedown.vx is truncated to SEW?

Yes but that's already something that function does for other instructions. For example the pointer operand of the scalar store SW demands all bits but the data operand only demands the lower 32 bits.

https://github.com/llvm/llvm-project/pull/67027


More information about the llvm-commits mailing list