[PATCH] D102394: [LoopVectorize] Don't attempt to widen certain calls for scalable vectors
David Sherwood via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 13 04:53:13 PDT 2021
david-arm created this revision.
david-arm added reviewers: sdesmalen, CarolineConcatto, kmclaughlin, bsmith, spatel.
Herald added subscribers: hiraditya, kristof.beyls.
david-arm requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
When attempting to vectorise a loop containing a call to the following
intrinsic
tail call fast float @llvm.sin.f32(float %0)
we then crashed in tryToWidenCall because we don't have scalable vector
versions of these intrinsics and we also cannot scalarise them. Rather
than rely on the cost model returning Invalid for such cases we should
be explicitly rejecting scalable vectorisation upfront.
This patch adds a new TTI interface called isLegalVectorIntrinsic that
checks if it is legal to vectorise a particular intrinsic. We then
walk through all calls in the loop ensuring they are legal - if not
we return a zero VF from LoopVectorizationCostModel::getMaxLegalScalableVF.
Tests have been added here:
Transforms/LoopVectorize/AArch64/scalable-call.ll
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D102394
Files:
llvm/include/llvm/Analysis/TargetTransformInfo.h
llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
llvm/lib/Analysis/TargetTransformInfo.cpp
llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/test/Transforms/LoopVectorize/AArch64/scalable-call.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102394.345088.patch
Type: text/x-patch
Size: 11147 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210513/fac2be68/attachment.bin>
More information about the llvm-commits
mailing list