We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent af93c5a commit 92cc299Copy full SHA for 92cc299
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -13895,7 +13895,7 @@ Value *BoUpSLP::vectorizeTree(
13895
if (const TreeEntry *ETE = getTreeEntry(V))
13896
V = ETE->VectorizedValue;
13897
if (auto *IV = dyn_cast<Instruction>(V);
13898
- !IV || IV == Vec || IV->comesBefore(cast<Instruction>(Vec)))
+ !IV || IV == Vec || (IV->getParent() == cast<Instruction>(Vec)->getParent() && IV->comesBefore(cast<Instruction>(Vec))))
13899
Ex = Builder.CreateExtractElement(V, ES->getIndexOperand());
13900
else
13901
Ex = Builder.CreateExtractElement(Vec, Lane);
0 commit comments