[PATCH] D98435: [LoopVectorize] Add strict in-order reduction support for fixed-width vectorization

Kerry McLaughlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 24 08:25:25 PDT 2021


kmclaughlin added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:4260
+    if (IsInLoopReductionPhi && useOrderedReductions(RdxDesc) &&
+        State.VF.getKnownMinValue() > 1)
+      Val = State.get(State.Plan->getVPValue(LoopVal), UF - 1);
----------------
david-arm wrote:
> dmgreen wrote:
> > Can this use isScalar(), or is it to handle scalable single items too?
> > 
> > We generate multiple phi's, but only use the first one? The others get DCE'd?
> Yes, I think in this case we can just use
> 
>   State.VF.isVector()
> 
> since that also covers the case when VF=(1,scalable)
Yes, we generate multiple phis and the unused phis are removed by InstCombine.

Changed this to use `State.VF.isVector()` as suggested above.


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

https://reviews.llvm.org/D98435



More information about the llvm-commits mailing list