Skip to content

Commit b5a1b45

Browse files
committed
[SLP] Early return in getReorderingData [nfc]
1 parent 26c3a84 commit b5a1b45

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5226,6 +5226,9 @@ BoUpSLP::getReorderingData(const TreeEntry &TE, bool TopToBottom) {
52265226
!TE.isAltShuffle())
52275227
return TE.ReorderIndices;
52285228
if (TE.State == TreeEntry::Vectorize && TE.getOpcode() == Instruction::PHI) {
5229+
if (!TE.ReorderIndices.empty())
5230+
return TE.ReorderIndices;
5231+
52295232
auto PHICompare = [&](unsigned I1, unsigned I2) {
52305233
Value *V1 = TE.Scalars[I1];
52315234
Value *V2 = TE.Scalars[I2];
@@ -5259,8 +5262,6 @@ BoUpSLP::getReorderingData(const TreeEntry &TE, bool TopToBottom) {
52595262
return false;
52605263
return true;
52615264
};
5262-
if (!TE.ReorderIndices.empty())
5263-
return TE.ReorderIndices;
52645265
DenseMap<unsigned, unsigned> PhiToId;
52655266
SmallVector<unsigned> Phis(TE.Scalars.size());
52665267
std::iota(Phis.begin(), Phis.end(), 0);

0 commit comments

Comments
 (0)