Skip to content

Commit 9f94e81

Browse files
committed
add safety check in case getVectorSplit fails.
1 parent 96f95a4 commit 9f94e81

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

llvm/lib/Transforms/Scalar/Scalarizer.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,11 @@ bool ScalarizerVisitor::splitCall(CallInst &CI) {
736736
Type *CurrType = cast<FixedVectorType>(CallType->getContainedType(I));
737737
if (PrevType != CurrType) {
738738
std::optional<VectorSplit> CurrVS = getVectorSplit(CurrType);
739+
// This case does not seem to happen, but it is possible for
740+
// VectorSplit.NumPacked >= NumElems. If that happens a VectorSplit
741+
// is not returned and we will bailout of handling this call.
742+
if (!CurrVS)
743+
return false;
739744
Tys.push_back(CurrVS->SplitTy);
740745
PrevType = CurrType;
741746
}

0 commit comments

Comments
 (0)