HomePhabricator

Part of PR39508: Emit an @llvm.invariant.start after storing to

Description

Part of PR39508: Emit an @llvm.invariant.start after storing to
__tls_guard.

__tls_guard can only ever transition from 0 to 1, and only once. This
permits LLVM to remove repeated checks for TLS initialization and
repeated initialization code in cases like:

int g();
thread_local int n = g();
int a = n + n;

where we could not prove that __tls_guard was still 'true' when checking
it for the second reference to 'n' in the initializer of 'a'.

Details

Committed
rsmithOct 31 2018, 1:39 PM
Parents
rL345773: Remove unused internal template parameter.
Branches
Unknown
Tags
Unknown