OSDN Git Service

[MachineOutliner][AArch64] Add support for saving LR to a register
authorJessica Paquette <jpaquette@apple.com>
Mon, 30 Jul 2018 17:45:28 +0000 (17:45 +0000)
committerJessica Paquette <jpaquette@apple.com>
Mon, 30 Jul 2018 17:45:28 +0000 (17:45 +0000)
commit54b04a891a5732d1e251d2d8e65c828dba735fff
tree430ad15f64f1da3798daad6f86de690e81124bf0
parent45a1b043b06fb8570afcd34717c429e7540edfbe
[MachineOutliner][AArch64] Add support for saving LR to a register

This teaches the outliner to save LR to a register rather than the stack when
possible. This allows us to avoid bumping the stack in outlined functions in
some cases. By doing this, in a later patch, we can teach the outliner to do
something like this:

f1:
  ...
  bl OUTLINED_FUNCTION
  ...

f2:
  ...
  move LR's contents to a register
  bl OUTLINED_FUNCTION
  move the register's contents back

instead of falling back to saving LR in both cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338278 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/MachineOutliner.h
lib/Target/AArch64/AArch64InstrInfo.cpp
lib/Target/AArch64/AArch64InstrInfo.h
test/CodeGen/AArch64/machine-outliner-regsave.mir [new file with mode: 0644]
test/CodeGen/AArch64/machine-outliner.ll
test/CodeGen/AArch64/machine-outliner.mir