A bunch of scalars can be treated as a splat not only if all elements
are the same but also if some of them are undefvalues.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | ||
---|---|---|
2596 | Change it or just remove? |
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | ||
---|---|---|
2596 | Why? |
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | ||
---|---|---|
2596 | Entry->Scalars[0] can be undef with this patch, for this case the output is uninformative. |
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | ||
---|---|---|
2596 | Hard to tell, this is still the very first element of the entry. |
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | ||
---|---|---|
2596 | 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. |
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | ||
---|---|---|
2596 | Better to output all the scalars here, I think |
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | ||
---|---|---|
2596 | That's exactly what I mean by removing this if-block which early returns otherwise. |
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | ||
---|---|---|
2596 | So, you suggest to remove << *Entry->Scalars[0]; and ёкуегкт Str;? We can keep splat` label here. |
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | ||
---|---|---|
2596 | Ok, keep "splat" label, but remove return Str; below. |
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | ||
---|---|---|
2596 | Ok, will do in a separate patch |
Please update the comment to mention that this also accepts undefs.