Skip to content

Commit b966b22

Browse files
committed
Revert "[SLP]Fix PR85082: PHI node has multiple entries."
This reverts commit 8237520 to fix a crash in https://lab.llvm.org/buildbot/#/builders/198/builds/8891.
1 parent 26bd3d0 commit b966b22

File tree

2 files changed

+7
-84
lines changed

2 files changed

+7
-84
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12582,7 +12582,6 @@ Value *BoUpSLP::vectorizeTree(
1258212582
Ex = I;
1258312583
}
1258412584
}
12585-
Value *ExV = Ex;
1258612585
if (!Ex) {
1258712586
// "Reuse" the existing extract to improve final codegen.
1258812587
if (auto *ES = dyn_cast<ExtractElementInst>(Scalar)) {
@@ -12593,13 +12592,7 @@ Value *BoUpSLP::vectorizeTree(
1259312592
} else {
1259412593
Ex = Builder.CreateExtractElement(Vec, Lane);
1259512594
}
12596-
// If necessary, sign-extend or zero-extend ScalarRoot
12597-
// to the larger type.
12598-
ExV = Ex;
12599-
if (Scalar->getType() != Ex->getType())
12600-
ExV = Builder.CreateIntCast(Ex, Scalar->getType(),
12601-
MinBWs.find(E)->second.second);
12602-
if (auto *I = dyn_cast<Instruction>(ExV))
12595+
if (auto *I = dyn_cast<Instruction>(Ex))
1260312596
ScalarToEEs[Scalar].try_emplace(Builder.GetInsertBlock(), I);
1260412597
}
1260512598
// The then branch of the previous if may produce constants, since 0
@@ -12608,7 +12601,12 @@ Value *BoUpSLP::vectorizeTree(
1260812601
GatherShuffleExtractSeq.insert(ExI);
1260912602
CSEBlocks.insert(ExI->getParent());
1261012603
}
12611-
return ExV;
12604+
// If necessary, sign-extend or zero-extend ScalarRoot
12605+
// to the larger type.
12606+
if (Scalar->getType() != Ex->getType())
12607+
return Builder.CreateIntCast(Ex, Scalar->getType(),
12608+
MinBWs.find(E)->second.second);
12609+
return Ex;
1261212610
}
1261312611
assert(isa<FixedVectorType>(Scalar->getType()) &&
1261412612
isa<InsertElementInst>(Scalar) &&

llvm/test/Transforms/SLPVectorizer/X86/same-scalar-in-same-phi-extract.ll

Lines changed: 0 additions & 75 deletions
This file was deleted.

0 commit comments

Comments
 (0)