HomePhabricator

Improve code generation for thread_local variables:

Authored by Richard Smith <richard-llvm@metafoo.co.uk> on Sep 12 2019, 1:00 PM.

Description

Improve code generation for thread_local variables:

Summary:

  • Don't bother using a thread wrapper when the variable is known to have constant initialization.
  • Emit the thread wrapper as discardable-if-unused in TUs that don't contain a definition of the thread_local variable.
  • Don't emit the thread wrapper at all if the thread_local variable is unused and discardable; it will be emitted by all TUs that need it.

Reviewers: rjmccall, jdoerfert

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D67429

llvm-svn: 371767

Event Timeline

Richard Smith <richard-llvm@metafoo.co.uk> committed rG00223827a952: Improve code generation for thread_local variables: (authored by Richard Smith <richard-llvm@metafoo.co.uk>).Sep 12 2019, 1:00 PM