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

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 21 15:27:54 PDT 2020


ABataev 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)
----------------
dtemirbulatov wrote:
> 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.
Yeah, maybe. But you van do something similar, like 
```
InsertCost += ...
break;
```
instead of setting flag and do a check after the loop.


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

https://reviews.llvm.org/D57779



More information about the llvm-commits mailing list