-
Notifications
You must be signed in to change notification settings - Fork 156
AOTIR: Initial implementation #730
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
phire
reviewed
Feb 5, 2021
…teCode Entrypoint-relative
phire
reviewed
Feb 23, 2021
@@ -209,8 +210,10 @@ class JITCore final : public CPUBackend, public Xbyak::CodeGenerator { | |||
|
|||
///< ALU Ops | |||
DEF_OP(TruncElementPair); | |||
DEF_OP(Constant); | |||
DEF_OP(Constant); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace
phire
reviewed
Feb 23, 2021
@@ -535,6 +537,8 @@ namespace FEXCore::IR { | |||
for (uint8_t i = 0; i < NumArgs; ++i) { | |||
if (IROp->Args[i].IsInvalid()) continue; | |||
if (IR->GetOp<IROp_Header>(IROp->Args[i])->Op == OP_INLINECONSTANT) continue; | |||
if (IR->GetOp<IROp_Header>(IROp->Args[i])->Op == OP_INLINEENTRYPOINTOFFSET) continue; | |||
if (IR->GetOp<IROp_Header>(IROp->Args[i])->Op == OP_IRHEADER) continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be based on an IR.json property. Can be done in a follow up ticket
phire
approved these changes
Feb 23, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This adds IR caching support. In FEXLoader,
--aotir-capture
will catpure ir during execution and generate~/.fex-emu/aotir/<module>-<pathhash>-<optoptions>
for all elfs loaded by the process, and--aotir-load
will load them.Currently, only one process can update the aotir cache, so programs that fork won't work well with
--aotir-capture
IR Caches hash verify the guest code (usting some fasthash), though we likely want to use native CRC support in arm for faster hashing.
IR Caches are also relocated on use.
I've successfully run clang, clang++, FTL, gnome-calculator and gnome-text-editor. Load time speedup is 2x to 3x vs non-cached.
IR Loading is done via c++ streams, and could be much further optimized.
To append to the cache, both
--aotir-load
and--aotir-capture
need to be passed toFEXLoader
.This also includes a fix for
exit_group
, which GLib programs need to exit cleanly.Details
--aotir-capture
and--aotir-load
AddNamedRegion
andRemoveNamedRegion
to Context/Core.cpp to keep track of addr -> file mappingsWriteAOTIRCache
andSetAOTIRLoader
IsShared
toRAData
andIRListView
, updates deleters, so that data from AOTIR can be imported directly to the thread local listsIRLists
andRALists
andDebugData
toLocalIRCache
Todo
Follow ups
Future work