[llvm] [VPlan] EVL transform VPVectorEndPointerRecipe alongisde load/store recipes. NFC (PR #152542)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 18 01:56:24 PDT 2025


lukel97 wrote:

> I’ve been thinking about it, and the real reason for replacing VPVectorEndPointerRecipe addr, VF with ..., EVL seems to come from the fact that the mask is reversed. The vp intrinsics can’t represent computing EVL lanes starting from the last lane backward, which is what drives the need for this series of transformations.

Yes, that's my understanding as well. 

> So I think we should first confirm that the VPWidenMemoryRecipe is a reverse access, and then apply further transformations to its operands (such as transforming the VPVectorEndPointerRecipe).

I've added an assert for this in c2bb610b67302a6d78e52e48b9cd4643e221972e. I think alongside #146525, this means we can start to split the transform up into more specific ones like:

```
   (load ptr, header-mask)
   ->
   (vp.load ptr, all-true, evl)
   
   (reverse (load (end-ptr p, vf), (reverse header-mask)))
   ->
   (vp.reverse (vp.load (end-ptr p, evl), all-true, evl), evl)
```


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


More information about the llvm-commits mailing list