[PATCH] D132590: [SLP] Try to match reductions first in a vector build sequence.

Valeriy Dmitriev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 25 10:18:50 PDT 2022


vdmitrie added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:11948-11952
+    SmallVector<Value *, 16> BuildVectorOpds;
+    SmallVector<Value *, 16> BuildVectorInsts;
+    if (!findBuildAggregate(I, TTI, BuildVectorOpds, BuildVectorInsts))
+      continue;
+
----------------
ABataev wrote:
> I think you're doing it too early, need to do it after the vectorizeHorReduction, which should start with I, otherwise we may miss single insertelement instruction which has reduction.
You probably meant to make another call to vectorizeHorReduction if we did not match a vector build. I'll try to reproduce the situation you described in a test case.



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132590



More information about the llvm-commits mailing list