-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[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 3 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 |
---|---|---|
|
@@ -152,7 +152,8 @@ bool isVectorIntrinsicWithScalarOpAtArg(Intrinsic::ID ID, | |
|
||
/// Identifies if the vector form of the intrinsic is overloaded on the type of | ||
/// the operand at index \p OpdIdx, or on the return type if \p OpdIdx is -1. | ||
bool isVectorIntrinsicWithOverloadTypeAtArg(Intrinsic::ID ID, int OpdIdx); | ||
bool isVectorIntrinsicWithOverloadTypeAtArg( | ||
Intrinsic::ID ID, int OpdIdx, const TargetTransformInfo *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. Could also do with an 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. I don't think this should be optional. In any case where this argument matters it would be a bug to not pass it. |
||
|
||
/// Identifies if the vector form of the intrinsic that returns a struct is | ||
/// overloaded at the struct element index \p RetIdx. | ||
|
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.