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 | ||
---|---|---|
2219 | 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 | ||
---|---|---|
2219 |
Assuming scalable is ok. Other parts of this code are creating _VL nodes which must use a scalable type. | |
2219 |
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 | ||
---|---|---|
2219 | I've resolved the FIXME so this should fail now. |
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
2218 | 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 | ||
---|---|---|
2218 | 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 | ||
---|---|---|
2218 | VT.getVectorElementCount() * 2 work? I think the operator overload is there but maybe not symmetric. |
Address comment.
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
2218 | Yes, you are right. Thanks a lot. |
clang-format not found in user’s local PATH; not linting file.