[PATCH] D49884: [MachineOutliner] Add support for saving LR to a callee-saved register

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 26 15:52:46 PDT 2018


paquette created this revision.
paquette added a reviewer: MatzeB.
Herald added a reviewer: javed.absar.

When the prospective caller of an outlined function saves registers, we can save LR to one of those registers instead of the stack. This teaches the outliner to do that 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:
    ...
    save LR
    bl OUTLINED_FUNCTION
    restore LR
    ...

instead of falling back to saving LR in both cases.


https://reviews.llvm.org/D49884

Files:
  include/llvm/CodeGen/MachineOutliner.h
  lib/Target/AArch64/AArch64InstrInfo.cpp
  lib/Target/AArch64/AArch64InstrInfo.h
  test/CodeGen/AArch64/machine-outliner-regsave.mir
  test/CodeGen/AArch64/machine-outliner.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49884.157597.patch
Type: text/x-patch
Size: 18260 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180726/3b95b5ba/attachment.bin>


More information about the llvm-commits mailing list