If we're inserting a fixed length subvector into a fixed length vector,
then we can use a tail agnostic policy as long as we're inserting up to
or past the end of the main vector.
I.e., because we're overwriting all of the main vector's tail elements,
and we don't care what the elements after that are.
As noted by Philip in https://reviews.llvm.org/D146711#4220341
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
6669 | Can EndIndex ever be > than VecVT.getVectorNumElements()? |
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
6669 | Would cases like insert_subvector a:v4i8, b:v2i8, 3:i32 reach here? Not sure if this is legal, but I thought EndIndex here would be 2+3=5 |
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
6669 | I think the insertion index must be a multiple of the known minimum length of the subvector. |
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
6669 | Ah you're right, that makes sense. I put in an assert to see if EndIndex > VecVT.getVectorNumElements() ever triggers, and it doesn't seem to. |
Update test case that resides outside of rvv and account for the fact that EndIndex can never be > VecVT.getNumberOfElements()
Can EndIndex ever be > than VecVT.getVectorNumElements()?