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

Add DOTNET_JitDisasmOnlyOptimized knob #96960

Merged
merged 3 commits into from
Jan 16, 2024
Merged

Conversation

EgorBo
Copy link
Member

@EgorBo EgorBo commented Jan 14, 2024

We already have DOTNET_JitDumpTier0 to hide unoptimized dumps, this PR add the same for JitDisasm. Users often don't care about unoptimized asm.

@ghost ghost assigned EgorBo Jan 14, 2024
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jan 14, 2024
@ghost
Copy link

ghost commented Jan 14, 2024

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

Issue Details

We already have DOTNET_JitDumpTier0 to hide unoptimized dumps, this PR add the same for JitDisasm. Users often don't care about unoptimized asm.

Author: EgorBo
Assignees: EgorBo
Labels:

area-CodeGen-coreclr

Milestone: -

Copy link
Member

@jakobbotsch jakobbotsch left a comment

Choose a reason for hiding this comment

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

The name is DisasmTier0 but the behavior is DisasmOnlyTier1. I'd suggest renaming it to JitDisasmOnlyOptimized and switch the check to OptimizationEnabled() instead.

@EgorBo
Copy link
Member Author

EgorBo commented Jan 14, 2024

The name is DisasmTier0 but the behavior is DisasmOnlyTier1. I'd suggest renaming it to DisasmOnlyOptimized and switch the check to OptimizationEnabled() instead.

OptimizationEnabled() triggered an assert because it's not yet initialized so I consumed the flag directly to avoid changing too much code unnecessarily. Tier1 flag means "optimizations are allowed", I'm fine renaming the knob though

@jakobbotsch
Copy link
Member

I don't think the check is correct as it stands. It does not cover scenarios where the JIT switches from unoptimized code to optimized code or vice versa. Also, do crossgen2/ILC even set the Tier1 flag?

I think you should just delay checking for these conditions until we've made all the decisions around optimization level, including switching between optimized/deoptimizing, and switch to OptimizationEnabled(). We can do that for JitDisasm, but we cannot really do it for JitDump.

@EgorBo EgorBo changed the title Add DOTNET_JitDisasmTier0 Add DOTNET_JitDisasmOnlyOptimized knob Jan 16, 2024
@EgorBo
Copy link
Member Author

EgorBo commented Jan 16, 2024

Failure is #96904

@EgorBo EgorBo merged commit 660cfe0 into dotnet:main Jan 16, 2024
128 of 130 checks passed
@EgorBo EgorBo deleted the jitdisasmtier0 branch January 16, 2024 14:39
@BruceForstall
Copy link
Member

Don't forget to cc jit-contrib on PRs.

@EgorBo
Copy link
Member Author

EgorBo commented Jan 22, 2024

Don't forget to cc jit-contrib on PRs.

Yep, I forgot because Jakob approved it before I requested for review to anyone 🙂

tmds pushed a commit to tmds/runtime that referenced this pull request Jan 23, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Feb 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants