Skip to content

Commit 356a77f

Browse files
committed
[SLP] NFC. Remove redundant computation in getReorderingData.
1 parent f082782 commit 356a77f

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5622,18 +5622,12 @@ BoUpSLP::getReorderingData(const TreeEntry &TE, bool TopToBottom) {
56225622
}
56235623
return false;
56245624
};
5625-
SmallDenseMap<unsigned, unsigned, 16> PhiToId;
5626-
SmallVector<unsigned> Phis(TE.Scalars.size());
5625+
OrdersType Phis(TE.Scalars.size());
56275626
std::iota(Phis.begin(), Phis.end(), 0);
5628-
OrdersType ResOrder(TE.Scalars.size());
5629-
for (unsigned Id = 0, Sz = TE.Scalars.size(); Id < Sz; ++Id)
5630-
PhiToId[Id] = Id;
56315627
stable_sort(Phis, PHICompare);
5632-
for (unsigned Id = 0, Sz = Phis.size(); Id < Sz; ++Id)
5633-
ResOrder[Id] = PhiToId[Phis[Id]];
5634-
if (isIdentityOrder(ResOrder))
5628+
if (isIdentityOrder(Phis))
56355629
return std::nullopt; // No need to reorder.
5636-
return std::move(ResOrder);
5630+
return std::move(Phis);
56375631
}
56385632
if (TE.isGather() && !TE.isAltShuffle() && allSameType(TE.Scalars)) {
56395633
// TODO: add analysis of other gather nodes with extractelement

0 commit comments

Comments
 (0)