[llvm] [VPlan] Use pointer index type for stride in convertToStridedAccesses (PR #199647)

Mel Chen via llvm-commits llvm-commits at lists.llvm.org
Thu May 28 02:37:22 PDT 2026


Mel-Chen wrote:

> > StrideInBytes was created using the canonical IV type, which can be a narrow type (e.g. i32 on RV64). This caused illegal type promotion in SelectionDAG and an assertion failure in PromoteIntegerOperand when CSE merged two vp.strided.load nodes with different stride types.
> 
> this sounds like something the IR verifier should also catch? The current explanation makes it sound like the IR is correct (not rejected by verifier)?

Sorry for the confusion. The original description was a bit misleading, so I've updated it. Fundamentally, any integer type for the stride argument is valid LLVM IR, and the backend bug has already been fixed.

If we want extra verification, I can add an assertion directly in the VPWidenMemIntrinsicRecipe constructor to check that the stride argument type != index type. What do you think?

https://github.com/llvm/llvm-project/pull/199647


More information about the llvm-commits mailing list