Use alias linkage and visibility to decide tls access mode.
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 23 May 2014 19:16:56 +0000 (19:16 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 23 May 2014 19:16:56 +0000 (19:16 +0000)
commitef72e73da9518b4de85120d40907297fd514aca3
tree40257e104e29e1d5f5663e08e88f01fd5da9a3c6
parentb16514017b8f1c6b9c38a9712354d4dc2fb52071
Use alias linkage and visibility to decide tls access mode.

This matches both what we do for the non-thread case and what gcc does.

With this patch clang would match gcc's behaviour in

static __thread int a = 42;
extern __thread int b __attribute__((alias("a")));
int *f(void) { return &a; }
int *g(void) { return &b; }

if not for pr19843. Manually writing the IL does produce the same access modes.

It is also a step in the direction of fixing pr19844.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209543 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/TargetMachine.cpp
test/CodeGen/Mips/tls-alias.ll
test/CodeGen/X86/2008-03-12-ThreadLocalAlias.ll