llvm-6502/include/llvm/Support
Bill Schmidt d7802bf0dd This patch introduces initial-exec model support for thread-local storage
on 64-bit PowerPC ELF.

The patch includes code to handle external assembly and MC output with the
integrated assembler.  It intentionally does not support the "old" JIT.

For the initial-exec TLS model, the ABI requires the following to calculate
the address of external thread-local variable x:

 Code sequence            Relocation                  Symbol
  ld 9,x@got@tprel(2)      R_PPC64_GOT_TPREL16_DS      x
  add 9,9,x@tls            R_PPC64_TLS                 x

The register 9 is arbitrary here.  The linker will replace x@got@tprel
with the offset relative to the thread pointer to the generated GOT
entry for symbol x.  It will replace x@tls with the thread-pointer
register (13).

The two test cases verify correct assembly output and relocation output
as just described.

PowerPC-specific selection node variants are added for the two
instructions above:  LD_GOT_TPREL and ADD_TLS.  These are inserted
when an initial-exec global variable is encountered by
PPCTargetLowering::LowerGlobalTLSAddress(), and later lowered to
machine instructions LDgotTPREL and ADD8TLS.  LDgotTPREL is a pseudo
that uses the same LDrs support added for medium code model's LDtocL,
with a different relocation type.

The rest of the processing is straightforward.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169281 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-04 16:18:08 +00:00
..
AIXDataTypesFix.h
AlignOf.h xlc supports __attribute__((aligned(x))), use it. 2012-10-31 00:54:26 +00:00
Allocator.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
Atomic.h
BlockFrequency.h Add missing includes/class declaration. 2011-11-04 18:30:30 +00:00
BranchProbability.h Make an obviously const interface actually be marked as const. 2011-11-20 11:22:03 +00:00
CallSite.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
Capacity.h Add missing includes/class declaration. 2011-11-04 18:30:30 +00:00
Casting.h Casting.h: Automatically handle isa<Base>(Derived). 2012-10-11 23:30:40 +00:00
CFG.h Calls and invokes with the new clang.arc.no_objc_arc_exceptions 2012-02-17 18:59:53 +00:00
circular_raw_ostream.h Use empty parens for empty function parameter list instead of '(void)'. 2012-11-15 16:51:49 +00:00
CodeGen.h Move the TLSModel information into the TargetMachine rather than hiding 2012-04-08 17:20:55 +00:00
COFF.h [yaml2obj] Fix incorrect use of signed values. 2012-08-14 22:42:31 +00:00
CommandLine.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
Compiler.h Switch LLVM_USE_RVALUE_REFERENCES to LLVM_HAS_RVALUE_REFERENCES. 2012-11-30 11:45:22 +00:00
ConstantFolder.h
ConstantRange.h add ConstantRange::difference (to perform set difference/relative complement) 2012-06-28 16:10:13 +00:00
CrashRecoveryContext.h
DataExtractor.h Add a relocation visitor to lib object. This works via caching relocated 2012-11-07 23:22:07 +00:00
DataFlow.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
DataStream.h Fix comment-rulers. 2012-02-06 22:41:47 +00:00
DataTypes.h.cmake Remove OpenBSD defines: 2012-08-08 18:37:39 +00:00
DataTypes.h.in Remove OpenBSD defines: 2012-08-08 18:37:39 +00:00
Debug.h Typos. 2012-07-27 21:41:59 +00:00
DebugLoc.h Pull the simple parts of DenseMapInfo<DebugLoc> inline and prune includes. 2012-07-19 15:00:34 +00:00
Disassembler.h
DOTGraphTraits.h Delete names for unused parameters in inline function definitions in headers, so LLVM users can compile with -Wunused-parameter. PR11257; based on patch by Kevin Harris. 2011-11-04 18:11:56 +00:00
Dwarf.h Add constant definitions for fission dwarf attributes, forms, etc. 2012-11-16 23:04:31 +00:00
DynamicLibrary.h Add missing includes/class declaration. 2011-11-04 18:30:30 +00:00
ELF.h This patch introduces initial-exec model support for thread-local storage 2012-12-04 16:18:08 +00:00
Endian.h Remove 'static' from inline functions defined in header files. 2012-06-20 08:39:33 +00:00
Errno.h
ErrorHandling.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
FEnv.h
FileOutputBuffer.h [Support] Make FileOutputBuffer work on Windows. 2012-12-03 22:09:52 +00:00
FileSystem.h Switch LLVM_USE_RVALUE_REFERENCES to LLVM_HAS_RVALUE_REFERENCES. 2012-11-30 11:45:22 +00:00
FileUtilities.h
Format.h Fix Doxygen issues: 2012-09-14 14:57:36 +00:00
FormattedStream.h Add LLVM_OVERRIDE to methods that override their base classes. 2012-09-23 02:12:10 +00:00
GCOV.h Stop casting away const qualifier needlessly. 2012-09-05 22:26:57 +00:00
GetElementPtrTypeIterator.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
GraphWriter.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
Host.h revert r147542 after comments from Joerg Sonnenberger 2012-01-05 18:28:46 +00:00
IncludeFile.h
InstIterator.h
IntegersSubset.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
IntegersSubsetMapping.h BranchProb: modify the definition of an edge in BranchProbabilityInfo to handle 2012-08-24 18:14:27 +00:00
IRReader.h Make SMDiagnostic a little more sane. Instead of passing around note/warning/error as a 2011-10-16 05:43:57 +00:00
LeakDetector.h
LEB128.h Fix a couple include directives that used angle brackets for llvm files. 2012-09-15 18:41:37 +00:00
LICENSE.TXT
Locale.h platform support for counting column widths and checking isprint 2012-04-17 20:03:03 +00:00
LockFileManager.h Use LLVM_DELETED_FUNCTION for copy constructors and copy assignment operators that aren't implemented. 2012-09-16 21:37:56 +00:00
MachO.h Remove tabs. 2012-07-19 00:01:00 +00:00
ManagedStatic.h Add support for tsan annotations (thread sanitizer, a valgrind-based tool). 2011-11-14 20:50:16 +00:00
MathExtras.h Fix Doxygen issues: 2012-09-13 12:34:29 +00:00
Memory.h Correcting enum values mentioned in comments. 2012-10-12 21:47:49 +00:00
MemoryBuffer.h Use LLVM_DELETED_FUNCTION for copy constructors and copy assignment operators that aren't implemented. 2012-09-16 21:37:56 +00:00
MemoryObject.h Make MemoryObject accessor members const again 2012-02-29 01:09:06 +00:00
Mutex.h Use LLVM_DELETED_FUNCTION for copy constructors and copy assignment operators that aren't implemented. 2012-09-16 21:37:56 +00:00
MutexGuard.h Mark unimplemented copy constructors and copy assignment operators as LLVM_DELETED_FUNCTION. 2012-09-17 06:31:17 +00:00
NoFolder.h Insertion of NoFolder functions to avoid ambiguous overload warnings or errors about whether to convert Idx to ArrayRef<Constant *> or ArrayRef<Value *> like ConstantFolder and TargetFolder. 2012-08-17 08:54:57 +00:00
OutputBuffer.h
PassNameParser.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
Path.h
PathV1.h Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. See: http://en.wikipedia.org/wiki/If_and_only_if Commit 164767 2012-09-27 10:14:43 +00:00
PathV2.h Fix a doxygen issue: these examples are supposed to be displayed preformatted. 2012-09-13 11:42:30 +00:00
PatternMatch.h Revert commit 149912 (lattner) and add a testcase that shows the problem (which 2012-02-10 14:26:42 +00:00
PluginLoader.h
PointerLikeTypeTraits.h
PredIteratorCache.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
PrettyStackTrace.h Add LLVM_OVERRIDE to methods that override their base classes. 2012-09-23 02:12:10 +00:00
Process.h Process: Add sys::Process::FileDescriptorHasColors(). 2012-07-20 18:29:38 +00:00
Program.h Use LLVM_DELETED_FUNCTION for copy constructors and copy assignment operators that aren't implemented. 2012-09-16 21:37:56 +00:00
raw_os_ostream.h Add LLVM_OVERRIDE to methods that override their base classes. 2012-09-23 02:12:10 +00:00
raw_ostream.h Add LLVM_OVERRIDE to methods that override their base classes. 2012-09-23 02:12:10 +00:00
Recycler.h Convert assert(0) to llvm_unreachable 2012-02-05 22:14:15 +00:00
RecyclingAllocator.h
Regex.h Add backreference matching capabilities to Support/Regex, with 2012-11-28 19:00:02 +00:00
Registry.h Mark unimplemented copy constructors and copy assignment operators as LLVM_DELETED_FUNCTION. 2012-09-17 06:31:17 +00:00
RegistryParser.h
RWMutex.h Use LLVM_DELETED_FUNCTION for copy constructors and copy assignment operators that aren't implemented. 2012-09-16 21:37:56 +00:00
SaveAndRestore.h Move include/llvm/ADT/SaveAndRestore.h -> include/llvm/Support/SaveAndRestore.h 2012-03-01 19:45:47 +00:00
Signals.h
SMLoc.h Remove some trivial copy ctors so the classes become trivially copyable and get the optimized SmallVector implementation. 2012-07-08 19:47:51 +00:00
Solaris.h
SourceMgr.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
StreamableMemoryObject.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
StringPool.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
SwapByteOrder.h
system_error.h Add LLVM_OVERRIDE to methods that override their base classes. 2012-09-23 02:12:10 +00:00
SystemUtils.h
TargetFolder.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
TargetRegistry.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
TargetSelect.h Add InitializeNativeTargetDisassembler function. 2012-03-26 21:56:56 +00:00
Threading.h Fix Doxygen issues: 2012-09-13 12:34:29 +00:00
ThreadLocal.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
Timer.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
TimeValue.h Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. See: http://en.wikipedia.org/wiki/If_and_only_if Commit 164767 2012-09-27 10:14:43 +00:00
ToolOutputFile.h
type_traits.h Fix some code which is invalid in C++11: an expression of enumeration type 2012-09-13 21:18:18 +00:00
Valgrind.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
ValueHandle.h Mark unimplemented copy constructors and copy assignment operators as LLVM_DELETED_FUNCTION. 2012-09-17 06:31:17 +00:00
Win64EH.h
YAMLParser.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00