[PATCH] D149627: [NFC][SLP] Cleanup: Simplify traversal loop in SLPVectorizerPass::vectorizeHorReduction().

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 2 15:39:56 PDT 2023


ABataev added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:14083
+        if (!FutureSeed)
+          break;
       }
----------------
vporpo wrote:
> ABataev wrote:
> > vporpo wrote:
> > > ABataev wrote:
> > > > Why break here?
> > > This can only happen if Inst is the root node and at this point `Stack` is empty so it effectively breaks out of the loop, so it is better to be explicit about it.
> > Add an `assert(Stack.empty())` here and check with at least Spec that it does not crash
> I checked with Spec 2017 and our presubmit tests and Stack is always empty.
Add the assert here


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149627



More information about the llvm-commits mailing list