[PATCH] D95245: [SVE] Add support for scalable vectorization of loops with int/fast FP reductions

Kerry McLaughlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 3 08:23:57 PST 2021


kmclaughlin added inline comments.


================
Comment at: llvm/include/llvm/Analysis/TargetTransformInfo.h:1310
+  /// \returns True if it is legal to vectorize the given reduction kind.
+  bool isLegalToVectorizeReduction(RecurKind RecKind, bool Scalable) const;
+
----------------
dmgreen wrote:
> Does this need to check the type? Does an i128 reduction work, for example?
> 
> I presume if a <vscale x 4 x float> reduction works then any <vscale x ? x float> will work?
Hi @dmgreen, thanks for taking a look at this!
I've added a check of the recurrence type to isLegalToVectorizeReduction. I think any <vscale x ? x float> reduction will work, I added some tests for legalization of vector reductions as part of D93050.


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

https://reviews.llvm.org/D95245



More information about the llvm-commits mailing list