diff options
| author | Hans Wennborg <hans@hanshq.net> | 2012-06-01 16:27:21 +0000 |
|---|---|---|
| committer | Hans Wennborg <hans@hanshq.net> | 2012-06-01 16:27:21 +0000 |
| commit | 789acfb63d66b724c431bea498a89ebe61c33bc0 (patch) | |
| tree | a996b2a733d8ff873bb3c3eb3b406c4f201d2218 /llvm/lib/Target/X86/X86TargetMachine.cpp | |
| parent | dc191a184f5b5d1bc9b003166eea610511801806 (diff) | |
| download | bcm5719-llvm-789acfb63d66b724c431bea498a89ebe61c33bc0.tar.gz bcm5719-llvm-789acfb63d66b724c431bea498a89ebe61c33bc0.zip | |
Implement the local-dynamic TLS model for x86 (PR3985)
This implements codegen support for accesses to thread-local variables
using the local-dynamic model, and adds a clean-up pass so that the base
address for the TLS block can be re-used between local-dynamic access on
an execution path.
llvm-svn: 157818
Diffstat (limited to 'llvm/lib/Target/X86/X86TargetMachine.cpp')
| -rw-r--r-- | llvm/lib/Target/X86/X86TargetMachine.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86TargetMachine.cpp b/llvm/lib/Target/X86/X86TargetMachine.cpp index 89c388415bd..c066a5603db 100644 --- a/llvm/lib/Target/X86/X86TargetMachine.cpp +++ b/llvm/lib/Target/X86/X86TargetMachine.cpp @@ -147,6 +147,10 @@ bool X86PassConfig::addInstSelector() { // Install an instruction selector. PM->add(createX86ISelDag(getX86TargetMachine(), getOptLevel())); + // For ELF, cleanup any local-dynamic TLS accesses. + if (getX86Subtarget().isTargetELF() && getOptLevel() != CodeGenOpt::None) + PM->add(createCleanupLocalDynamicTLSPass()); + // For 32-bit, prepend instructions to set the "global base reg" for PIC. if (!getX86Subtarget().is64Bit()) PM->add(createGlobalBaseRegPass()); |

