[PATCH] D113770: [SLP]Improve cost of the gather nodes.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 12 12:22:17 PST 2021


ABataev added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:5570
   auto *VecTy = FixedVectorType::get(ScalarTy, VL.size());
+  bool NeedToShuffle = false;
   // Find the cost of inserting/extracting values from the vector.
----------------
vporpo wrote:
> Could you a comment here mentioning that gathering from constants does not need shuffles? Or perhaps make it more explicit by renaming this variable to GatherFromConstants = true and resetting it if any of the VL elements is not a constant?
It is set not only if the value is not constant but also if the same value was already counter for gathering. Will rename to `DuplicateNonConst`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113770



More information about the llvm-commits mailing list