[AArch64][LoopVectorize] Disable tail-folding for SVE when loop has interleaved accesses
authorDavid Sherwood <david.sherwood@arm.com>
Mon, 18 Jul 2022 09:36:11 +0000 (10:36 +0100)
committerDavid Sherwood <david.sherwood@arm.com>
Tue, 2 Aug 2022 08:52:33 +0000 (09:52 +0100)
commit4ef9cb6c170a00a06be39e40a1fad361d244280f
tree7b589bffa145f691659f96d81ccdcb18bd5a3845
parent5ad59c9e594dba82f8ef630ae56d68dc8d47834b
[AArch64][LoopVectorize] Disable tail-folding for SVE when loop has interleaved accesses

If we have interleave groups in the loop we want to vectorise then
we should fall back on normal vectorisation with a scalar epilogue. In
such cases when tail-folding is enabled we'll almost certainly go on to
create vplans with very high costs for all vector VFs and fall back on
VF=1 anyway. This is likely to be worse than if we'd just used an
unpredicated vector loop in the first place.

Once the vectoriser has proper support for analysing all the costs
for each combination of VF and vectorisation style, then we should
be able to remove this.

Added an extra test here:

  Transforms/LoopVectorize/AArch64/sve-tail-folding-option.ll

Differential Revision: https://reviews.llvm.org/D128342
llvm/include/llvm/Analysis/TargetTransformInfo.h
llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
llvm/include/llvm/Analysis/VectorUtils.h
llvm/include/llvm/CodeGen/BasicTTIImpl.h
llvm/lib/Analysis/TargetTransformInfo.cpp
llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h
llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
llvm/lib/Target/ARM/ARMTargetTransformInfo.h
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/test/Transforms/LoopVectorize/AArch64/sve-tail-folding-option.ll