[PATCH] D119536: [SLP] Extract intermediate insertelement for external use

Anton Afanasyev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 12 01:38:45 PST 2022


anton-afanasyev marked an inline comment as done.
anton-afanasyev added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:5690-5711
     if (!isa_and_nonnull<InsertElementInst>(EU.User) &&
         !ExtractCostCalculated.insert(EU.Scalar).second)
       continue;
 
     // Uses by ephemeral values are free (because the ephemeral value will be
     // removed prior to code generation, and so the extraction will be
     // removed as well).
----------------
ABataev wrote:
> What if the same insertelement is used in several users? Would not we miss some cost here?
Why? See line 5924 above, "We only add extract cost once for the same scalar", comment states.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119536



More information about the llvm-commits mailing list