[PATCH] D95139: [SVE][LoopVectorize] Add support for extracting the last lane of a scalable vector

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 2 01:15:10 PST 2021


fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:1107
+/// Return the runtime value for VF.
+Value *getRuntimeVF(IRBuilder<> &B, Type *Ty, ElementCount VF) {
+  Constant *EC = ConstantInt::get(Ty, VF.getKnownMinValue());
----------------
It looks like this is only used in `llvm/lib/Transforms/Vectorize/VPlan.cpp` in this patch? Should it be defined directly there? If it needs to be shared between multiple files it would probably be better to just put the declaration into a header?


================
Comment at: llvm/test/Transforms/LoopVectorize/extract-last-veclane.ll:55
+
+!0 = distinct !{!0, !1, !2, !3, !4, !5}
+!1 = !{!"llvm.loop.mustprogress"}
----------------
Is there reason to use the metadata here? Can we instead just use the `-force-vector-width` option, which should be a bit simpler and the expected VF is clear from the run line?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D95139/new/

https://reviews.llvm.org/D95139



More information about the llvm-commits mailing list