[PATCH] D100570: [LoopVectorize] Prevent multiple Phis being generated with in-order reductions

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 15 08:47:56 PDT 2021


david-arm added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:4292
   for (unsigned Part = 0; Part < UF; ++Part) {
+    if (IsOrdered && Part > 0)
+      break;
----------------
Hi @kmclaughlin, it feels a bit inconsistent that we're not checking for VF.isVector() here, but we do below? Maybe the VF.isVector() check can be folded into the IsOrdered definition above? Or perhaps we can avoid all the extra VF.isVector() checks completely if we move the check into useOrderedReductions?


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:4723
 
+    bool IsOrdered = Cost->isInLoopReduction(cast<PHINode>(PN)) &&
+                     useOrderedReductions(*RdxDesc);
----------------
To be consistent with the other changes above should we add a `&& VF.isVector()` check here too?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100570



More information about the llvm-commits mailing list