[PATCH] D100495: [SLP] Add detection of shuffled/perfect matching of tree entries.
Simon Pilgrim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 15 03:31:44 PDT 2021
RKSimon added a comment.
A few comments along the theme of reducing code duplication
================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:4290
+ std::distance(VTE->Scalars.begin(), find(VTE->Scalars, V)));
+ continue;
+ }
----------------
This is the same as the getTreeEntry code above - merge them?
================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:4305
+ return TargetTransformInfo::SK_PermuteTwoSrc;
+ }
+ return None;
----------------
This shuffle kind decode code feels like the kind of thing it should be somewhere like Analysis\VectorUtils.h ?
================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:4606
+ Entries.back()->VectorizedValue, Mask);
+ }
+ } else {
----------------
Can't we merge these? if we assert that (Entries.size() == 1 || Entries.size() == 2) then Entries,.back() will return Entries.front() for a unary shuffle and Builder.CreateShuffleVector should handle the canonicalization.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D100495/new/
https://reviews.llvm.org/D100495
More information about the llvm-commits
mailing list