[PATCH] D88962: [SVE] Add support for scalable vectors in vectorize_width loop attribute
David Sherwood via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 7 06:13:47 PDT 2020
david-arm created this revision.
david-arm added reviewers: sdesmalen, ctetreau, paulwalker-arm, kmclaughlin.
Herald added subscribers: llvm-commits, psnobl, hiraditya, tschuett.
Herald added a reviewer: efriedma.
Herald added a project: LLVM.
david-arm requested review of this revision.
In this patch I have added support for a new variant of the
vectorize_width loop attribute that essentially takes an ElementCount
instead of a vectorization factor. If a user wants to instruct the
compiler to vectorize a loop with scalable vectors they can now do
this as follows:
br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !2
...
!2 = !{!2, !3}
!3 = !{!"llvm.loop.vectorize.width", !4}
!4 = !{i32 8, i32 0}
where the ElementCount (!4 in the example above) has two parameters.
The first parameter is the vectorization factor and the second is the
scalable vector flag, where 0==fixed width and 1==scalable.
For backwards compatibility we still support using vectorize_width
with a single integer argument and in this case defaults to fixed width
vectorization.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D88962
Files:
llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h
llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/test/Transforms/LoopVectorize/metadata-width.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88962.296653.patch
Type: text/x-patch
Size: 12124 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201007/27b49d2e/attachment.bin>
More information about the llvm-commits
mailing list