llvm-6502/test
Ulrich Weigand 0c57babfc6 [PowerPC] Simplify and improve loading into TOC register
During an indirect function call sequence on the 64-bit SVR4 ABI,
generate code must load and then restore the TOC register.

This does not use a regular LOAD instruction since the TOC
register r2 is marked as reserved.  Instead, the are two
special instruction patterns:

 let RST = 2, DS = 2 in
 def LDinto_toc: DSForm_1a<58, 0, (outs), (ins g8rc:$reg),
                     "ld 2, 8($reg)", IIC_LdStLD,
                     [(PPCload_toc i64:$reg)]>, isPPC64;
 
 let RST = 2, DS = 10, RA = 1 in
 def LDtoc_restore : DSForm_1a<58, 0, (outs), (ins),
                     "ld 2, 40(1)", IIC_LdStLD,
                     [(PPCtoc_restore)]>, isPPC64;

Note that these not only restrict the destination of the
load to r2, but they also restrict the *source* of the
load to particular address combinations.  The latter is
a problem when we want to support the ELFv2 ABI, since
there the TOC save slot is no longer at 40(1).

This patch replaces those two instructions with a single
instruction pattern that only hard-codes r2 as destination,
but supports generic addresses as source.  This will allow
supporting the ELFv2 ABI, and also helps generate more
efficient code for calls to absolute addresses (allowing
simplification of the ppc64-calls.ll test case).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211193 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-18 17:52:49 +00:00
..
Analysis Reduce verbiage of lit.local.cfg files 2014-06-09 22:42:55 +00:00
Assembler Canonicalize addrspacecast ConstExpr between different pointer types 2014-06-15 21:40:57 +00:00
Bindings Reduce verbiage of lit.local.cfg files 2014-06-09 22:42:55 +00:00
Bitcode IR: add "cmpxchg weak" variant to support permitted failure. 2014-06-13 14:24:07 +00:00
BugPoint
CodeGen [PowerPC] Simplify and improve loading into TOC register 2014-06-18 17:52:49 +00:00
DebugInfo Allow X86FastIsel to cope with 64 bit absolute relocations 2014-06-17 23:22:41 +00:00
ExecutionEngine mark the old jit tests as unsupported for powerpc64 (for cmake) 2014-06-17 17:04:42 +00:00
Feature Move test for r210734 to Feature/aliases.ll. 2014-06-12 21:37:30 +00:00
FileCheck
Instrumentation [msan] Handle X86 *.psad.* and *.pmadd.* intrinsics. 2014-06-18 12:02:29 +00:00
Integer
JitListener
Linker Allow aliases to be unnamed_addr. 2014-06-06 01:20:28 +00:00
LTO Reduce verbiage of lit.local.cfg files 2014-06-09 22:42:55 +00:00
MC [mips] SYNC $stype instruction was added in Mips32 2014-06-18 17:10:30 +00:00
Object Add "-format darwin" to llvm-size to be like darwin's size(1) -m output, and 2014-06-17 17:54:13 +00:00
Other Canonicalize addrspacecast ConstExpr between different pointer types 2014-06-15 21:40:57 +00:00
TableGen Fix error in tablegen when either operand of !if is an empty list. 2014-06-10 20:10:08 +00:00
tools Do not XFAIL test/tools/llvm-cov tests on powerpc64le 2014-06-18 15:52:18 +00:00
Transforms Fixed jump threading going to infinite loop. 2014-06-17 14:34:19 +00:00
Unit
Verifier Move test for r210734 to Feature/aliases.ll. 2014-06-12 21:37:30 +00:00
YAMLParser
.clang-format
CMakeLists.txt OK, NAKAMURA Takumi beat me to this change. So backing out my addition of 2014-05-19 23:26:51 +00:00
lit.cfg Reduce verbiage of lit.local.cfg files 2014-06-09 22:42:55 +00:00
lit.site.cfg.in
Makefile lld test for configure & make 2014-06-06 09:06:25 +00:00
Makefile.tests
TestRunner.sh