[llvm] [LoopVectorize] Add support for vectorisation of more early exit loops (PR #88385)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 11 01:28:08 PDT 2024


david-arm wrote:

> > I may be able to move mayFault, but it does depend upon structures built up by LoopAccessAnalysis and I personally thought that this function might be useful outside of the vectoriser so it wasn't obvious where to move it to.
> 
> One place that might be worth looking at is https://github.com/llvm/llvm-project/blob/main/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp#L1343. `isDereferenceableAndAlignedInLoop` already has some logic to check if an access is dereferenceable across all loop iterations, it may be able to replace parts of the current `mayFault` implementation?

OK thanks for the info. At the moment I've moved it into the LoopInfo class because it's specific to loops and I thought it was potentially useful outside of the vectoriser. You still have to record all of the underlying objects that were collected by LoopAccessAnalysis and pass those in. It seems the only real benefit for moving this code outside of LoopAccessAnalysis (which already has all the information we need) is to make it more generally available to all, rather than tying it to the vectoriser. What do you think?

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


More information about the llvm-commits mailing list