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

via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 12 21:55:09 PDT 2023


m-saito-fj wrote:

I have created several patches to be able to vectorize loops containing __builtin_prefetch with LoopVectorize in AArch64 and generate SVE prefetch (prfb/prfh/prfw/prfd) instructions.
[All Patches](https://github.com/llvm/llvm-project/compare/main...m-saito-fj:llvm-project:vectorization-builtin-prefetch-aarch64)

This patch is one of them and is mainly for the IR part. In this patch, prefetch intrinsic cannot be vectorized because isLegalMaskedPrefetch returns false by default. Therefore, I have not added a test to this patch.

Tests are attached to other patches. If you want to refer to them, please refer to the following URL.
[Test for masked prefetch](https://github.com/m-saito-fj/llvm-project/blob/vectorization-builtin-prefetch-aarch64/llvm/test/Transforms/LoopVectorize/AArch64/sve-masked-prefetch.ll)
[Test for masked gather prefetch](https://github.com/m-saito-fj/llvm-project/blob/vectorization-builtin-prefetch-aarch64/llvm/test/Transforms/LoopVectorize/AArch64/sve-gather-prefetch.ll)

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


More information about the llvm-commits mailing list