[PATCH] D113774: [SLP]Improve splat detection.

Anton Afanasyev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 15 10:07:17 PST 2021


anton-afanasyev added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:2596
     if (isSplat(Entry->Scalars)) {
       OS << "<splat> " << *Entry->Scalars[0];
       return Str;
----------------
ABataev wrote:
> anton-afanasyev wrote:
> > ABataev wrote:
> > > anton-afanasyev wrote:
> > > > ABataev wrote:
> > > > > anton-afanasyev wrote:
> > > > > > ABataev wrote:
> > > > > > > anton-afanasyev wrote:
> > > > > > > > Change it or just remove?
> > > > > > > Why?
> > > > > > `Entry->Scalars[0]` can be `undef` with this patch, for this case the output is uninformative.
> > > > > Hard to tell, this is still the very first element of the entry.
> > > > Hmm, but why do we output the very first element specially? If `Scalars = { undef, add .., add .., add .. }`, we label this as `<splat> undef`. I would just remove this block at all, since "splat" now doesn't mean what it meant before.
> > > Better to output all the scalars here, I think
> > That's exactly what I mean by removing this if-block which early returns otherwise.
> So, you suggest to remove `<< *Entry->Scalars[0];` and ёкуегкт Str;`? We can keep `splat` label here.
Ok, keep "splat" label, but remove `return Str;` below.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113774



More information about the llvm-commits mailing list