1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-24 05:23:45 +02:00
llvm-mirror/test
Oliver Stannard 282bb1aaf0 [Thumb] Save/restore high registers in Thumb1 pro/epilogues
The high registers are not allocatable in Thumb1 functions, but they
could still be used by inline assembly, so we need to save and restore
the callee-saved high registers (r8-r11) in the prologue and epilogue.

This is complicated by the fact that the Thumb1 push and pop
instructions cannot access these registers. Therefore, we have to move
them down into low registers before pushing, and move them back after
popping into low registers.

In most functions, we will have low registers that are also being
pushed/popped, which we can use as the temporary registers for
saving/restoring the high registers. However, this is not guaranteed, so
we may need to push some extra low registers to ensure that the high
registers can be saved/restored. For correctness, it would be sufficient
to use just one low register, but if we have enough low registers
available then we only need one push/pop instruction, rather than one
per high register.

We can also use the argument/return registers when they are not live,
and the link register when saving (but not restoring), reducing the
number of extra registers we need to push.

There are still a few extreme edge cases where we need two push/pop
instructions, because not enough low registers can be made live in the
prologue or epilogue.

In addition to the regression tests included here, I've also tested this
using a script to generate functions which clobber different
combinations of registers, have different numbers of argument and return
registers (including variadic arguments), allocate different fixed sized
objects on the stack, and do or don't use variable sized allocas and the
__builtin_return_address intrinsic (all of which affect the available
registers in the prologue and epilogue). I ran these functions in a test
harness which verifies that all of the callee-saved registers are
correctly preserved.

Differential Revision: https://reviews.llvm.org/D24228

llvm-svn: 283867
2016-10-11 10:12:25 +00:00
..
Analysis [ValueTracking] Fix crash in GetPointerBaseWithConstantOffset() 2016-10-07 14:23:29 +00:00
Assembler Fix IntegerType::MAX_INT_BITS value 2016-10-04 12:43:46 +00:00
Bindings
Bitcode Teach llvm::StripDebugInfo() about global variable !dbg attachments. 2016-10-10 17:53:33 +00:00
BugPoint Revert "Add -strip-nonlinetable-debuginfo capability" 2016-10-06 18:30:26 +00:00
CodeGen [Thumb] Save/restore high registers in Thumb1 pro/epilogues 2016-10-11 10:12:25 +00:00
DebugInfo Teach llvm::StripDebugInfo() about global variable !dbg attachments. 2016-10-10 17:53:33 +00:00
Demangle
Examples
ExecutionEngine
Feature
FileCheck
Instrumentation [ASAN] Add the binder globals on Darwin to llvm.compiler.used to avoid LTO dead-stripping 2016-10-01 00:05:34 +00:00
Integer
JitListener
LibDriver
Linker
LTO Don't drop the llvm. prefix when renaming. 2016-10-03 15:51:42 +00:00
MC [AArch64] Allow label arithmetic with add/sub/cmp 2016-10-11 09:17:47 +00:00
Object Reverted r283740 [Object/ELF] - Do not crash on invalid Header->e_shoff value. 2016-10-11 08:12:27 +00:00
ObjectYAML
Other
SymbolRewriter
TableGen
ThinLTO/X86 ThinLTO: don't perform incremental LTO on module without a hash 2016-10-08 04:44:23 +00:00
tools ThinLTO: Fix Gold test after caching fix in r283655 2016-10-08 22:49:28 +00:00
Transforms [InstCombine] Transform !range metadata to !nonnull when combining loads 2016-10-11 01:00:45 +00:00
Unit
Verifier Verifier: Reject any unknown named MD nodes in the llvm.dbg namespace. 2016-10-05 22:15:37 +00:00
YAMLParser
.clang-format
CMakeLists.txt Add an llvm-opt-report tool to generate basic source-annotated optimization summaries 2016-10-05 22:10:35 +00:00
lit.cfg cmake: Install the OCaml libraries into a more correct path 2016-09-30 18:34:23 +00:00
lit.site.cfg.in
TestRunner.sh