Skip to content
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

Don't always do optimistic HW intrinsic expansion #89282

Merged
merged 1 commit into from
Jul 24, 2023

Conversation

MichalStrehovsky
Copy link
Member

"Optimistic" expansion means we generate a method body for IsSupported that returns true/false depending on the currently running CPU.

Don't do this when --instruction-set:native was specified because native should mean "exactly this, as if I was using a JIT". Also don't do this when optimizing for size (saves 0.6% on hello world). I was going back and forth whether to do this when user specifies instruction sets manually, but it would be a "breaking" change to pull out the optimistic part.

I also though about #87865 (comment) (adding ?), but that one would have odd failure modes --instruction-set:avx? is not supportable by RyuJIT and there are others. The rules are bespoke.

Cc @dotnet/ilc-contrib

"Optimistic" expansion means we generate a method body for `IsSupported` that returns true/false depending on the currently running CPU. Don't do this when `--instruction-set:native` was specified because native should mean "exactly this". Also don't do this when optimizing for size (saves 0.6% on hello world). I was going back and forth whether to do this when user specifies instruction sets manually, but decided it would be a "breaking" change.
@ghost
Copy link

ghost commented Jul 21, 2023

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

Issue Details

"Optimistic" expansion means we generate a method body for IsSupported that returns true/false depending on the currently running CPU.

Don't do this when --instruction-set:native was specified because native should mean "exactly this, as if I was using a JIT". Also don't do this when optimizing for size (saves 0.6% on hello world). I was going back and forth whether to do this when user specifies instruction sets manually, but it would be a "breaking" change to pull out the optimistic part.

I also though about #87865 (comment) (adding ?), but that one would have odd failure modes --instruction-set:avx? is not supportable by RyuJIT and there are others. The rules are bespoke.

Cc @dotnet/ilc-contrib

Author: MichalStrehovsky
Assignees: MichalStrehovsky
Labels:

area-crossgen2-coreclr, area-NativeAOT-coreclr

Milestone: -

@MichalStrehovsky MichalStrehovsky merged commit 78b45ad into dotnet:main Jul 24, 2023
106 checks passed
@MichalStrehovsky MichalStrehovsky deleted the optimistic branch July 24, 2023 01:54
@ghost ghost locked as resolved and limited conversation to collaborators Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants