[llvm] 65734de - [SLP] NFC. Remove the redundant MainOp and AltOp find process. (#133642)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Mar 30 19:26:48 PDT 2025
Author: Han-Kuan Chen
Date: 2025-03-31T10:26:45+08:00
New Revision: 65734de9b93bef5b3211298b4fcc5dc79d18d31e
URL: https://github.com/llvm/llvm-project/commit/65734de9b93bef5b3211298b4fcc5dc79d18d31e
DIFF: https://github.com/llvm/llvm-project/commit/65734de9b93bef5b3211298b4fcc5dc79d18d31e.diff
LOG: [SLP] NFC. Remove the redundant MainOp and AltOp find process. (#133642)
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 850895895d44d..a4b0378abc075 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -3733,16 +3733,8 @@ class BoUpSLP {
Last->ReorderIndices.append(ReorderIndices.begin(), ReorderIndices.end());
}
if (EntryState == TreeEntry::SplitVectorize) {
- auto *MainOp =
- cast<Instruction>(*find_if(Last->Scalars, IsaPred<Instruction>));
- auto *AltOp = cast<Instruction>(*find_if(Last->Scalars, [=](Value *V) {
- auto *I = dyn_cast<Instruction>(V);
- if (!I)
- return false;
- InstructionsState LocalS = getSameOpcode({I, MainOp}, *TLI);
- return !LocalS || LocalS.isAltShuffle();
- }));
- Last->setOperations(InstructionsState(MainOp, AltOp));
+ assert(S && "Split nodes must have operations.");
+ Last->setOperations(S);
SmallPtrSet<Value *, 4> Processed;
for (Value *V : VL) {
auto *I = dyn_cast<Instruction>(V);
More information about the llvm-commits
mailing list