@@ -103,24 +103,21 @@ static bool replaceWithCallToVeclib(const TargetLibraryInfo &TLI,
103
103
Intrinsic::ID IID = II->getIntrinsicID ();
104
104
if (IID == Intrinsic::not_intrinsic)
105
105
return false ;
106
-
107
- // RetIsScalar: Return type is not widened.
108
- bool RetIsScalar = isVectorIntrinsicWithScalarOpAtArg (IID, -1 );
109
106
Type *RetTy = II->getType ();
110
107
Type *ScalarRetTy = RetTy->getScalarType ();
111
-
112
- // Compute the argument types of the corresponding scalar call and check that
113
- // all vector operands match the previously found EC.
114
- SmallVector<Type *, 8 > ScalarArgTypes;
108
+ // At the moment VFABI assumes the return type is always widened unless it is
109
+ // a void type.
115
110
auto *VTy = dyn_cast<VectorType>(RetTy);
116
- ElementCount EC (!RetIsScalar && VTy ? VTy->getElementCount ()
117
- : ElementCount::getFixed (0 ));
111
+ ElementCount EC (VTy ? VTy->getElementCount () : ElementCount::getFixed (0 ));
118
112
119
113
// OloadTys collects types used in scalar intrinsic overload name.
120
114
SmallVector<Type *, 3 > OloadTys;
121
115
if (!RetTy->isVoidTy () && isVectorIntrinsicWithOverloadTypeAtArg (IID, -1 ))
122
- OloadTys.push_back (RetIsScalar ? RetTy : ScalarRetTy);
116
+ OloadTys.push_back (ScalarRetTy);
123
117
118
+ // Compute the argument types of the corresponding scalar call and check that
119
+ // all vector operands match the previously found EC.
120
+ SmallVector<Type *, 8 > ScalarArgTypes;
124
121
for (auto Arg : enumerate(II->args ())) {
125
122
auto *ArgTy = Arg.value ()->getType ();
126
123
bool IsOloadTy = isVectorIntrinsicWithOverloadTypeAtArg (IID, Arg.index ());
0 commit comments