We could use vmv.v.i/vmv.v.x whose eew is 32 to lower the i64 splat vector if the i64 constant scalar could be splitted into two same i32 scalar.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
2230 | I may be missing something, but isn't VT.getVectorNumElements problematic with scalable vector types? I'm surprised this doesn't warn/crash. Also I'm not sure whether this method should assume that VT is scalable. Should it be able to produce a fixed-vector type if passed one? |
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
2230 |
Assuming scalable is ok. Other parts of this code are creating _VL nodes which must use a scalable type. | |
2230 |
It happens to work because of a FIXME in getVectorNumElements(). It just returns getVectorMinNumElements(). This code should use MVT::getVectorVT(MVT::i32, 2 * VT.getVectorElementCount()) I think |
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
2230 | I've resolved the FIXME so this should fail now. |
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
2229 | Can this be MVT::getVectorVT(MVT::i32, 2 * VT.getVectorElementCount()) as I wrote in my previous comment. If not please tell me why not. |
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
2229 | It can not, because the return type of getVectorElementCount is ElementCount, and the operator * is not overloaded for it. |
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
2229 | VT.getVectorElementCount() * 2 work? I think the operator overload is there but maybe not symmetric. |
Address comment.
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
2229 | Yes, you are right. Thanks a lot. |
auto doesn't add anything here. It's more characters than MVT