Skip to content

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

a74nh
Copy link
Contributor

@a74nh a74nh commented Jun 20, 2025

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).

Fixes dotnet#101970

in dotnet#115566

Adds a simple costing to fgMorphTryUseAllMaskVariant() and assumes
nodes can always be converted to masks (using ConvertVectorToMask).
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Jun 20, 2025
@github-actions github-actions bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jun 20, 2025
Copy link
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

@@ -1993,6 +1993,104 @@ SveMaskPattern EvaluateSimdMaskToPattern(var_types baseType, simdmask_t arg0)
}
}
}

template <typename TSimd, typename TBase>
Copy link
Contributor Author

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.

@a74nh a74nh marked this pull request as ready for review June 20, 2025 12:33
@a74nh a74nh marked this pull request as draft June 20, 2025 12:35
@a74nh a74nh marked this pull request as ready for review June 20, 2025 13:38
@a74nh
Copy link
Contributor Author

a74nh commented Jun 20, 2025

@kunalspathak

// depending on if the corresponding input element
// has its least significant bit set

bool isSet = static_cast<uint64_t>(1) << (i * sizeof(TBase));
Copy link
Member

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
Copy link
Member

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;
Copy link
Member

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

Copy link
Member

@kunalspathak kunalspathak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added some comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ARM64-SVE: Use predicate versions of instructions
2 participants