[PATCH] D115811: [SLP]Early exit out of the reordering if shuffled/perfect diamond match found.
Vasileios Porpodas via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 15 12:06:45 PST 2021
vporpo added inline comments.
================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:1656-1665
+ SmallPtrSet<Value *, 4> UniqueValues;
+ ArrayRef<OperandData> Op0 = OpsVec.front();
+ for (const OperandData &Data : Op0)
+ UniqueValues.insert(Data.V);
+ for (ArrayRef<OperandData> Op : drop_begin(OpsVec, 1)) {
+ if (any_of(Op, [&UniqueValues](const OperandData &Data) {
+ return !UniqueValues.contains(Data.V);
----------------
Isn't `VLOperands` a better place for this logic? Perhaps a method like: `isDiamondMatch()` ?
This will also help separate the temporary check `UniqueValues.size() == 2 || !isPowerOf2_32(UniqueValues.size())`. What do you think?
================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:1666
+ }
+ return UniqueValues.size() == 2 || !isPowerOf2_32(UniqueValues.size());
+ };
----------------
nit: Perhaps a TODO here?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D115811/new/
https://reviews.llvm.org/D115811
More information about the llvm-commits
mailing list