[PATCH] D112467: [SLP]Do not reorder reduction nodes.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 25 15:32:07 PDT 2021


ABataev added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:2823
 
-void BoUpSLP::reorderBottomToTop() {
+void BoUpSLP::reorderBottomToTop(bool FreeReorder) {
   SetVector<TreeEntry *> OrderedEntries;
----------------
RKSimon wrote:
> Is FreeOrder the right name? Its suggests a cost but AFAICT this really just says that the final order is irrelevant/unecessary?
Any better suggestions? The idea that if this is set to true, we do no need to reorder the root node of the tree/graph.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:8472
       V.reorderTopToBottom();
-      V.reorderBottomToTop();
+      V.reorderBottomToTop(/*FreeReorder=*/true);
       V.buildExternalUses(ExternallyUsedValues);
----------------
RKSimon wrote:
> Is this always true for float reductions? Doesn't it need the 'reassoc' flag?
We support reductions only with at least `reassoc`, so it is always `true`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112467



More information about the llvm-commits mailing list