[PATCH] D116928: [LoopVectorize] Support epilogue vectorisation of loops with reductions

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 13 07:48:10 PST 2022


david-arm added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:8273
+
+  for (PHINode *Phi : PhisInBlock) {
+    Phi->replaceIncomingBlockWith(
----------------
kmclaughlin wrote:
> david-arm wrote:
> > nit: Is it possible to merge these two for loops together into one, i.e.
> > 
> >   for (PHINode &Phi : VecEpilogueIterationCountCheck->phis()) {
> Hi @david-arm, I found that when I tried to use one loop here as you've suggested, that the bc.merge.rdx phis for loops with more than one reduction were not all updated correctly. When I added the test with a loop containing two reductions, the second reduction was not updated and moved to the preheader.
Ah ok, I suspect that `VecEpilogueIterationCountCheck->phis()` is perhaps being changed by code in this loop, which requires you to take a snapshot.


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

https://reviews.llvm.org/D116928



More information about the llvm-commits mailing list