[llvm] [Vectorize] Vectorization for __builtin_prefetch (PR #66160)

David Green via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 21 10:15:58 PST 2024


davemgreen wrote:

A couple of high level comments:
 - Is the main idea to make sure that we do vectorize the loop, or are the prefetches important for performance?
 - Under the assumption that prefetching works on cache lines we could consider scalarizing the prefetches instead, so just normal prefetches are emitted.
 - Or alternatively under the assumption that the users often put the prefetches in the wrong place, we could consider just dropping them from the vectorized loop.
 - Having said that, SVE does these instructions so it would make sense to add them.

I think it might make sense to have an initial patch that introduces the intrinsics+langref and adds the codegen support for them - both for genetic targets and for SVE. Once that is in it would make adding tests for vectorization easier.

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


More information about the llvm-commits mailing list