-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[NFC][Scalarizer][TargetTransformInfo] Add isVectorIntrinsicWithOverloadTypeAtArg
api
#114849
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b95d4f3
58925a4
628f983
7ff6fb7
df90c48
3a236c7
71d75fe
59ef511
ad7ae0c
886e36d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,15 +110,17 @@ static bool replaceWithCallToVeclib(const TargetLibraryInfo &TLI, | |
|
||
// OloadTys collects types used in scalar intrinsic overload name. | ||
SmallVector<Type *, 3> OloadTys; | ||
if (!RetTy->isVoidTy() && isVectorIntrinsicWithOverloadTypeAtArg(IID, -1)) | ||
if (!RetTy->isVoidTy() && | ||
isVectorIntrinsicWithOverloadTypeAtArg(IID, -1, /*TTI=*/nullptr)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Regarding adding a dependency on the |
||
OloadTys.push_back(ScalarRetTy); | ||
|
||
// Compute the argument types of the corresponding scalar call and check that | ||
// all vector operands match the previously found EC. | ||
SmallVector<Type *, 8> ScalarArgTypes; | ||
for (auto Arg : enumerate(II->args())) { | ||
auto *ArgTy = Arg.value()->getType(); | ||
bool IsOloadTy = isVectorIntrinsicWithOverloadTypeAtArg(IID, Arg.index()); | ||
bool IsOloadTy = isVectorIntrinsicWithOverloadTypeAtArg(IID, Arg.index(), | ||
/*TTI=*/nullptr); | ||
if (isVectorIntrinsicWithScalarOpAtArg(IID, Arg.index())) { | ||
ScalarArgTypes.push_back(ArgTy); | ||
if (IsOloadTy) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,14 @@ bool DirectXTTIImpl::isTargetIntrinsicWithScalarOpAtArg(Intrinsic::ID ID, | |
} | ||
} | ||
|
||
bool DirectXTTIImpl::isVectorIntrinsicWithOverloadTypeAtArg(Intrinsic::ID ID, | ||
int ScalarOpdIdx) { | ||
switch (ID) { | ||
default: | ||
return ScalarOpdIdx == -1; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In case anyone else wonders why the switch statement is here, observe the follow-on in #114847 |
||
} | ||
|
||
bool DirectXTTIImpl::isTargetIntrinsicTriviallyScalarizable( | ||
Intrinsic::ID ID) const { | ||
switch (ID) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may wish to update this comment to mention the new parameter. As many places as this function is implemented at different levels and as confusing as I initially found the name of it, it might be worth copying this to at least a few of the places that it and it's facilitators are declared/defined.