[VPlan] Support symbolic stride replacement in convertToStridedAccesses
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
`@double_stride_ptr_iv` in `llvm/test/Transforms/LoopVectorize/RISCV/strided-accesses.ll` is a test case where a gather cannot be converted into a strided load.
The root cause seems to be that `replaceSymbolicStrideSCEV` in `LoopAccessInfo` is able to leverage loop versioning assumptions, which allows certain non-constant strides to be treated as constant-stride accesses. However, because `VPlanTransforms::convertToStridedAccesses` does not currently apply `replaceSymbolicStrideSCEV`, the stride is evaluated as non-constant, preventing the transformation into a strided load.
Contributor guide
Research direction
Start with llvm/test/Transforms/LoopVectorize/RISCV/strided-accesses.ll, especially @double_stride_ptr_iv, and trace VPlanTransforms::convertToStridedAccesses alongside LoopAccessInfo::replaceSymbolicStrideSCEV. Check how loop versioning assumptions affect the stride evaluation. Done means the symbolic stride is recognized so the gather can be converted into a strided load, with the relevant test passing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100