Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
f1c5228
wip
kunalspathak Jul 7, 2023
91ee21f
working model
kunalspathak Jul 10, 2023
fe242f1
wip
kunalspathak Jul 11, 2023
fcf00d2
wip
kunalspathak Jul 21, 2023
f736b2c
working
kunalspathak Jul 25, 2023
6cd92f3
Add helper for tlsIndex
kunalspathak Jul 25, 2023
87c3f25
add methods in superpmi
kunalspathak Jul 25, 2023
fb364a0
revert some local changes
kunalspathak Jul 25, 2023
e9610c6
misc fixes
kunalspathak Jul 25, 2023
86d01a7
Stop emitting TLS access code for windows/x64
kunalspathak Jul 25, 2023
09eaeb4
fix linux build errors
kunalspathak Jul 28, 2023
337c2f4
Do not throw not implemented for windows/x64
kunalspathak Jul 28, 2023
1209465
fix the problem where ThreadStaticBase helper was still getting invoked
kunalspathak Jul 28, 2023
85e1db6
Revert certain changes from JIT method
kunalspathak Jul 28, 2023
a3d3070
Introduce getThreadLocalStaticInfo_ReadyToRun()
kunalspathak Jul 29, 2023
800005d
Consume getThreadLocalStaticInfo_ReadyToRun()
kunalspathak Jul 29, 2023
4766211
Remove getTlsRootInfo() and other methods
kunalspathak Jul 29, 2023
b9adff7
Revert unneeded changes
kunalspathak Jul 29, 2023
9ca78ae
missing gtInitCldHnd initialization
kunalspathak Jul 30, 2023
b142d28
save target address
kunalspathak Jul 30, 2023
79de728
jit format
kunalspathak Jul 30, 2023
25482b9
Merge remote-tracking branch 'origin/main' into tls_nativeaot_winx64
kunalspathak Nov 20, 2023
1fe8103
run thunkgenerator
kunalspathak Nov 20, 2023
7c03b66
resolve merge conflicts
kunalspathak Dec 1, 2023
07c839b
fix issues so the TLS is inlined
kunalspathak Dec 1, 2023
65ceeaa
Rename data structures from *_ReadyToRun to *_NativeAOT
kunalspathak Dec 7, 2023
8af0e6e
Merge remote-tracking branch 'origin/main' into working_tls_nativeaot…
kunalspathak Dec 7, 2023
fc8e2b8
jit format
kunalspathak Dec 7, 2023
d7e7f9d
fix some unit test
kunalspathak Dec 8, 2023
b70ceeb
fix a bug
kunalspathak Dec 8, 2023
f6552f2
fix the weird jump problem
kunalspathak Dec 9, 2023
57893d8
use enclosing type cls handle for VN of static gc/non-gc helper
kunalspathak Dec 10, 2023
1537ecd
fix a bug of resetting the flag
kunalspathak Dec 11, 2023
ab95bb9
useEnclosingTypeOnly from runtime to determine if VN should optimize it
kunalspathak Dec 13, 2023
c9040a2
do not use vnf, but only use useEnclosingTypeAsArg0
kunalspathak Dec 14, 2023
5f76a6c
Use GT_COMMA to add GCStaticBase call next to TLS call
kunalspathak Dec 14, 2023
3d16881
Merge remote-tracking branch 'kp/vn_staticbase' into working_tls_nati…
kunalspathak Dec 14, 2023
daca626
optimize the cctor call
kunalspathak Dec 14, 2023
c7d75ef
Remove lazy ctor generation from tls
kunalspathak Dec 15, 2023
5895ab3
Update jitinterface to not fetch data for lazy ctor
kunalspathak Dec 15, 2023
d53f324
Merge remote-tracking branch 'origin/main' into working_tls_nativeaot…
kunalspathak Dec 15, 2023
571b6df
fix errors after merge
kunalspathak Dec 15, 2023
da95659
fix test build errors
kunalspathak Dec 16, 2023
8679e4b
fix bug in CSE
kunalspathak Dec 16, 2023
0ce7618
Use CORINFO_FLG_FIELD_INITCLASS instead of separate flag
kunalspathak Dec 18, 2023
b38a17c
Use the INITCLASS flag
kunalspathak Dec 18, 2023
1c1092d
Remove useEnclosingTypeOnly
kunalspathak Dec 19, 2023
119e2ae
Add NoCtor
kunalspathak Dec 19, 2023
9cfea39
Use CORINFO_HELP_READYTORUN_THREADSTATIC_BASE_NOCTOR
kunalspathak Dec 19, 2023
2cc3ca1
Minor cleanup
kunalspathak Dec 19, 2023
8389a88
Merge remote-tracking branch 'origin/main' into tls_nativeaot_winx64
kunalspathak Jan 3, 2024
59085d2
Renegenrate thunk
kunalspathak Jan 3, 2024
fa1059f
Add the SetFalseTarget
kunalspathak Jan 4, 2024
63c9fd6
Merge remote-tracking branch 'origin/main' into tls_nativeaot_winx64
kunalspathak Jan 10, 2024
0069167
fix merge conflict resolution
kunalspathak Jan 10, 2024
38bca3b
better handling of GTF_ICON_SECREL_OFFSET
kunalspathak Jan 10, 2024
a5fcc59
review feedback
kunalspathak Jan 10, 2024
ceda478
Disable optimization for minopts
kunalspathak Jan 11, 2024
aba00e2
Add comments around iiaSecRel
kunalspathak Jan 11, 2024
24f88a0
jit format
kunalspathak Jan 11, 2024
65f3900
create emitNewInstrCns()
kunalspathak Jan 11, 2024
5bc0a1a
Expand TLS even if optimization is disabled
kunalspathak Jan 12, 2024
959869a
Track t_inlinedThreadStaticBase
kunalspathak Jan 12, 2024
bff4728
jit format
kunalspathak Jan 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
optimize the cctor call
  • Loading branch information
kunalspathak committed Dec 14, 2023
commit daca626a189860d523f35563d715c3a04f46d91a
1 change: 1 addition & 0 deletions src/coreclr/jit/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2396,6 +2396,7 @@ unsigned ReinterpretHexAsDecimal(unsigned in)

void Compiler::compInitOptions(JitFlags* jitFlags)
{
useNewFeature = false;
opts = {};

if (compIsForInlining())
Expand Down
1 change: 1 addition & 0 deletions src/coreclr/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -2531,6 +2531,7 @@ class Compiler

#ifdef DEBUG
bool verbose;
bool useNewFeature;
bool verboseTrees;
bool shouldUseVerboseTrees();
bool asciiTrees; // If true, dump trees using only ASCII characters
Expand Down
33 changes: 20 additions & 13 deletions src/coreclr/jit/importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3860,24 +3860,31 @@ GenTree* Compiler::impImportStaticFieldAddress(CORINFO_RESOLVED_TOKEN* pResolved
}
else if (pFieldInfo->fieldAccessor == CORINFO_FIELD_STATIC_TLS_MANAGED_LAZY)
{
op1->AsCall()->SetExpTLSFieldAccessLazyCtor();
// TODO: Add GT_COMMA here.
// op1 = GT_COMMA(gtUnusedValue(CORINFO_HELP_READYTORUN_GCSTATIC_BASE), op1);
GenTreeCall* lazyCtorCall = gtNewHelperCallNode(CORINFO_HELP_READYTORUN_GCSTATIC_BASE, TYP_BYREF);
if (pResolvedToken->hClass == info.compClassHnd && m_preferredInitCctor == CORINFO_HELP_UNDEF)
{
m_preferredInitCctor = pFieldInfo->helper;
}
lazyCtorCall->setEntryPoint(pFieldInfo->fieldLookup);
lazyCtorCall->gtInitClsHnd = pResolvedToken->hClass;
lazyCtorCall->gtFlags |= callFlags;

op1->AsCall()->gtInitClsHnd = pResolvedToken->hClass;
op1->gtFlags |= callFlags;

op1->AsCall()->setEntryPoint(pFieldInfo->fieldLookup);

op1 = gtNewOperNode(GT_COMMA, op1->TypeGet(), gtUnusedValNode(lazyCtorCall), op1);
if (useNewFeature)
{
GenTreeCall* lazyCtorCall =
gtNewHelperCallNode(CORINFO_HELP_READYTORUN_GCSTATIC_BASE, TYP_BYREF);
if (pResolvedToken->hClass == info.compClassHnd && m_preferredInitCctor == CORINFO_HELP_UNDEF)
{
m_preferredInitCctor = pFieldInfo->helper;
}
lazyCtorCall->setEntryPoint(pFieldInfo->fieldLookup);
lazyCtorCall->gtInitClsHnd = pResolvedToken->hClass;
lazyCtorCall->gtFlags |= callFlags;
lazyCtorCall->SetArgNeedsEnclosingType();

op1 = gtNewOperNode(GT_COMMA, op1->TypeGet(), gtUnusedValNode(lazyCtorCall), op1);
}
else
{
op1->AsCall()->SetExpTLSFieldAccessLazyCtor();
}

op1 = gtNewOperNode(GT_ADD, op1->TypeGet(), op1, gtNewIconNode(pFieldInfo->offset, innerFldSeq));
break;
}
Expand Down
3 changes: 1 addition & 2 deletions src/coreclr/jit/valuenum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12366,8 +12366,7 @@ void Compiler::fgValueNumberHelperCallFunc(GenTreeCall* call, VNFunc vnf, ValueN
{
if (IsTargetAbi(CORINFO_NATIVEAOT_ABI))
{
// TODO: Do this for R2R as well
if (call->IsArgNeedsEnclosingType())
if (call->IsArgNeedsEnclosingType() && useNewFeature)
{
useEnclosingTypeAsArg0 = true;
assert((call->gtInitClsHnd != NO_CLASS_HANDLE) && ((ssize_t)call->gtInitClsHnd != 0xcccccccc));
Expand Down