[PATCH] D132261: [SLP]Do not reduce repeated values, use scalar red ops instead.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 16 16:32:04 PST 2023


ABataev added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:13100-13103
+    if (VL.empty()) {
+      unsigned Cnt =
+          SameValuesCounter.lookup(TrackedToOrig.find(VectorizedValue)->second);
+      switch (RdxKind) {
----------------
vdmitrie wrote:
> okay :-) that works too
> 
> just a n.i.t. remark: you could reduce arguments to just these if the code was a dedicated method:
> (Value *VectorizedValue, IRBuilderBase &Builder,  ArrayRef<Value *> VL, unsigned Cnt)
> 
> 
> 
It is not possible, both SameValuesCounter and TrackedToOrig are used for each elements of VL in the second switch to build correct constant vector.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132261



More information about the llvm-commits mailing list