[PATCH] D95139: [SVE][LoopVectorize] Add support for extracting the last lane of a scalable vector
Sander de Smalen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 2 01:00:51 PST 2021
sdesmalen accepted this revision.
sdesmalen added a comment.
This revision is now accepted and ready to land.
Thanks for all the changes. The patch LGTM with nits addressed.
================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:4297
+ VPLane Lane = VPLane::getFirstLane();
+ Builder.SetInsertPoint(LoopMiddleBlock->getTerminator());
+ if (isa<Instruction>(IncomingValue) &&
----------------
nit: Did you need to move the call to Builder.SetInsertPoint?
================
Comment at: llvm/lib/Transforms/Vectorize/VPlan.cpp:446
++Lane) {
- State->Instance->Lane = Lane;
+ State->Instance->Lane.set(Lane, VPLane::Kind::First);
// Visit the VPBlocks connected to \p this, starting from it.
----------------
nit: it would be nice if you can write `State->Instance->Lane = VPLane(Lane, VPLane::Kind::First);`
(e.g. by providing `VPLane(const VPlane &Other)` in favour of having a `set` method).
================
Comment at: llvm/test/Transforms/LoopVectorize/AArch64/sve-extract-last-veclane.ll:1
+; RUN: opt -loop-vectorize -dce -instcombine -mtriple aarch64-linux-gnu -mattr=+sve -S < %s 2>%t | FileCheck %s
+
----------------
nit: passing the attribute in the command is redundant if it's already set by the IR attributes.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D95139/new/
https://reviews.llvm.org/D95139
More information about the llvm-commits
mailing list