[PATCH] D140789: [SLP] Unify GEP cost modeling for load, store and GEP nodes.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 3 09:22:23 PST 2023


ABataev added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:6893-6898
+      // When GEP used more than once it won't be removed after vectorization
+      // (should we check that all uses are inside vec tree instead?).
+      // GEPs with all constant indices also considered to have zero cost.
+      // TODO: it is target dependent, so need to implement and then use a TTI
+      // interface.
+      if (Ptr && Ptr->hasOneUse() && !Ptr->hasAllConstantIndices())
----------------
If pointer has multiple uses, it still will be vectorized + added the cost of the external use. I think currently, we still may add the cost of the external use for such geps. Shall we drop Ptr->hasOneUse() for some nodes, like scattervectorize, but not for vector loads/stores?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140789



More information about the llvm-commits mailing list