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

Stop building JIT as altjit or not altjit #41643

Closed
BruceForstall opened this issue Sep 1, 2020 · 3 comments
Closed

Stop building JIT as altjit or not altjit #41643

BruceForstall opened this issue Sep 1, 2020 · 3 comments
Assignees
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Milestone

Comments

@BruceForstall
Copy link
Member

BruceForstall commented Sep 1, 2020

Currently, a JIT is built with the ALT_JIT define if it is intended to be used as an "altjit". Only when this is defined can a JIT define opts.altJit to true. This alters what functions are compiled by the JIT, and what COMPlus variables apply to the JIT versus the non-altjit.

This is problematic because we would like to be able to use any JIT in "altjit position" without this special build.

Proposal: the determination about whether a JIT is an altjit should be made via the JIT/EE interface. When the VM invokes the JIT, such as invokeCompileMethodHelper, it knows it is invoking an altjit:

 ret = jitMgr->m_alternateJit->compileMethod( comp,
                                              info,
                                              CORJIT_FLAGS::CORJIT_FLAG_CALL_GETJITFLAGS,
                                              nativeEntry,
                                              nativeSizeOfCode);

It should either tell the JIT (probably by a new method in the ICorJitCompiler interface; we typically can't change the compileMethod signature), or the JIT should use a callback on the JIT/EE interface to ask if it is an altjit.

This should help scenarios such as crossgen2, where all the cross-compilers could be built as "normal" JITs, and used both for crossgen2 cross-compilation as well as in altjit position for SuperPMI, for example. See #41126.

category:implementation
theme:altjit
skill-level:beginner
cost:small

@BruceForstall BruceForstall added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Sep 1, 2020
@BruceForstall BruceForstall added this to the 6.0.0 milestone Sep 1, 2020
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Sep 1, 2020
@BruceForstall BruceForstall removed the untriaged New issue has not been triaged by the area owner label Sep 1, 2020
@AndyAyersMS
Copy link
Member

Seems like this could just be toggled via a new jit flag?

Phase 1 would be to enable the jit to internally behave as an altjit or regular jit depending on a runtime provided value; initially this could just be hardwired in the jit to true/false.

Phase 2 would be to modify the interface (add flag, say) update the various jit hosts to set it appropriately, and update the jit to use the value of the flag.

@BruceForstall BruceForstall added the JitUntriaged CLR JIT issues needing additional triage label Oct 28, 2020
@BruceForstall BruceForstall self-assigned this Nov 5, 2020
@BruceForstall BruceForstall removed the JitUntriaged CLR JIT issues needing additional triage label Nov 5, 2020
@AndyAyersMS
Copy link
Member

@BruceForstall is this done?

@BruceForstall
Copy link
Member Author

Yes, fixed with #44565 and follow-ups

@ghost ghost locked as resolved and limited conversation to collaborators Dec 23, 2020
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

No branches or pull requests

3 participants