llvm / llvm/llvm-project

[VPlan] Support symbolic stride replacement in convertToStridedAccesses

Open
#207,175 0 comments 0 reactions 0 assignees View on GitHub
vectorizers
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.