Skip to content

Commit 65734de

Browse files
authored
[SLP] NFC. Remove the redundant MainOp and AltOp find process. (#133642)
1 parent 6257621 commit 65734de

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3733,16 +3733,8 @@ class BoUpSLP {
37333733
Last->ReorderIndices.append(ReorderIndices.begin(), ReorderIndices.end());
37343734
}
37353735
if (EntryState == TreeEntry::SplitVectorize) {
3736-
auto *MainOp =
3737-
cast<Instruction>(*find_if(Last->Scalars, IsaPred<Instruction>));
3738-
auto *AltOp = cast<Instruction>(*find_if(Last->Scalars, [=](Value *V) {
3739-
auto *I = dyn_cast<Instruction>(V);
3740-
if (!I)
3741-
return false;
3742-
InstructionsState LocalS = getSameOpcode({I, MainOp}, *TLI);
3743-
return !LocalS || LocalS.isAltShuffle();
3744-
}));
3745-
Last->setOperations(InstructionsState(MainOp, AltOp));
3736+
assert(S && "Split nodes must have operations.");
3737+
Last->setOperations(S);
37463738
SmallPtrSet<Value *, 4> Processed;
37473739
for (Value *V : VL) {
37483740
auto *I = dyn_cast<Instruction>(V);

0 commit comments

Comments
 (0)