[PATCH] D57779: [SLP] Add support for throttling.
Dinar Temirbulatov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 10 02:17:49 PDT 2020
dtemirbulatov marked 5 inline comments as done.
dtemirbulatov added inline comments.
================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:4108-4111
+ int i = 0;
+ for (auto It = Vec.begin(), E = Vec.end(); It != E; ++It, i++)
+ if (i>MaxCostsRecalculations)
+ Vec.erase(It);
----------------
ABataev wrote:
> Just `Vec.erase(Vec.rbegin(), Vec.rbegin() + (Vec.size() - MaxCostsRecalculations)`?
No, We could not use "Vec.rbegin() + " with std::set.
================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:7259
+ Throttling = true;
+ Cost = V.getTreeCost() + ReductionCost;
+ }
----------------
ABataev wrote:
> Looks like you missed compare ща `Cost` with `-SLPCostThreshold` here. You vectorized the tree after throttling unconditionally. Plus, the `Cost` is calculated here, but not used later except for the debug prints.
we don't need need to compare here, this is done inside findSubTree().
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D57779/new/
https://reviews.llvm.org/D57779
More information about the llvm-commits
mailing list