Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions llvm/lib/Transforms/Scalar/Scalarizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -719,13 +719,12 @@ bool ScalarizerVisitor::splitCall(CallInst &CI) {
for (unsigned I = 1; I < CallType->getNumContainedTypes(); I++) {
std::optional<VectorSplit> CurrVS =
getVectorSplit(cast<FixedVectorType>(CallType->getContainedType(I)));
// This case does not seem to happen, but it is possible for
// VectorSplit.NumPacked >= NumElems. If that happens a VectorSplit
// is not returned and we will bailout of handling this call.
// The secondary bailout case is if NumPacked does not match.
// This can happen if ScalarizeMinBits is not set to the default.
// This means with certain ScalarizeMinBits intrinsics like frexp
// will only scalarize when the struct elements have the same bitness.
// It is possible for VectorSplit.NumPacked >= NumElems. If that happens a
// VectorSplit is not returned and we will bailout of handling this call.
// The secondary bailout case is if NumPacked does not match. This can
// happen if ScalarizeMinBits is not set to the default. This means with
// certain ScalarizeMinBits intrinsics like frexp will only scalarize when
// the struct elements have the same bitness.
if (!CurrVS || CurrVS->NumPacked != VS->NumPacked)
return false;
if (isVectorIntrinsicWithStructReturnOverloadAtField(ID, I, TTI))
Expand Down Expand Up @@ -1083,6 +1082,18 @@ bool ScalarizerVisitor::visitExtractValueInst(ExtractValueInst &EVI) {
std::optional<VectorSplit> VS = getVectorSplit(VecType);
if (!VS)
return false;
for (unsigned I = 1; I < OpTy->getNumContainedTypes(); I++) {
std::optional<VectorSplit> CurrVS =
getVectorSplit(cast<FixedVectorType>(OpTy->getContainedType(I)));
// It is possible for VectorSplit.NumPacked >= NumElems. If that happens a
// VectorSplit is not returned and we will bailout of handling this call.
// The secondary bailout case is if NumPacked does not match. This can
// happen if ScalarizeMinBits is not set to the default. This means with
// certain ScalarizeMinBits intrinsics like frexp will only scalarize when
// the struct elements have the same bitness.
if (!CurrVS || CurrVS->NumPacked != VS->NumPacked)
return false;
}
IRBuilder<> Builder(&EVI);
Scatterer Op0 = scatter(&EVI, Op, *VS);
assert(!EVI.getIndices().empty() && "Make sure an index exists");
Expand Down
Loading
Loading