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

Skip to content
Merged
Changes from all commits
Commits
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
14 changes: 9 additions & 5 deletions src/coreclr/jit/helperexpansion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,9 +442,15 @@ PhaseStatus Compiler::fgExpandThreadLocalAccess()
return result;
}

// Always expand for NativeAOT because the TLS access will not be generated by NativeAOT
// Always expand for NativeAOT because the slow TLS access helper will not be generated by NativeAOT
const bool isNativeAOT = IsTargetAbi(CORINFO_NATIVEAOT_ABI);
if (!isNativeAOT && opts.OptimizationDisabled())
if (isNativeAOT)
{
return fgExpandHelper<&Compiler::fgExpandThreadLocalAccessForCallNativeAOT>(
false /* expand rarely run blocks for NativeAOT */);
}

if (opts.OptimizationDisabled())
{
JITDUMP("Optimizations aren't allowed - bail out.\n")
return result;
Expand All @@ -459,9 +465,7 @@ PhaseStatus Compiler::fgExpandThreadLocalAccess()
return result;
}

return isNativeAOT ? fgExpandHelper<&Compiler::fgExpandThreadLocalAccessForCallNativeAOT>(
false /* expand rarely run blocks for NativeAOT */)
: fgExpandHelper<&Compiler::fgExpandThreadLocalAccessForCall>(true);
return fgExpandHelper<&Compiler::fgExpandThreadLocalAccessForCall>(true);
}

//------------------------------------------------------------------------------
Expand Down