Skip to content

Optimize EnsureInstructionSetFlagsAreValid #77190

@EgorBo

Description

@EgorBo

It's not the first time I see this method popping up in profilers. It seems to be doing a lot of work (in a loop!) every jit compilation and can be cached (ISAs don't change). Here is a flamegraph from the bing service:

image

Another (less important) problem with that HasInstructionSet that MSVC doesn't want to inline GetRelativeBitMask here.

image

no matter if native PGO is applied or not, according to MSVC inliner's log it's "callgraph decision not to inline it" - looks like the reason it does that is that we compile coreclr with -Ox, it's inlined just fine with -O2

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions