Skip to content

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
@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