[PATCH] D126885: [SLP]Cost for a constant buildvector.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 3 14:42:40 PDT 2022


ABataev added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:5783
+           E->UserTreeIndices.front().UserTE->isAltShuffle())
+              ? 0
+              : E->UserTreeIndices.front().UserTE->getOpcode();
----------------
vdmitrie wrote:
> Just wondering is that possible for UserTreeIndices to be empty here? AFAIU it can be for root only but constants do not seed vtree.
> if alternate opcodes are for shl/shr but shift value is splat it is still can be immediate for both of them.
> 
1. If constants are reduced values in reduction ops.
2. That's why there is a TODO above.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:5802
+      } else {
+        InstructionCost ScalarCost = 0;
+        for (Value *V : VL) {
----------------
vdmitrie wrote:
> drop it?
What do you mean?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126885



More information about the llvm-commits mailing list