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

NativeAOT: Ignore preferSize and always expand TLS #97187

Merged
merged 2 commits into from
Jan 19, 2024
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
Loading