[PATCH] D101109: [SLP]Improve multinode analysis.
Vasileios Porpodas via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 13 15:16:40 PST 2021
vporpo accepted this revision.
vporpo added a comment.
This revision is now accepted and ready to land.
LGTM
================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:1092-1098
+ if (match(V1, m_ExtractElt(m_Value(EV1), m_ConstantInt(Ex1Idx))) &&
+ (isa<UndefValue>(V2) ||
+ (match(V2,
+ m_ExtractElt(m_Value(EV2), m_CombineOr(m_ConstantInt(Ex2Idx),
+ m_Undef()))) &&
+ (!EV2 || (isUndefVector(EV2) && EV2->getType() == EV1->getType()) ||
+ EV2 == EV1)))) {
----------------
Nit: Could you use temporary variables and perhaps try to simplify the expression to make it a bit easier to read, something like:
```
bool MatchExtract1 = match(V1, m_ExtractElt(m_Value(EV1), m_ConstantInt(Ex1Idx)));
bool MatchExtract2 = match(V2, m_ExtractElt(m_Value(EV2), m_CombineOr(m_ConstantInt(Ex2Idx), m_Undef())));
bool AcceptedEV2 = !EV2 || (isUndefVector(EV2) && EV2->getType() == EV1->getType()) || EV2 == EV1;
if ((MatchExtract1 && isa<UndefValue>(V2)) ||
(MatchExtract1 && MatchExtract2 && AcceptedEV2)) {
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D101109/new/
https://reviews.llvm.org/D101109
More information about the llvm-commits
mailing list