Don't always do optimistic HW intrinsic expansion (#89282)
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>
Mon, 24 Jul 2023 01:54:30 +0000 (10:54 +0900)
committerGitHub <noreply@github.com>
Mon, 24 Jul 2023 01:54:30 +0000 (10:54 +0900)
commit78b45adbf20ab365f86d3b81c067d90719eaa7d0
treeaa798af7ba2effffbffa7332afd63c9fad3327bd
parent08aba6922a11e92fc7a67ea5e3340cab8bceb36d
Don't always do optimistic HW intrinsic expansion (#89282)

"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.
src/coreclr/tools/Common/InstructionSetHelpers.cs
src/coreclr/tools/aot/ILCompiler/Program.cs