[PATCH] D82444: [SLP] Make sure instructions are ordered when computing spill cost.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 25 05:52:28 PDT 2020


fhahn marked an inline comment as done.
fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:3769-3778
+  SmallVector<Instruction *, 16> OrderedScalars;
   for (const auto &TEPtr : VectorizableTree) {
     Instruction *Inst = dyn_cast<Instruction>(TEPtr->Scalars[0]);
     if (!Inst)
       continue;
+    OrderedScalars.push_back(Inst);
+  }
----------------
ABataev wrote:
> Can we use a `set` instead of the vector with sort? 
We could use `set` with dominates() as comparator I think. I am not sure if there would be a benefit of doing so for the use locally in the function, but maybe we could use it to keep VectorizableTree in order to start with? Not entirely sure what impact that would have at other places, but it might be worth exploring as follow-up?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82444





More information about the llvm-commits mailing list