Skip to content

Commit 6a07812

Browse files
committed
Revert change to use isVectorIntrinsicWithScalarOpAtArg for return type
1 parent 9adc046 commit 6a07812

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

llvm/lib/CodeGen/ReplaceWithVeclib.cpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -103,24 +103,21 @@ static bool replaceWithCallToVeclib(const TargetLibraryInfo &TLI,
103103
Intrinsic::ID IID = II->getIntrinsicID();
104104
if (IID == Intrinsic::not_intrinsic)
105105
return false;
106-
107-
// RetIsScalar: Return type is not widened.
108-
bool RetIsScalar = isVectorIntrinsicWithScalarOpAtArg(IID, -1);
109106
Type *RetTy = II->getType();
110107
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.
115110
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));
118112

119113
// OloadTys collects types used in scalar intrinsic overload name.
120114
SmallVector<Type *, 3> OloadTys;
121115
if (!RetTy->isVoidTy() && isVectorIntrinsicWithOverloadTypeAtArg(IID, -1))
122-
OloadTys.push_back(RetIsScalar ? RetTy : ScalarRetTy);
116+
OloadTys.push_back(ScalarRetTy);
123117

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;
124121
for (auto Arg : enumerate(II->args())) {
125122
auto *ArgTy = Arg.value()->getType();
126123
bool IsOloadTy = isVectorIntrinsicWithOverloadTypeAtArg(IID, Arg.index());

0 commit comments

Comments
 (0)