@@ -700,9 +700,9 @@ bool ScalarizerVisitor::isTriviallyScalarizable(Intrinsic::ID ID) {
700700// / element if possible for the intrinsic.
701701bool ScalarizerVisitor::splitCall (CallInst &CI) {
702702 Type *CallType = CI.getType ();
703- bool AreAllMatchingVectors = isStructOfMatchingFixedVectors (CallType);
703+ bool AreAllVectorsOfMatchingSize = isStructOfMatchingFixedVectors (CallType);
704704 std::optional<VectorSplit> VS;
705- if (AreAllMatchingVectors )
705+ if (AreAllVectorsOfMatchingSize )
706706 VS = getVectorSplit (CallType->getContainedType (0 ));
707707 else
708708 VS = getVectorSplit (CallType);
@@ -730,19 +730,17 @@ bool ScalarizerVisitor::splitCall(CallInst &CI) {
730730 if (isVectorIntrinsicWithOverloadTypeAtArg (ID, -1 ))
731731 Tys.push_back (VS->SplitTy );
732732
733- if (AreAllMatchingVectors) {
734- Type *PrevType = CallType->getContainedType (0 );
733+ if (AreAllVectorsOfMatchingSize) {
735734 for (unsigned I = 1 ; I < CallType->getNumContainedTypes (); I++) {
736- Type *CurrType = cast<FixedVectorType>(CallType-> getContainedType ( I));
737- if (PrevType != CurrType) {
738- std::optional<VectorSplit> CurrVS = getVectorSplit (CurrType );
735+ if ( isVectorIntrinsicWithStructReturnOverloadAtField (ID, I)) {
736+ std::optional<VectorSplit> CurrVS = getVectorSplit (
737+ cast<FixedVectorType>(CallType-> getContainedType (I)) );
739738 // This case does not seem to happen, but it is possible for
740739 // VectorSplit.NumPacked >= NumElems. If that happens a VectorSplit
741740 // is not returned and we will bailout of handling this call.
742741 if (!CurrVS)
743742 return false ;
744743 Tys.push_back (CurrVS->SplitTy );
745- PrevType = CurrType;
746744 }
747745 }
748746 }
0 commit comments