[PATCH] D99294: [VPlan] Representing backedge def-use feeding reduction phis.

Ayal Zaks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 27 13:28:21 PDT 2021


Ayal accepted this revision.
Ayal added a comment.
This revision is now accepted and ready to land.

Adding a couple of related thoughts. Thanks!



================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:8687
+    assert(IncR->getNumDefinedValues() == 1);
+    R->addOperand(IncR->getVPValue(0));
+  }
----------------
while we're here: it may be useful to have a "getVPSingleValue()" which would take care of the assert (and the redundant 0)? In any case, the assert deserves an error message.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:8802
+          Phi->getIncomingValueForBlock(OrigLoop->getLoopLatch())));
+      return toVPRecipeResult(PhiRecipe);
     }
----------------
while we're here: the use of toVPRecipeResult() and VPRecipeOrVPValueTy, if intended to solve D44800 Blend issue only, seem like an overkill - BlendRecipe pass-throughs a single-operand phi, having a full (null) mask; so it should be easy(ier) to have it pass-through an(y) operand also for a phi having multiple identical operands. I.e., tryToBlend() can always return a VPRecipe. Better to discuss this on a related review, if there is one available?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99294



More information about the llvm-commits mailing list