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)
commita5bb2f61cfb8a707cf20b61bc13bf3f3d60c50f5
tree3aed1affc220cd72906bd67ba29f70b2195d3b7b
parentffd8a3364c700f560b5d37e32364b5e53041f1cb
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.

llvm-svn: 209543
llvm/lib/Target/TargetMachine.cpp
llvm/test/CodeGen/Mips/tls-alias.ll
llvm/test/CodeGen/X86/2008-03-12-ThreadLocalAlias.ll