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

The GetThread() function isn't being inlined on Win-x64 Release. #33341

Closed
AaronRobinsonMSFT opened this issue Mar 8, 2020 · 1 comment
Closed
Milestone

Comments

@AaronRobinsonMSFT
Copy link
Member

The GetThread() function is very small and is used extensively on start up (approximately 7400 calls).

EXTERN_C inline Thread* STDCALL GetThread()
{
return gCurrentThreadInfo.m_pThread;
}

It would be a good exercise to invesgigate why this very small, but commonly called function isn't being inlined.

Discovered during the work to make NativeCallableAttribute public.

/cc @jkotas

@Dotnet-GitSync-Bot
Copy link
Collaborator

I couldn't add an area label to this Issue.

Checkout this page to find out which area owner to ping, or please add exactly one area label to help train me in the future.

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Mar 8, 2020
@AaronRobinsonMSFT AaronRobinsonMSFT removed the untriaged New issue has not been triaged by the area owner label Mar 8, 2020
jkotas added a commit that referenced this issue Mar 9, 2020
)

GetThread() is no longer getting in latest MSVC and includes unnecessary call
to __dyn_tls_on_demand_init. Removing the extern "C" and applying a __declspec(selectany)
makes the compiler to generate same code as before.

Fixes for #33341
@ghost ghost locked as resolved and limited conversation to collaborators Dec 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants