-
Notifications
You must be signed in to change notification settings - Fork 5k
Arm64 SVE: re-enable use of predicate variants #116854
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
base: main
Are you sure you want to change the base?
Conversation
Fixes dotnet#101970 in dotnet#115566 Adds a simple costing to fgMorphTryUseAllMaskVariant() and assumes nodes can always be converted to masks (using ConvertVectorToMask).
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
@@ -1993,6 +1993,104 @@ SveMaskPattern EvaluateSimdMaskToPattern(var_types baseType, simdmask_t arg0) | |||
} | |||
} | |||
} | |||
|
|||
template <typename TSimd, typename TBase> |
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.
Same changes to this file also exist in #116852. I'll remove from one PR when the other is merged.
// depending on if the corresponding input element | ||
// has its least significant bit set | ||
|
||
bool isSet = static_cast<uint64_t>(1) << (i * sizeof(TBase)); |
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.
as I pointed in other PR, this one doesn't even check with contents of input0
.
// Arguments: | ||
// node - The node to convert to a mask | ||
// parent - The parent of the node | ||
// currentCost - (IN/OUT) incremented by the current cost of the node |
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.
nit: just for better readability, consider renaming currentCost
and switchCost
to something meaningful like maskToVectorConvertCost
and vectorToMaskConvertCost
.
static constexpr const weight_t costOfConvertMaskToVector = 1.0; | ||
|
||
// Conversion of vector to mask is two instructions. | ||
static constexpr const weight_t costOfConvertVectorToMask = 2.0; |
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.
add a comment on why costOfConvertVectorToMask
is expensive than costOfConvertMaskToVector
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.
added some comments
Fixes #101970
Predicate variants were implemented, and then turned off in #115566.
Adds a simple costing to fgMorphTryUseAllMaskVariant() and assumes nodes can always be converted to masks (using ConvertVectorToMask).