[PATCH] D144770: [SLP] Outline GEP chain cost modeling into new TTI interface - NFCI.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 1 08:48:21 PST 2023


ABataev added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:7161
+    // loads/stores are known to be from/to adjacent locations.
+    if (isa<LoadInst, StoreInst>(VL0)) {
+      // Case 2: estimate costs for pointer related costs when vectorizing to
----------------
vdmitrie wrote:
> ABataev wrote:
> > What if it is scatter vectorize node? VL0 still should be LoadInst.
> We do not call this routine for scatter vectorize loads node. We did that in the past but that was a bug (since we evaluated GEPs twice as the result). For scatter vectorize we evaluate GEPs only when calculating cost for tree node that correspond to pointer operands of the loads. The comment above explains exactly that distinction.
Could you add an assertion for the expected cases? Like ScatterVectorize is not expected, etc.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144770



More information about the llvm-commits mailing list