[PATCH] D101836: [LoopVectorize] Enable strict reductions when allowReordering() returns false

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 5 08:17:56 PDT 2021


david-arm added inline comments.


================
Comment at: llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h:146
     return getForce() == LoopVectorizeHints::FK_Enabled ||
-           EC.getKnownMinValue() > 1;
+           (EC.isNonZero() && !EC.isScalar());
   }
----------------
sdesmalen wrote:
> is this change necessary?
It's fixing a missing case where we weren't previously allowing reordering for scalable VF=vscale x 1. I think it's worth fixing, but maybe it doesn't have to live in this patch?


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:9857
 
-  if (!Requirements.canVectorizeFPMath(Hints)) {
+  if (!LVL.canVectorizeFPMath(Hints, EnableStrictReductions)) {
     ORE->emit([&]() {
----------------
sdesmalen wrote:
> You don't need to pass EnableStrictReductions, since it is defined in the same file?
I think it has to be passed since `EnableStrictReductions` lives in LoopVectorize.cpp and canVectorizeFPMath lives in LoopVectorizationLegality.cpp.


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

https://reviews.llvm.org/D101836



More information about the llvm-commits mailing list