[PATCH] D57779: [SLP] Add support for throttling.

Dinar Temirbulatov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 21 15:23:20 PDT 2020


dtemirbulatov added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:4101-4108
+    for (Value *V : Entry->Scalars) {
+      auto *Inst = cast<Instruction>(V);
+      if (llvm::any_of(Inst->users(), [this](User *Op){ return Tree->ScalarToTreeEntry.count(Op) > 0; })) {
+          NeedGather = true;
+      }
+    }
+    if (NeedGather)
----------------
ABataev wrote:
> Just:
> ```
>     for (Value *V : Entry->Scalars) {
>       auto *Inst = cast<Instruction>(V);
>       if (llvm::any_of(Inst->users(), [this](User *Op){ return Tree->ScalarToTreeEntry.count(Op) > 0; }))
>           return InsertCost + getEntryCost(Entry);
>     }
> 
> ```
> Also, check code formatting
hmm, I think this is not a correct suggestion, there might be several tree entries with  TreeEntry::ProposedToGather status and we have to calculate Insert cost for the whole tree here.


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

https://reviews.llvm.org/D57779



More information about the llvm-commits mailing list