[llvm] [LV] Use original trip-count as the vector-trip-count if use predicated EVL instructions for tail-folding. (PR #132675)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 31 04:34:52 PDT 2025


alexey-bataev wrote:

> > I thought the consensus is that we want to keep canonical IV alive through the entire duration of loop vectorizer. And that's exactly why I chose to add a Pass right after LV to replace canonical IV with EVL IV in #131005
> 
> I understand but why we should keep the canonical IV? I did a similar change based on llvm-epi and haven't encounter any problem yet.


It is by design. The proposed solution was discussed already long time ago, and it was agreed that the vectorized loop should keep the canonical ("countable") loop form. Our initial implementation was also based on a similar solution, but after the discussion transitioned to the existing approach

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


More information about the llvm-commits mailing list