1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-24 05:23:45 +02:00
llvm-mirror/test/CodeGen/Thumb
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
..
2007-01-31-RegInfoAssert.ll [opaque pointer type] Add textual IR support for explicit type parameter to the call instruction 2015-04-16 23:24:18 +00:00
2007-02-02-JoinIntervalsCrash.ll
2007-05-05-InvalidPushPop.ll [opaque pointer type] Add textual IR support for explicit type parameter to the call instruction 2015-04-16 23:24:18 +00:00
2009-06-18-ThumbCommuteMul.ll
2009-07-20-TwoAddrBug.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
2009-07-27-PEIAssert.ll
2009-08-12-ConstIslandAssert.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
2009-08-12-RegInfoAssert.ll [opaque pointer type] Add textual IR support for explicit type parameter to gep operator 2015-03-13 18:20:45 +00:00
2009-08-20-ISelBug.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
2009-12-17-pre-regalloc-taildup.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
2010-06-18-SibCallCrash.ll
2010-07-01-FuncAlign.ll [MC] Use .p2align instead of .align 2016-01-26 00:03:25 +00:00
2010-07-15-debugOrdering.ll Revert "In visitSTORE, always use FindBetterChain, rather than only when UseAA is enabled." 2016-09-28 16:37:50 +00:00
2011-05-11-DAGLegalizer.ll Revert "Change memcpy/memset/memmove to have dest and source alignments." 2015-11-19 05:56:52 +00:00
2011-06-16-NoGPRs.ll [opaque pointer type] Add textual IR support for explicit type parameter to the call instruction 2015-04-16 23:24:18 +00:00
2011-EpilogueBug.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
2012-04-26-M0ISelBug.ll
2014-06-10-thumb1-ldst-opt-bug.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
and_neg.ll Add a regression test for PR28348. 2016-06-29 17:34:31 +00:00
asmprinter-bug.ll [opaque pointer type] Add textual IR support for explicit type parameter to the call instruction 2015-04-16 23:24:18 +00:00
barrier.ll ARM: stop emitting blx instructions for most calls on MachO. 2016-05-10 19:17:47 +00:00
bic_imm.ll [Thumb] Reapply r272251 with a fix for PR28348 (mk 2) 2016-07-05 12:37:13 +00:00
callee_save.ll [Thumb] Save/restore high registers in Thumb1 pro/epilogues 2016-10-11 10:12:25 +00:00
cmp-add-fold.ll [Thumb] Select (CMPZ X, -C) -> (CMPZ (ADDS X, C), 0) 2016-09-09 12:52:24 +00:00
cmp-fold.ll [Thumb1] Teach optimizeCompareInstr about thumb1 compares 2016-09-09 09:51:06 +00:00
constants.ll [Thumb] Fix off-by-one error in r272007 2016-06-14 13:33:07 +00:00
copy_thumb.ll
cortex-m0-unaligned-access.ll [ARM] Define subtarget feature strict-align. 2015-07-28 22:44:28 +00:00
DbgValueOtherTargets.test
dyn-stackalloc.ll Revert "Change memcpy/memset/memmove to have dest and source alignments." 2015-11-19 05:56:52 +00:00
fastcc.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
fpconv.ll ARM: yet another round of ARM test clean ups 2014-04-03 23:47:24 +00:00
fpow.ll
frame_thumb.ll
iabs.ll Re-add support to llvm-objdump for Mach-O universal files and archives with -macho 2014-12-04 23:56:27 +00:00
inlineasm-imm-thumb.ll
inlineasm-thumb.ll
ispositive.ll
large-stack.ll [Thumb] Save/restore high registers in Thumb1 pro/epilogues 2016-10-11 10:12:25 +00:00
ldm-merge-call.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
ldm-merge-struct.ll Fix tests that used CHECK-NEXT-NOT and CHECK-DAG-NOT. 2016-02-26 19:40:34 +00:00
ldm-stm-base-materialization-thumb2.ll [ARM] Modify codegen for memcpy intrinsic to prefer LDM/STM. 2015-10-05 14:49:54 +00:00
ldm-stm-base-materialization.ll Revert "Change memcpy/memset/memmove to have dest and source alignments." 2015-11-19 05:56:52 +00:00
ldm-stm-postinc.ll [Thumb-1] Select post-increment load and store where possible 2016-07-15 08:03:56 +00:00
ldr_ext.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
ldr_frame.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
lit.local.cfg
long_shift.ll
long-setcc.ll
long.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
mature-mc-support.ll
mul.ll
pop.ll [ARM] Refactor the prologue/epilogue emission to be more robust. 2015-07-20 21:42:14 +00:00
PR17309.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
push.ll [ARM] Generate consistent frame records for Thumb2 2016-08-23 09:19:22 +00:00
rev.ll
segmented-stacks-dynamic.ll Move the segmented stack switch to a function attribute 2014-04-10 22:58:43 +00:00
segmented-stacks.ll [MC] Use .p2align instead of .align 2016-01-26 00:03:25 +00:00
select.ll
sjljehprepare-lower-vector.ll Move the personality function from LandingPadInst to Function 2015-06-17 20:52:32 +00:00
stack_guard_remat.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
stack-access.ll Revert "In visitSTORE, always use FindBetterChain, rather than only when UseAA is enabled." 2016-09-28 16:37:50 +00:00
stack-coloring-without-frame-ptr.ll Revert "Change memcpy/memset/memmove to have dest and source alignments." 2015-11-19 05:56:52 +00:00
stack-frame.ll
stm-merge.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
thumb-imm.ll
thumb-ldm.ll [opaque pointer type] Add textual IR support for explicit type parameter to gep operator 2015-03-13 18:20:45 +00:00
thumb-shrink-wrapping.ll Revert "[Thumb] Teach ISel how to lower compares of AND bitmasks efficiently" 2016-09-14 09:45:28 +00:00
trap.ll
triple.ll
tst_teq.ll
unord.ll
vargs.ll [ARM] Refactor the prologue/epilogue emission to be more robust. 2015-07-20 21:42:14 +00:00