@@ -719,13 +719,12 @@ bool ScalarizerVisitor::splitCall(CallInst &CI) {
719
719
for (unsigned I = 1 ; I < CallType->getNumContainedTypes (); I++) {
720
720
std::optional<VectorSplit> CurrVS =
721
721
getVectorSplit (cast<FixedVectorType>(CallType->getContainedType (I)));
722
- // This case does not seem to happen, but it is possible for
723
- // VectorSplit.NumPacked >= NumElems. If that happens a VectorSplit
724
- // is not returned and we will bailout of handling this call.
725
- // The secondary bailout case is if NumPacked does not match.
726
- // This can happen if ScalarizeMinBits is not set to the default.
727
- // This means with certain ScalarizeMinBits intrinsics like frexp
728
- // will only scalarize when the struct elements have the same bitness.
722
+ // It is possible for VectorSplit.NumPacked >= NumElems. If that happens a
723
+ // VectorSplit is not returned and we will bailout of handling this call.
724
+ // The secondary bailout case is if NumPacked does not match. This can
725
+ // happen if ScalarizeMinBits is not set to the default. This means with
726
+ // certain ScalarizeMinBits intrinsics like frexp will only scalarize when
727
+ // the struct elements have the same bitness.
729
728
if (!CurrVS || CurrVS->NumPacked != VS->NumPacked )
730
729
return false ;
731
730
if (isVectorIntrinsicWithStructReturnOverloadAtField (ID, I, TTI))
@@ -1083,6 +1082,18 @@ bool ScalarizerVisitor::visitExtractValueInst(ExtractValueInst &EVI) {
1083
1082
std::optional<VectorSplit> VS = getVectorSplit (VecType);
1084
1083
if (!VS)
1085
1084
return false ;
1085
+ for (unsigned I = 1 ; I < OpTy->getNumContainedTypes (); I++) {
1086
+ std::optional<VectorSplit> CurrVS =
1087
+ getVectorSplit (cast<FixedVectorType>(OpTy->getContainedType (I)));
1088
+ // It is possible for VectorSplit.NumPacked >= NumElems. If that happens a
1089
+ // VectorSplit is not returned and we will bailout of handling this call.
1090
+ // The secondary bailout case is if NumPacked does not match. This can
1091
+ // happen if ScalarizeMinBits is not set to the default. This means with
1092
+ // certain ScalarizeMinBits intrinsics like frexp will only scalarize when
1093
+ // the struct elements have the same bitness.
1094
+ if (!CurrVS || CurrVS->NumPacked != VS->NumPacked )
1095
+ return false ;
1096
+ }
1086
1097
IRBuilder<> Builder (&EVI);
1087
1098
Scatterer Op0 = scatter (&EVI, Op, *VS);
1088
1099
assert (!EVI.getIndices ().empty () && " Make sure an index exists" );
0 commit comments