[llvm] b5a1b45 - [SLP] Early return in getReorderingData [nfc]
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 29 08:59:02 PDT 2024
Author: Philip Reames
Date: 2024-08-29T08:58:27-07:00
New Revision: b5a1b45fe321cdf57d1b6155ecbbc18b6f95502f
URL: https://github.com/llvm/llvm-project/commit/b5a1b45fe321cdf57d1b6155ecbbc18b6f95502f
DIFF: https://github.com/llvm/llvm-project/commit/b5a1b45fe321cdf57d1b6155ecbbc18b6f95502f.diff
LOG: [SLP] Early return in getReorderingData [nfc]
Added:
Modified:
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index fe57dbfc93d3e7..81811e0a4d9295 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -5226,6 +5226,9 @@ BoUpSLP::getReorderingData(const TreeEntry &TE, bool TopToBottom) {
!TE.isAltShuffle())
return TE.ReorderIndices;
if (TE.State == TreeEntry::Vectorize && TE.getOpcode() == Instruction::PHI) {
+ if (!TE.ReorderIndices.empty())
+ return TE.ReorderIndices;
+
auto PHICompare = [&](unsigned I1, unsigned I2) {
Value *V1 = TE.Scalars[I1];
Value *V2 = TE.Scalars[I2];
@@ -5259,8 +5262,6 @@ BoUpSLP::getReorderingData(const TreeEntry &TE, bool TopToBottom) {
return false;
return true;
};
- if (!TE.ReorderIndices.empty())
- return TE.ReorderIndices;
DenseMap<unsigned, unsigned> PhiToId;
SmallVector<unsigned> Phis(TE.Scalars.size());
std::iota(Phis.begin(), Phis.end(), 0);
More information about the llvm-commits
mailing list