forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JIT] Add support to inline the field access of primitive types marke…
…d with TLS (dotnet#82973) * Add CORINFO_THREAD_LOCAL_FIELD_INFO and getThreadLocalFieldInfo() * Implementation of getThreadLocalFieldInfo() * Change the field types from CORINFO_CONST_LOOKUP to uint32_t * Introduce CORINFO_FIELD_STATIC_TLS_MANAGED * Introduce GTF_FLD_TLS_MANAGED * Introduce eeGetThreadLocalFieldInfo() * Fix the offsetOfThreadStaticBlocks, hardcode threadStaticBlockIndex for now * Add impThreadLocalFieldAccess() * Switch to GS segment register with a TODO * Add reverse map `g_threadStaticBlockTypeIDMap` for type -> ID * Fix GS segment register encoding * Add comment for g_threadStaticBlockTypeIDMap * Add extra parameter for typeIndex in JIT_GetSharedNonGCThreadStaticBase * Update JIT_GetSharedNonGCThreadStaticBase to add logic for storing typeIndex in t_threadStaticBlocks * Fix encoding of gs:[0x58] * fix some bugs in importer to change size from 4 to 8 * add some printf in jithelpers * To revert * Update the helper to skip making re-entry for staticBlock * Add impThreadLocalFieldWrite() for store * Fix a issue for helper * Use JITDUMP * Just enable the optimization for primitive types * Update the JITEE guid * Fix an assert for volatile variables * Mark helper block as cold block * wip * Fix the size of maxThreadStaticBlock * fix a bug to insert the entry in cache * Add #ifdef for HOST_WINDOWS / TARGET_WINDOWS * Dynamic memory allocation for static block array * Call InitTypeMap only if host == windows * Add CORINFO_HELP_GETSHARED_NONGCTHREADSTATIC_BASE_NOCTOR_OPTIMIZED * Expand the TLS field access in late phase * Move rarely ran block to the end * wip * Fix the bug to access the value from fastPath * Remove code from importer * Cleanup the code * Moved CreateBlockFromTree to fgbasic.cpp * Move fgExpandThreadLocalAccess() to flowgraph.cpp * Add getThreadLocalStaticBlocksInfo() method * Consume getThreadLocalStaticBlocksInfo() method * Updated definition of getThreadLocalFieldInfo() * Rename CORINFO_THREAD_LOCAL_FIELD_INFO to CORINFO_THREAD_STATIC_BLOCKS_INFO * Add TARGET_WINDOWS * Make TARGET_WINDOWS at some definitions * Add dummy definition for unix * jit format * remote unnecessary code from morph * Fix an issue on linux, add assert for tls_index != 0 * Convert from TARGET_WINDOWS to HOST_WINDOWS * jit format * fix the if-check * fix gcc build error * Added MethodHaveTlsFieldAccess() * Handle the case for '_tls_index == 0' * fix a typo * Fix windows/arm64 issue * fix encoding of teb loading for arm64 * Fix the condition in jitinterface to select correct helper * fix the condition for other helper too * fix the windows/x86 case * jit format * Use CORINFO_CONST_LOOKUP for _tls_index * Move typeIdMap to BaseDomain class * Introduce useFatPointerDispatch parameter for GetTypeID() * jit format * Do not pass classID and moduleID to the new helper * fix build for non-windows * fix superpmi methods * review feedback * fix linux build errors * review feedback * fix weight inherit * inline JIT_GetNonGCThreadStaticBase_Helper to fix the contract error * Remove dead code from helper * Add GTF_CALL_M_EXP_TLS_ACCESS to check if we do not revisit the already expanded call node * address feedback * regenerate the files * Introduce fgExpandHelper and fgExpandHelperForBlock and reuse it for various helper expansion * fix the typo * update the assert for runtimelookup * check if we should skip rarely run blocks * review feedback * Remove GTF_IND_INVARIANT from `typeIndex` access because it produces nullptr 1st time and valid value 2nd time onwards
- Loading branch information
1 parent
b68f669
commit 563408a
Showing
48 changed files
with
1,821 additions
and
895 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.