[llvm] [VPlan] Expand affine AddRecs to VPInstructions (PR #209921)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 16 02:43:55 PDT 2026


artagnon wrote:

> > Ah, some of them are within the vector-loop-region, like in strided-accesses.ll,
> 
> Are you sure? I don't think we expand the AddRec of the vector loop; the start or stride is an AddRec, but it should be an AddRec of the parent loop.Please take a look at the expansion, I don't think it is correct at the moment? Previously it was invariant, now it is loop variant?

Ah yes, there is a miscompile from using the wrong CanonicalIV: strided-accesses.ll should be re-using the CanonicalIV

```llvm
[[IND_INCOMING:%.*]] = phi i64 [ 0, %[[ENTRY]] ], [ [[IND_INCOMING_NEXT:%.*]], %[[EXIT:.*]] ]
```

... which would be a VPIRPhi. I think it's worth digging out the VPIRPhi from the AR's loop though, and we wouldn't have to rely on IR expansion?

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


More information about the llvm-commits mailing list